pristine-tar import support and update dependency release-0.11 0.11
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 2 Nov 2012 13:21:41 +0000 (21:21 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 2 Nov 2012 13:23:36 +0000 (21:23 +0800)
Change-Id: I830c4ff4ff6c95d8713584c098faf77c264f6536

debian/control
distfiles/gbs.spec
gitbuildsys/cmd_import.py
tests/test_import.py
tools/gbs

index 93f845b..de4b086 100644 (file)
@@ -15,7 +15,8 @@ Depends: ${misc:Depends}, ${python:Depends},
  sudo,
  osc (>= 0.136.0),
  git-buildpackage-rpm (>= 0.6.0git20120822-tizen20121025),
- depanneur (>= 0.2)
+ depanneur (>= 0.2),
+ pristine-tar
 Description: The command line tools for Tizen package developers
   The command line tools for Tizen package developers will
   be used to do packaging related tasks.
index 2e0a526..a956269 100644 (file)
@@ -15,6 +15,7 @@ Requires:   sudo
 Requires:   osc >= 0.136.0
 Requires:   tizen-gbp-rpm >= 2012.10.25
 Requires:   depanneur >= 0.2
+Requires:   pristine-tar
 
 BuildRequires:  python-devel
 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
index 64e0396..64e3007 100644 (file)
@@ -39,6 +39,8 @@ def main(args):
     params = ["argv[0] placeholder",
               "--packaging-dir=%s" % get_packaging_dir(args),
               "--upstream-branch=%s" % args.upstream_branch, path]
+    if not args.no_pristine_tar and os.path.exists("/usr/bin/pristine-tar"):
+        params.append("--pristine-tar")
 
     if path.endswith('.src.rpm') or path.endswith('.spec'):
         params.append("--no-patch-import")
index 3fa70d9..87b2d4d 100644 (file)
@@ -82,7 +82,7 @@ class TestImport(unittest.TestCase):
         """Test importing from source rpm."""
         eq_(GBS(argv=["gbs", "import", srcrpm]), None)
         repo = GitRepository("./ail")
-        eq_(repo.get_local_branches(), ['master', 'upstream'])
+        eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
         eq_(repo.get_tags(), ['upstream/0.2.29', 'vendor/0.2.29-2.3'])
 
     @with_data("bluez_unpacked")
@@ -91,7 +91,7 @@ class TestImport(unittest.TestCase):
         eq_(GBS(argv=["gbs", "import",
                       os.path.join(srcdir, 'bluez.spec')]), None)
         repo = GitRepository("./bluez")
-        eq_(repo.get_local_branches(), ['master', 'upstream'])
+        eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
         eq_(repo.get_tags(), ['upstream/4.87', 'vendor/4.87-1'])
 
         #raise Exception(os.listdir('./bluez'))
@@ -103,7 +103,7 @@ class TestImport(unittest.TestCase):
         repo = GitRepository.create("./repo_dir")
         os.chdir(repo.path)
         eq_(GBS(argv=["gbs", "import", srcrpm]), None)
-        eq_(repo.get_local_branches(), ['master', 'upstream'])
+        eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
         eq_(repo.get_tags(), ['upstream/0.2.29', 'vendor/0.2.29-2.5'])
 
         #raise Exception(os.listdir('./bluez'))
@@ -115,7 +115,7 @@ class TestImport(unittest.TestCase):
                       "--author-email=test@otctools.jf.intel.com",
                       srcrpm]), None)
         repo = GitRepository("./app-core")
-        eq_(repo.get_local_branches(), ['master', 'upstream'])
+        eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
         eq_(repo.get_tags(), ['upstream/1.2', 'vendor/1.2-19.3'])
 
     @with_data("ail-0.2.29-2.3.src.rpm")
@@ -124,7 +124,7 @@ class TestImport(unittest.TestCase):
         eq_(GBS(argv=["gbs", "import", "--upstream=upstream",
                       srcrpm]), None)
         repo = GitRepository("./ail")
-        eq_(repo.get_local_branches(), ['master', 'upstream'])
+        eq_(repo.get_local_branches(), ['master', 'pristine-tar', 'upstream'])
         eq_(repo.get_tags(), ['upstream/0.2.29', 'vendor/0.2.29-2.3'])
 
     @raises(SystemExit)
index 6816276..fb35e0e 100755 (executable)
--- a/tools/gbs
+++ b/tools/gbs
@@ -56,6 +56,11 @@ def import_parser(parser):
                          help='don\'t merge new upstream branch to master')
     parser.add_argument('--packaging-dir',
                         help='directory containing packaging files')
+    parser.add_argument('--no-pristine-tar', action='store_true',
+                         help='don\'t use pristine-tar to import source. '
+                        'pristine-tar only support import *tar.{gz,bz2,xz} '
+                        'sources, this option can be specified to import '
+                        'other format sources')
 
     parser.set_defaults(alias="im")
     return parser