From: Scott Worley Date: Mon, 15 Jun 2020 20:35:03 +0000 (-0700) Subject: Continue pulling release_name and git_revision out of SearchPath X-Git-Tag: 2.0.0~12 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/b17278e340d8524cfe0eb933d21b64013ef9f31a?hp=d7cfdb226f4463b96a3ce50f93142e4b6c0d8420 Continue pulling release_name and git_revision out of SearchPath --- diff --git a/pinch.py b/pinch.py index 1b11709..916739d 100644 --- a/pinch.py +++ b/pinch.py @@ -174,7 +174,7 @@ class ChannelSearchPath(TarrableSearchPath): ensure_git_rev_available(v, self, new_gitpin, old_revision) check_channel_contents(v, self) return ChannelPin( - release_name=self.release_name, + release_name=new_gitpin.release_name, tarball_url=self.table['nixexprs.tar.xz'].absolute_url, tarball_sha256=self.table['nixexprs.tar.xz'].digest, git_revision=self.git_revision) @@ -241,7 +241,6 @@ def parse_channel(v: Verification, channel: TarrableSearchPath) -> GitPin: h1_name = d.getElementsByTagName('h1')[0].firstChild.nodeValue.split()[2] v.status(title_name) v.result(title_name == h1_name) - channel.release_name = title_name v.status('Extracting git commit:') git_commit_node = d.getElementsByTagName('tt')[0] @@ -334,14 +333,14 @@ def git_cachedir(git_repo: str) -> str: digest_string(git_repo.encode())) -def tarball_cache_file(channel: TarrableSearchPath) -> str: +def tarball_cache_file(channel: TarrableSearchPath, pin: GitPin) -> str: return os.path.join( xdg.XDG_CACHE_HOME, 'pinch/git-tarball', '%s-%s-%s' % (digest_string(channel.git_repo.encode()), - channel.git_revision, - channel.release_name)) + pin.git_revision, + pin.release_name)) def verify_git_ancestry( @@ -512,7 +511,7 @@ def git_get_tarball( v: Verification, channel: TarrableSearchPath, pin: GitPin) -> str: - cache_file = tarball_cache_file(channel) + cache_file = tarball_cache_file(channel, pin) if os.path.exists(cache_file): cached_tarball = open(cache_file).read(9999) if os.path.exists(cached_tarball):