+
+
+def make_channel(conf: configparser.SectionProxy) -> Channel:
+ channel = Channel(**dict(conf.items()))
+ if hasattr(channel, 'git_revision'):
+ channel.old_git_revision = channel.git_revision
+ del channel.git_revision
+ return channel
+
+
+def main(argv: List[str]) -> None:
+ v = Verification()
+ config = configparser.ConfigParser()
+ config.read_file(open(argv[1]), argv[1])
+ for section in config.sections():
+ channel = make_channel(config[section])
+ if 'channel_url' in config[section]:
+ pin_channel(v, channel)
+ config[section]['tarball_url'] = channel.table['nixexprs.tar.xz'].absolute_url
+ config[section]['tarball_sha256'] = channel.table['nixexprs.tar.xz'].digest
+ else:
+ git_fetch(v, channel)
+ config[section]['git_revision'] = channel.git_revision
+
+ with open(argv[1], 'w') as configfile:
+ config.write(configfile)