reassign 1065445 git-buildpackage
retitle 1065445 git-buildpackage: --pristine-tar fails if upstream tarball 
contains an empty directory
thanks

(See below for explanation.)

On Mon, Mar 04, 2024 at 09:20:02PM +0000, Julian Gilbey wrote:
> On Mon, Mar 04, 2024 at 08:53:25PM +0000, Julian Gilbey wrote:
> > Package: pristine-tar
> > Version: 1.50+nmu1
> > Severity: normal
> > 
> > I discovered that a package I was trying to use with pristine-tar
> > failed to work.  The cause of the issue seems to be that the upstream
> > tarball contains an empty directory, which is lost when regenerated by
> > pristine-tar.
> > 
> > Steps to reproduce using git-buildpackage:
> > 1. Import the attached minimal working example into git using the command:
> >    gbp import-dsc --pristine-tar foobar_1.0-1.dsc
> > 
> > 2. Change into the build directory:
> >    cd foobar
> > 
> > 3. Regenerate the original tar ball using pristine-tar, for example:
> >    gbp buildpackage -S
> > 
> > 4. Return to the parent directory, then:
> > 
> > $ tar ztf foobar_1.0.orig.tar.gz
> > foobar-1.0/
> > foobar-1.0/foobar.c
> > foobar-1.0/Makefile
> > foobar-1.0/emptydir/
> > $ tar ztf build-area/foobar_1.0.orig.tar.gz
> > foobar-1.0/
> > foobar-1.0/Makefile
> > foobar-1.0/foobar.c
> > 
> > Note the empty directory has disappeared.  Also:
> > 
> > $ ls -l foobar_1.0.orig.tar.gz build-area/foobar_1.0.orig.tar.gz
> > -rw-r--r-- 1 jdg jdg 253 Mar  4 20:51 build-area/foobar_1.0.orig.tar.gz
> > -rw-r--r-- 1 jdg jdg 193 Mar  4 20:00 foobar_1.0.orig.tar.gz
> > 
> > Best wishes,
> > 
> >    Julian
> 
> I forgot to attach the foobar package, here it is.
> 
>    Julian

I checked pristine-tar directly on this example, and it turns out that
it can handle this situation with no problem, as long as the directory
tree has the empty directory present when pristine-tar gentar is
called.  The problem only emerges when git-buildpackage is being used,
as in the example I gave in the original bug report.  I presume that
this problem arises because git does not record the presence of empty
directories, so the resulting created tar file does not know about
them either.

Best wishes,

   Julian

Reply via email to