diff --git a/conda/clean-betas.py b/conda/clean-betas.py
index 6b7e519c097f6c724f3c18a18e1c347ba13254d1..00ff553d44555ded0a273c9a13290b7e6ef98532 100755
--- a/conda/clean-betas.py
+++ b/conda/clean-betas.py
@@ -9,18 +9,19 @@ import sys
 from distutils.version import StrictVersion
 
 
-package_regex = re.compile(r'^(?P<name>\S+)-(?P<version>\d+\.\d+\.\d+[abc]\d+)-(?P<hash>(py\d\d)?h[0-9a-f]{7})_(?P<build>\d+)(?P<extension>\.tar\.bz2)$')
+package_regex = re.compile(r'^(?P<name>\S+)-(?P<version>\d+\.\d+\.\d+[abc]\d+)-(?P<python>(py\d\d))?(?P<hash>h[0-9a-f]{7})_(?P<build>\d+)(?P<extension>\.tar\.bz2)$')
 
 
 def check_regex():
   """Tests for the above regex"""
 
 
-  def _check(s, name, version, _hash, build, ext):
+  def _check(s, name, version, py, _hash, build, ext):
     m = package_regex.match(s)
     assert m is not None, 'expected match for %s' % s
     assert m.group('name') == name, '%r != %r' % (m.group('name'), name)
     assert m.group('version') == version, '%r != %r' % (m.group('version'), version)
+    assert m.group('python') == py, '%r != %r' % (m.group('python'), py)
     assert m.group('hash') == _hash, '%r != %r' % (m.group('hash'), _hash)
     assert m.group('build') == build, '%r != %r' % (m.group('build'), build)
     assert m.group('extension') == ext, '%r != %r' % (m.group('extension'), ext)
@@ -28,28 +29,28 @@ def check_regex():
 
   # This regexp must match the following examples:
   _check('docs-2018.02.21b0-h7a51f39_0.tar.bz2', 'docs', '2018.02.21b0',
-      'h7a51f39', '0', '.tar.bz2')
+      None, 'h7a51f39', '0', '.tar.bz2')
 
   _check('docs-with-dashes-2018.02.21b0-h7a51f39_0.tar.bz2',
-      'docs-with-dashes', '2018.02.21b0', 'h7a51f39', '0', '.tar.bz2')
+      'docs-with-dashes', '2018.02.21b0', None, 'h7a51f39', '0', '.tar.bz2')
 
   _check('bob.sp-2.0.11b0-py27h21b2d43_7.tar.bz2', 'bob.sp', '2.0.11b0',
-      'py27h21b2d43', '7', '.tar.bz2')
+      'py27', 'h21b2d43', '7', '.tar.bz2')
 
-  _check('gridtk-1.5.1b0-py27h361992c_4.tar.bz2', 'gridtk', '1.5.1b0',
-      'py27h361992c', '4', '.tar.bz2')
+  _check('gridtk-1.5.1b0-py36h361992c_4.tar.bz2', 'gridtk', '1.5.1b0',
+      'py36', 'h361992c', '4', '.tar.bz2')
 
   _check('bob.measure-2.5.0b0-py36h81a6768_11.tar.bz2', 'bob.measure',
-    '2.5.0b0', 'py36h81a6768', '11', '.tar.bz2')
+    '2.5.0b0', 'py36', 'h81a6768', '11', '.tar.bz2')
 
   _check('bob.ip.caffe_extractor-1.1.2b0-py27hc65a447_0.tar.bz2',
-      'bob.ip.caffe_extractor', '1.1.2b0', 'py27hc65a447', '0', '.tar.bz2')
+      'bob.ip.caffe_extractor', '1.1.2b0', 'py27', 'hc65a447', '0', '.tar.bz2')
 
   _check('bob.db.msu_mfsd_mod-2.2.4b0-py27h2410e3f_2.tar.bz2',
-      'bob.db.msu_mfsd_mod', '2.2.4b0', 'py27h2410e3f', '2', '.tar.bz2')
+      'bob.db.msu_mfsd_mod', '2.2.4b0', 'py27', 'h2410e3f', '2', '.tar.bz2')
 
   _check('bob-3.0.1b0-py27h2dcd9c5_5.tar.bz2', 'bob', '3.0.1b0',
-      'py27h2dcd9c5', '5', '.tar.bz2')
+      'py27', 'h2dcd9c5', '5', '.tar.bz2')
 
   # This regexp must **not** match the following examples
   assert package_regex.match('zc.buildout-2.10.0-py27_0.tar.bz2') is None
@@ -77,22 +78,25 @@ def main(scandir, dry_run):
 
       # got a beta package since it matches our regex, insert it into our
       # list of packages to evaluate
-      betas.setdefault(m.group('name'), []).append((
-        StrictVersion(m.group('version')),
-        int(m.group('build')),
+      name = os.path.basename(path) + '-' + m.group('name')
+      if m.group('python') is not None: name += '-' + m.group('python')
+      betas.setdefault(name, []).append((
+        StrictVersion(m.group('version')), #version
+        int(m.group('build')), #build number
+        os.path.getmtime(path), #cross-platform last modification time
         os.path.join(path, f),
         ))
 
-  count = sum([len(k) for k in betas.values]) - len(betas)
+  count = sum([len(k) for k in betas.values()]) - len(betas)
   print('end of scan: prunning %d packages' % count)
 
   for name in sorted(betas.keys()):
     print('packages for %s (%d):' % (name, len(betas[name])))
     sorted_packages = sorted(betas[name])
-    for version, build, path in sorted_packages[:-1]:
-      print('unlink %s' % path)
+    for version, build, mtime, path in sorted_packages[:-1]:
+      print('unlink %s (%u)' % (path, mtime))
       if not dry_run: os.unlink(path)
-    print('keeping %s' % sorted_packages[-1])
+    print('keeping %s (%u)' % (sorted_packages[-1][3], sorted_packages[-1][2]))
 
 
 if __name__ == '__main__':