def git_cachedir(git_repo: str) -> str:
# TODO: Consider using pyxdg to find this path.
return os.path.expanduser(
- '~/.cache/nix-pin-channel/git/%s' %
+ '~/.cache/pinch/git/%s' %
digest_string(
git_repo.encode()))
config = configparser.ConfigParser()
config.read_file(open(args.channels_file), args.channels_file)
for section in config.sections():
+ if args.channels and section not in args.channels:
+ continue
channel = Channel(**dict(config[section].items()))
if hasattr(channel, 'git_revision'):
subparsers = parser.add_subparsers(dest='mode', required=True)
parser_pin = subparsers.add_parser('pin')
parser_pin.add_argument('channels_file', type=str)
+ parser_pin.add_argument('channels', type=str, nargs='*')
parser_pin.set_defaults(func=pin)
parser_update = subparsers.add_parser('update')
parser_update.add_argument('channels_file', type=str)