]> git.scottworley.com Git - pinch/blobdiff - pinch.py
Reject duplicate channel names
[pinch] / pinch.py
index b044faf34c0304dbdd20b55c84c9d27bd1b3832a..787555f1c9a3c06831d52139b673a3e7e4e8087f 100644 (file)
--- a/pinch.py
+++ b/pinch.py
@@ -514,6 +514,8 @@ def update(args: argparse.Namespace) -> None:
                 ensure_git_rev_available(v, channel)
                 tarball = git_get_tarball(v, channel)
 
+            if section in exprs:
+                raise Exception('Duplicate channel "%s"' % section)
             exprs[section] = (
                 'f: f { name = "%s"; channelName = "%%s"; src = builtins.storePath "%s"; }' %
                 (config[section]['release_name'], tarball))
@@ -521,6 +523,8 @@ def update(args: argparse.Namespace) -> None:
     for config in configs:
         for section in config.sections():
             if 'alias_of' in config[section]:
+                if section in exprs:
+                    raise Exception('Duplicate channel "%s"' % section)
                 exprs[section] = exprs[str(config[section]['alias_of'])]
 
     command = [