Your message dated Fri, 02 Dec 2011 21:06:41 +0000
with message-id <[email protected]>
and subject line Bug#564791: fixed in git-buildpackage 0.6.0~git20111202
has caused the Debian Bug report #564791,
regarding --git-export doesn't work when specified version's upstream version 
!= HEAD's upstream version
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
564791: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564791
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: git-buildpackage
Version: 0.4.63
Tags: patch

git-buildpackage fails when --git-export specifies a version whose
upstream version is not the same as HEAD's upstream version. Transcript:

    # head -1 debian/changelog 
    python-pysqlite2 (2.5.5-3) unstable; urgency=low
    # git-buildpackage --git-pristine-tar --git-export-dir=../build 
--git-export=debian/2.4.1-1
    dh_testdir
    dh_testroot
    rm -f build*stamp dbg-build*stamp
    rm -rf build
    find . -name '*.pyc' | xargs rm -f
    dh_clean
    pristine-tar: successfully generated 
/root/git/build/python-pysqlite2_2.5.5.orig.tar.gz
    Exporting 'debian/2.4.1-1' to '/root/git/build/python-pysqlite2-tmp'
    This package has a Debian revision number but there does not seem to be
    an appropriate original tar file or .orig directory in the parent directory;
    (expected one of python-pysqlite2_2.4.1.orig.tar.gz, 
python-pysqlite2_2.4.1.orig.tar.bz2,
    python-pysqlite2_2.4.1.orig.tar.lzma or python-pysqlite2-2.5.5.orig)
    continue anyway? (y/n) 

As can be seen above, git-buildpackage creates the original tar file
from HEAD's upstream version, which of course leads to failure.

Attached is a patch that fixes the problem for me. It's not heavily
tested, but works for me and my use cases. I have not tried the overlay
feature or other exotic option combinations.

Regards,
Joel
--- /usr/bin/git-buildpackage.orig	2010-01-11 22:26:54.000000000 +0100
+++ /usr/bin/git-buildpackage	2010-01-11 23:00:03.000000000 +0100
@@ -278,21 +278,6 @@
                 print >>sys.stderr, "You are not on branch '%s' but on '%s'" % (options.debian_branch, branch)
                 raise GbpError, "Use --git-ignore-new to ignore or --git-debian-branch to set the branch name."
 
-        try:
-            cp = du.parse_changelog(changelog)
-            version = cp['Version']
-            version_no_epoch = cp['NoEpoch-Version']
-            if du.is_native(cp):
-                major = cp['Debian-Version']
-            else:
-                major = cp['Upstream-Version']
-        except du.NoChangelogError:
-            raise GbpError, "'%s' does not exist, not a debian package" % changelog
-        except du.ParseChangeLogError, err:
-            raise GbpError, "Error parsing Changelog: %s" % err
-        except KeyError:
-            raise GbpError, "Can't parse version from changelog"
-
         if not options.tag_only:
             output_dir = prepare_output_dir(options.export_dir)
             if options.tarball_dir:
@@ -300,21 +285,13 @@
             else:
                 tarball_dir = output_dir
 
-            # Get/build the orig.tar.gz if necessary:
-            if not du.is_native(cp):
-                orig_file = du.orig_file(cp, options.comp_type)
-
-                # look in tarball_dir first, if found force a symlink to it
-                if options.tarball_dir:
-                    print "Looking for orig tarball '%s' at '%s'" % (orig_file, tarball_dir)
-                    if not du.symlink_orig(cp, options.comp_type, tarball_dir, output_dir, force=True):
-                        print "Orig tarball '%s' not found at '%s'" % (orig_file, tarball_dir)
-                    else:
-                        print "Orig tarball '%s' found at '%s'" % (orig_file, tarball_dir)
-                # build an orig unless the user forbidds it
-                if not options.no_create_orig and not du.has_orig(cp, options.comp_type, output_dir):
-                    if not pristine_tar_build_orig(repo, cp, output_dir, options):
-                        git_archive_build_orig(repo, cp, output_dir, options)
+            # Parse changelog just to get source package name.
+            try:
+                cp = du.parse_changelog(changelog)
+            except du.NoChangelogError:
+                raise GbpError, "'%s' does not exist, not a debian package" % changelog
+            except du.ParseChangeLogError, err:
+                raise GbpError, "Error parsing Changelog: %s" % err
 
             # Export to another build dir if requested:
             if options.export_dir:
@@ -337,16 +314,49 @@
 
                 print "Exporting '%s' to '%s'" % (options.export, tmp_dir)
                 dump_tree(tmp_dir, tree)
-                cp = du.parse_changelog(os.path.join(tmp_dir, 'debian', 'changelog'))
+                changelog = os.path.join(tmp_dir, changelog)
+
+            # Now parse the correct changelog to get hold of the version.
+            try:
+                cp = du.parse_changelog(changelog)
+                version = cp['Version']
+                version_no_epoch = cp['NoEpoch-Version']
+            except du.NoChangelogError:
+                raise GbpError, "'%s' does not exist, not a debian package" % changelog
+            except du.ParseChangeLogError, err:
+                raise GbpError, "Error parsing Changelog: %s" % err
+            except KeyError:
+                raise GbpError, "Can't parse version from changelog"
+
+            # Continue exporting if requested.
+            if options.export_dir:
+                if du.is_native(cp):
+                    major = cp['Debian-Version']
+                else:
+                    major = cp['Upstream-Version']
                 export_dir = os.path.join(output_dir, "%s-%s" % (cp['Source'], major))
                 move_old_export(export_dir)
                 os.rename(tmp_dir, export_dir)
-
-            if options.export_dir:
                 build_dir = export_dir
             else:
                 build_dir = repo_dir
 
+            # Get/build the orig.tar.gz if necessary:
+            if not du.is_native(cp):
+                orig_file = du.orig_file(cp, options.comp_type)
+
+                # look in tarball_dir first, if found force a symlink to it
+                if options.tarball_dir:
+                    print "Looking for orig tarball '%s' at '%s'" % (orig_file, tarball_dir)
+                    if not du.symlink_orig(cp, options.comp_type, tarball_dir, output_dir, force=True):
+                        print "Orig tarball '%s' not found at '%s'" % (orig_file, tarball_dir)
+                    else:
+                        print "Orig tarball '%s' found at '%s'" % (orig_file, tarball_dir)
+                # build an orig unless the user forbidds it
+                if not options.no_create_orig and not du.has_orig(cp, options.comp_type, output_dir):
+                    if not pristine_tar_build_orig(repo, cp, output_dir, options):
+                        git_archive_build_orig(repo, cp, output_dir, options)
+
             # Finally build the package:
             RunAtCommand(options.builder, dpkg_args, shell=True, 
                          extra_env={'GBP_BUILD_DIR': build_dir})(dir=build_dir)

--- End Message ---
--- Begin Message ---
Source: git-buildpackage
Source-Version: 0.6.0~git20111202

We believe that the bug you reported is fixed in the latest version of
git-buildpackage, which is due to be installed in the Debian FTP archive:

git-buildpackage_0.6.0~git20111202.dsc
  to main/g/git-buildpackage/git-buildpackage_0.6.0~git20111202.dsc
git-buildpackage_0.6.0~git20111202.tar.gz
  to main/g/git-buildpackage/git-buildpackage_0.6.0~git20111202.tar.gz
git-buildpackage_0.6.0~git20111202_all.deb
  to main/g/git-buildpackage/git-buildpackage_0.6.0~git20111202_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guido Günther <[email protected]> (supplier of updated git-buildpackage package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 02 Dec 2011 19:19:51 +0100
Source: git-buildpackage
Binary: git-buildpackage
Architecture: source all
Version: 0.6.0~git20111202
Distribution: experimental
Urgency: low
Maintainer: Guido Günther <[email protected]>
Changed-By: Guido Günther <[email protected]>
Description: 
 git-buildpackage - Suite to help with Debian packages in Git repositories
Closes: 564791 582775 640982 643752 646400
Changes: 
 git-buildpackage (0.6.0~git20111202) experimental; urgency=low
 .
   [ Guido Günther ]
   * [3a3539a] Document that gbp-create-repo is noninteractive
     (Closes: #643752)
   * [bf397fc] gbp-pq: Properly check for start of signature (Closes: #646400)
   * [718f0c3] gbp-pq: Strip .patch and .diff when importing patches without a
     subject
   * [3fcf009] command_wrappers.Command: Don't print several error lines
   * [37e8310] Allow to import upstream tarballs into bare repositories
     (Closes: #582775)
   * [abf90ab] Allow to import Debian packages into bare repositories
   * [8c22803] gbp-pull: massive speedup by just updating the ref to the
     remote's SHA1 instead of checking out the branch and doing a fast-forward
     merge.
   * [af07c40] gbp-pq: Instead of looking for the signature don't let git
     generate it. Thanks to Robert Luberda
   * [69d348c] Support postexport hooks. Heavily based on a patch by Jan Čapek
     (Closes: #640982)
   * [030744d] Parse the changelog of the exported tree instead of the working
     copy when using --export. This reduces the number of options needed when
     using an export dir since the correct tarball is now being created without
     additional options. (Closes: #564791)
   * GitRepository: Lots of api, documentation and test updates replacing Git*
     classes by GitRepository methods. Check the apidocs for details.
   * [7168735] Switch to dh
 .
   [ Jan Čapek ]
   * [d2c1033] Documentation update for --git-postexport, --git-postbuild typo
     fix
   * [f7a6b07] Additional documentation for postexport hook in the manual - the
     documentation now provides sample postexport script and gbp.conf
Checksums-Sha1: 
 664010bcf5c32f2aff0e80ae5a8ec9c193f1428a 1243 
git-buildpackage_0.6.0~git20111202.dsc
 7ad2047fc51757174e28ab3e633095828145f0d3 124341 
git-buildpackage_0.6.0~git20111202.tar.gz
 0e99ea9601ab68da3fbd4d971080307c4033d22c 254514 
git-buildpackage_0.6.0~git20111202_all.deb
Checksums-Sha256: 
 ed4917ccf99abe441e5624568f1641113b41f5b4c6f1345d10942dd296193081 1243 
git-buildpackage_0.6.0~git20111202.dsc
 c86fd344ac8944b615f3c64f7ad944f560aeeac5fcf669fb64053195752fe67c 124341 
git-buildpackage_0.6.0~git20111202.tar.gz
 b2942d14a7e755f2e9ff48af319ba5ba28f85ac98b9841ea36c1927575502394 254514 
git-buildpackage_0.6.0~git20111202_all.deb
Files: 
 814ef0f53b9ef5660088588ab6bb9139 1243 vcs optional 
git-buildpackage_0.6.0~git20111202.dsc
 827802ce0f6b27b29830c5bc1c359f87 124341 vcs optional 
git-buildpackage_0.6.0~git20111202.tar.gz
 ea6c87076cbc68c572b7578b91e88ad2 254514 vcs optional 
git-buildpackage_0.6.0~git20111202_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iD8DBQFO2TTwn88szT8+ZCYRAnH3AJ9gOQ4MV+RbzRZZ+4jEq31fA5UhiQCfcsKC
OrklteKzOGph4DEb9jGd56o=
=qAST
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to