+
+ def pin(self, v: Verification, old_pin: Optional[Pin]) -> ChannelPin:
+ if old_pin is not None:
+ assert isinstance(old_pin, ChannelPin)
+ old_revision = old_pin.git_revision if old_pin is not None else None
+
+ channel_html, forwarded_url = fetch_channel(v, self)
+ table, new_gitpin = parse_channel(v, channel_html)
+ fetch_resources(v, new_gitpin, forwarded_url, table)
+ ensure_git_rev_available(v, self, new_gitpin, old_revision)
+ check_channel_contents(v, self, table, new_gitpin)
+ return ChannelPin(
+ release_name=new_gitpin.release_name,
+ tarball_url=table['nixexprs.tar.xz'].absolute_url,
+ tarball_sha256=table['nixexprs.tar.xz'].digest,
+ git_revision=new_gitpin.git_revision)
+
+ # pylint: disable=no-self-use
+ def fetch(self, v: Verification, pin: Pin) -> str:
+ assert isinstance(pin, ChannelPin)
+
+ return fetch_with_nix_prefetch_url(
+ v, pin.tarball_url, Digest16(pin.tarball_sha256))
+
+
+SearchPath = Union[AliasSearchPath, GitSearchPath, ChannelSearchPath]
+TarrableSearchPath = Union[GitSearchPath, ChannelSearchPath]