]> git.scottworley.com Git - pinch/commitdiff
Continue pulling release_name and git_revision out of SearchPath
authorScott Worley <scottworley@scottworley.com>
Mon, 15 Jun 2020 20:35:03 +0000 (13:35 -0700)
committerScott Worley <scottworley@scottworley.com>
Thu, 18 Jun 2020 06:15:29 +0000 (23:15 -0700)
pinch.py

index 1b11709901e79825fe98a3e9bb10699be374db9d..916739d32797d6179f4ebdf553abeeb69b354f8f 100644 (file)
--- 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):