[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gbp upstream to pristine-tar, and import-orig filter




On Sat, Jul 7, 2018 at 10:38 PM Tong Sun wrote:
Hi, 

I have a question following https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html

> If upstream doesn't build upstream tarballs, or you don't care about them, the simplest way is to clone upstream's repository and create a separate packaging branch in there. You will not need gbp import-orig at all with this workflow. gbp buildpackage will handle creating the upstream tarballs needed for the Debian source package.

I cannot make it happening, no matter what I tried. 
How to make gbp buildpackage create the upstream tarballs and commit the generated tarball back to the pristine-tar branch?

Thanks to Shengjing Zhu's help, I was able to move one step further. 
(Oddly I don't have it in my inbox, but found it at
 https://lists.debian.org/debian-mentors/2018/07/msg00070.html)

I.e., what works is, 

gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='%(version)s'

Which is, 

using pristine-tar™ to make gbp buildpackage commit the generated tarball back to the pristine-tar branch using the --git-pristine-tar-commit option ... This will make sure others building your package can exactly regenerate the tarball you created when building the Debian™ package.  
- - https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html

I.e., I don't have a pristine tarball, and am using the above command to generate it for me. 

However, `gbp --git-pristine-tar` generated tarball confuses dpkg-source. Here is the full log, right from scratch:

------------------------------------
gbp clone https://github.com/neurobin/shc.git

cd shc
git checkout pristine-tar

# prepare my debian/ folder, then

$ ls -l ../
total 124
drwxrwx--x 7 u u   4096 2018-07-07 16:20 shc

$ gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='%(version)s'
dh clean  --with autotools_dev
   dh_testdir
   dh_auto_clean
   dh_autotools-dev_restoreconfig
   dh_clean
gbp:info: Creating /sysvol/dg/shc/shc_3.9.6.orig.tar.gz
gbp:info: Performing the build
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building shc using existing ./shc_3.9.6.orig.tar.gz
dpkg-source: info: local changes detected, the modified files are:
 shc/.travis.yml
dpkg-source: info: you can integrate the local changes with dpkg-source --commit
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/shc_3.9.6-1.diff.kENb1n
E: Failed to package source directory /sysvol/dg/shc/shc
gbp:error: 'sbuild --source-only-changes -s -v -A --no-clean-source' failed: it exited with 1

$ cat /tmp/shc_3.9.6-1.diff.kENb1n
...
--- /dev/null
+++ shc-3.9.6/.travis.yml
@@ -0,0 +1,5 @@
...

$ ls -l ../
total 124
drwxrwx--x 7 u u   4096 2018-07-07 16:20 shc
-rw-rw---- 1 u u 122644 2018-07-08 09:49 shc_3.9.6.orig.tar.gz
------------------------------------

I.e., `gbp --git-pristine-tar` is able to generate the tarball, but that  tarballconfuses dpkg-source into thinking there is unexpected upstream changes -- the .travis.yml file is not in the tarball, but only in upstream git (therefore in my master as well)

------------------------------------
$ ls .travis.yml 
.travis.yml

$ tar -tvzf ../shc_3.9.6.orig.tar.gz | grep travis | wc
      0       0       0

$ grep filter ~/.gbp.conf | wc 
      0       0       0
------------------------------------

I don't have import-orig filter myself, so removing the .travis.yml file is done by `gbp --git-pristine-tar`. This is a good thing, especially when the upstream contains files like,

    '*egg.info',
    '.bzr',
    '.hg',
    '.hgtags',
    '.svn',
    'CVS',

However, then, how to make `dpkg-source` happy as well, without complaining? I shouldn't remove them from  upstream git (therefore in my master as well), should I?

Thx


Reply to: