X-Git-Url: http://git.scottworley.com/pinch/blobdiff_plain/f9cd7bdc50fad6c24ac226a6532ecfb81d78cbe2..f15e458d6371d1074d0d91cf7cf9a5312a467b80:/pinch.py?ds=inline diff --git a/pinch.py b/pinch.py index c77d891..1dbd667 100644 --- a/pinch.py +++ b/pinch.py @@ -1,3 +1,4 @@ +import configparser import filecmp import functools import hashlib @@ -6,6 +7,7 @@ import os import os.path import shutil import subprocess +import sys import tempfile import types import urllib.parse @@ -357,11 +359,11 @@ def check_channel_contents(v: Verification, channel: Channel) -> None: v.ok() -def main() -> None: +def main(argv: List[str]) -> None: v = Verification() - channel = Channel(url='https://channels.nixos.org/nixos-20.03', - git_repo='https://github.com/NixOS/nixpkgs.git', - git_ref='nixos-20.03') + config = configparser.ConfigParser() + config.read_file(open(argv[1]), argv[1]) + channel = Channel(**dict(config['nixos'].items())) fetch(v, channel) parse_channel(v, channel) fetch_resources(v, channel) @@ -370,4 +372,4 @@ def main() -> None: print(channel) -main() +main(sys.argv)