- channel = Channel(url='https://channels.nixos.org/nixos-20.03',
- git_repo='https://github.com/NixOS/nixpkgs.git',
- git_ref='nixos-20.03')
- fetch(v, channel)
- parse_channel(v, channel)
- fetch_resources(v, channel)
- git_fetch(v, channel)
- check_channel_contents(v, channel)
- print(channel)
-
-
-main()
+ config = configparser.ConfigParser()
+ config.read_file(open(argv[1]), argv[1])
+ for section in config.sections():
+ channel = Channel(**dict(config[section].items()))
+ fetch(v, channel)
+ parse_channel(v, channel)
+ fetch_resources(v, channel)
+ git_fetch(v, channel)
+ check_channel_contents(v, channel)
+ config[section]['git_rev'] = channel.git_revision
+ config[section]['tarball_url'] = channel.table['nixexprs.tar.xz'].absolute_url
+ config[section]['tarball_sha256'] = channel.table['nixexprs.tar.xz'].digest
+ with open(argv[1], 'w') as configfile:
+ config.write(configfile)
+
+
+main(sys.argv)