From 534bef7e9cedc347fcb5209fbf3f7b720a466cd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@gdebian.org>
Date: Sat, 27 Nov 2010 22:10:43 +0100
Subject: [PATCH 6/7] change default source package format to 3.0 (quilt)

---
 stdeb/command/sdist_dsc.py |    3 ++-
 stdeb/util.py              |    6 ++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/stdeb/command/sdist_dsc.py b/stdeb/command/sdist_dsc.py
index 852092b..7e86e99 100644
--- a/stdeb/command/sdist_dsc.py
+++ b/stdeb/command/sdist_dsc.py
@@ -76,7 +76,8 @@ class sdist_dsc(common_debian_package_command):
             expand_sdist_file(self.use_premade_distfile,cwd=expand_dir)
 
             is_tgz=False
-            if self.use_premade_distfile.lower().endswith('.tar.gz'):
+            fext = '.'.join(self.use_premade_distfile.rsplit('.', 2)[-2:])
+            if fext.lower() in ('tar.gz', 'tar.bz2', 'tar.xz'):
                 is_tgz=True
 
             # now the sdist package is expanded in expand_dir
diff --git a/stdeb/util.py b/stdeb/util.py
index e036f8b..8bdb7a5 100644
--- a/stdeb/util.py
+++ b/stdeb/util.py
@@ -1126,7 +1126,7 @@ def build_dsc(debinfo,
     #    J. debian/source/format
     os.mkdir(os.path.join(debian_dir,'source'))
     fd = open( os.path.join(debian_dir,'source','format'), mode='w')
-    fd.write('1.0\n')
+    fd.write('3.0 (quilt)\n')
     fd.close()
 
     if debian_dir_only:
@@ -1199,13 +1199,11 @@ def build_dsc(debinfo,
     #    Re-generate tarball using best practices see
     #    http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html
     #    call "dpkg-source -b new_dirname orig_dirname"
-    log.info('CALLING dpkg-source -b %s %s (in dir %s)'%(
+    log.info('CALLING dpkg-source -b %s (in dir %s)'%(
         repackaged_dirname,
-        repackaged_orig_tarball,
         dist_dir))
 
     dpkg_source('-b',repackaged_dirname,
-                repackaged_orig_tarball,
                 cwd=dist_dir)
 
     if 1:
-- 
1.7.2.3

