Bug#861183: [PATCH] redact the build directory out of the glibc-source tarball paths

2017-04-25 Thread Aurelien Jarno
On 2017-04-25 15:46, Andrew Shadura wrote:
> Package: glibc-source
> Version: 2.24-10
> Severity: important

I fail to see why it is an important bug, IMHO it should be minor or
normal.

> Tags: patch
> Control: affects -1 cross-toolchain-base
> X-Debbugs-Cc: Aurelien Jarno 
> 
> Hi,
> 
> We’re building a downstream distribution based on Debian using OBS, and
> it unpacks packages differently than Debian buildds do.

I guess you don't use the default directory created by dpkg-source.

> When the tarball for glibc-source package is being created, the
> directory name where the package is unpacked may be captured by tar and
> embedded into the tarball paths. On its own it may cause further
> inconvenience when unpacking the tarball, but quite a practical downside
> of that is that one of the Debian packages in affected by
> this: cross-toolchain-base fails to unpack glibc tarball, or more
> precisely, unpacks it into a different directory compared to what it
> expects, and the build fails.
> 
> This patch mitigates this issue, replacing the glibc-source tarball path
> prefix with glibc-$(GLIBC_VERSION) using tar’s --xform option.

Thanks for the patch, it looks fine. That said I guess we actually avoid
adding the unpack directory to GLIBC_SOURCES and transforming that.

I'll look at that when applying the patch, after the freeze.

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net


signature.asc
Description: PGP signature


Bug#861183: [PATCH] redact the build directory out of the glibc-source tarball paths

2017-04-25 Thread Andrew Shadura
Package: glibc-source
Version: 2.24-10
Severity: important
Tags: patch
Control: affects -1 cross-toolchain-base
X-Debbugs-Cc: Aurelien Jarno 

Hi,

We’re building a downstream distribution based on Debian using OBS, and
it unpacks packages differently than Debian buildds do.

When the tarball for glibc-source package is being created, the
directory name where the package is unpacked may be captured by tar and
embedded into the tarball paths. On its own it may cause further
inconvenience when unpacking the tarball, but quite a practical downside
of that is that one of the Debian packages in affected by
this: cross-toolchain-base fails to unpack glibc tarball, or more
precisely, unpacks it into a different directory compared to what it
expects, and the build fails.

This patch mitigates this issue, replacing the glibc-source tarball path
prefix with glibc-$(GLIBC_VERSION) using tar’s --xform option.


-- 
Cheers,
  Andrew
From 66d1d2d072055613fc3ce83820dea1733377b401 Mon Sep 17 00:00:00 2001
From: Andrew Shadura 
Date: Tue, 25 Apr 2017 15:33:45 +0200
Subject: [PATCH] debian/rules.d/build.mk: redact the build directory out of
 the tarball paths

When the tarball for glibc-source package is being created, the
directory name where the package is unpacked may be captured by tar
and embedded into the tarball paths. This may cause further inconvenience
when unpacking the tarball. One of the Debian packages in affected by
this: cross-toolchain-base fails to unpack glibc tarball.

To mitigate the issue, replace the glibc-source tarball path prefix with
glibc-$(GLIBC_VERSION).

Signed-off-by: Andrew Shadura 
---
 debian/rules.d/build.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/rules.d/build.mk b/debian/rules.d/build.mk
index 1e9174e5..792d27c2 100644
--- a/debian/rules.d/build.mk
+++ b/debian/rules.d/build.mk
@@ -324,6 +324,7 @@ $(stamp)source: $(stamp)patch
 			--mode=go=rX,u+rw,a-s \
 			--clamp-mtime --mtime "@$(SOURCE_DATE_EPOCH)" \
 			--owner=root --group=root --numeric-owner \
+			--xform='s=^[^/]*\/=glibc-$(GLIBC_VERSION)/=' \
 			-f $(CURDIR)/$(build-tree)/glibc-$(GLIBC_VERSION).tar.xz
 	mkdir -p debian/glibc-source/usr/src/glibc
 	tar cf - --files-from debian/glibc-source.filelist \
-- 
2.11.0



signature.asc
Description: OpenPGP digital signature