Commits

Virgil Dupras committed 7b448fe

In Debian packaging, create package for both precise and quantal.

  • Participants
  • Parent commits 0b60ff1

Comments (0)

Files changed (2)

 507a587c1f7c705d5632917c524adec644b54a8a cocoalib
-6266a54e9c8764502e4b0277c0fa4e3be392dbdb hscommon
+f7a669c39e01277dffc3fcaafc550982549eb0ae hscommon
 cb9818c35c5fe04c4366f0ad6cbfebea971a0310 qtlib
 def parse_args():
     parser = ArgumentParser()
     setup_package_argparser(parser)
-    parser.add_argument('--source', action='store_true', dest='source_pkg',
-        help="Build only a source debian package (Linux only).")
     return parser.parse_args()
 
 def package_cocoa(edition, args):
     if op.exists('installer_tmp.back.aip'):
         os.remove('installer_tmp.back.aip')
 
-def package_debian(edition, source_pkg):
+def package_debian_distribution(edition, distribution):
     app_version = get_module_version('core_{}'.format(edition))
+    version = '{}~{}'.format(app_version, distribution)
     ed = lambda s: s.format(edition)
-    destpath = op.join('build', 'dupeguru-{0}-{1}'.format(edition, app_version))
+    destpath = op.join('build', 'dupeguru-{0}-{1}'.format(edition, version))
     if op.exists(destpath):
         shutil.rmtree(destpath)
     srcpath = op.join(destpath, 'src')
     changelog_dest = op.join(debdest, 'changelog')
     project_name = debopts['pkgname']
     from_version = {'se': '2.9.2', 'me': '5.7.2', 'pe': '1.8.5'}[edition]
-    build_debian_changelog(changelogpath, changelog_dest, project_name, from_version=from_version)
+    build_debian_changelog(changelogpath, changelog_dest, project_name, from_version=from_version,
+        distribution=distribution)
     shutil.copytree(op.join('build', 'help'), op.join(srcpath, 'help'))
     shutil.copytree(op.join('build', 'locale'), op.join(srcpath, 'locale'))
     shutil.copy(op.join('images', ed('dg{0}_logo_128.png')), srcpath)
     compileall.compile_dir(srcpath)
     os.chdir(destpath)
-    cmd = "dpkg-buildpackage"
-    if source_pkg:
-        cmd += " -S"
+    cmd = "dpkg-buildpackage -S"
     os.system(cmd)
+    os.chdir('../..')
+
+def package_debian(edition):
+    for distribution in ['precise', 'quantal']:
+        package_debian_distribution(edition, distribution)
 
 def main():
     args = parse_args()
         if ISWINDOWS:
             package_windows(edition, dev)
         elif ISLINUX:
-            package_debian(edition, source_pkg=args.source_pkg)
+            package_debian(edition)
         else:
             print("Qt packaging only works under Windows or Linux.")