From 39101098cd80d21c723c808fd29b9d729b7eb3cd Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Fri, 2 Mar 2018 15:55:47 +0100
Subject: [PATCH] Minor fixes to clean-betas script

---
 conda/clean-betas.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/conda/clean-betas.py b/conda/clean-betas.py
index 1908d76..7e9c016 100755
--- a/conda/clean-betas.py
+++ b/conda/clean-betas.py
@@ -16,7 +16,7 @@ def main(scandir, dry_run):
     for f in filenames:
       if f.startswith('.'): continue
       if not f.endswith('.tar.bz2'): continue
-      name, version, build_string = filename[:-8].rsplit('-', 2)
+      name, version, build_string = f[:-8].rsplit('-', 2)
       build = build_string.rsplit('_')[-1]
 
       name = os.path.basename(path) + '/' + name
@@ -36,7 +36,7 @@ def main(scandir, dry_run):
   for name in sorted(betas.keys()):
     print('\n==== packages for %s (%d) ====' % (name, len(betas[name])))
     sorted_packages = sorted(betas[name])
-    keep_version, keep_build, _ = sorted_packages[-1]
+    keep_version, keep_build, _, path = sorted_packages[-1]
     for version, build, mtime, path in sorted_packages:
       if version == keep_version and build == keep_build:
         print('[keep] %s (%u)' % (path, mtime))
-- 
GitLab