[Reproducible-builds] [misc] 06/06: Use more precise file names

Stéphane Glondu glondu at moszumanska.debian.org
Sat Feb 22 19:10:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository misc.

commit df3e08a631e40c783f3ebce50fde6634588e1c62
Author: Stephane Glondu <steph at glondu.net>
Date:   Sat Feb 22 20:08:22 2014 +0100

    Use more precise file names
---
 rebuild-twice-in-same-path/pbuilder-execute | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/rebuild-twice-in-same-path/pbuilder-execute b/rebuild-twice-in-same-path/pbuilder-execute
index 184108d..9e31121 100755
--- a/rebuild-twice-in-same-path/pbuilder-execute
+++ b/rebuild-twice-in-same-path/pbuilder-execute
@@ -11,6 +11,7 @@ fi
 
 result=$1
 pkg=$2
+arch=$(dpkg-architecture -qDEB_BUILD_ARCH)
 
 if [ -z "$result" ] || [ -z "$pkg" ]; then
     echo "One argument is missing"
@@ -26,10 +27,17 @@ mkdir $result/$pkg || exit 3
 echo "Installing build-dependencies of $pkg..."
 
 apt-get build-dep -y $pkg > $result/$pkg/build-dep 2>&1 || exit 5
-aptitude search --disable-columns -F '%p %V' '~i' > $result/$pkg/installed-packages
 
 su -c "mkdir -p /tmp/src/a && cd /tmp/src/a && apt-get source $pkg | cat && cd .. && cp -a a b" pbuilder || exit 5
 
+version=$(echo /tmp/src/a/*.dsc)
+version=${version%.dsc}
+version=${version##*_}
+base=${pkg}_${version}_${arch}
+
+mv $result/$pkg/build-dep $result/$pkg/$base.deps
+aptitude search --disable-columns -F '%p %V' '~i' > $result/$pkg/$base.installed
+
 # Find the base name of build dir
 for u in /tmp/src/a/*; do
     if [ -d "$u" ]; then build_dir="${u##*/}"; fi
@@ -43,11 +51,11 @@ echo "First build of $pkg..."
 
 mkdir $result/$pkg/a
 mount --bind /tmp/src/a /usr/src/debian
-/usr/bin/time -o $result/$pkg/a/stats su -c "cd /usr/src/debian/$build_dir && DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b" pbuilder > $result/$pkg/a/log 2>&1
-du -sh /usr/src/debian >> $result/$pkg/a/stats
+/usr/bin/time -o $result/$pkg/a/$base.stats su -c "cd /usr/src/debian/$build_dir && DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b" pbuilder > $result/$pkg/a/$base.log 2>&1
+du -sh /usr/src/debian >> $result/$pkg/a/$base.stats
 umount /usr/src/debian
 
-changes=/tmp/src/a/*.changes
+changes=/tmp/src/a/$base.changes
 if [ ! -f $changes ]; then
     echo "First build of $pkg failed"
     exit 4
@@ -61,17 +69,17 @@ echo "Second build of $pkg..."
 
 mkdir $result/$pkg/b
 mount --bind /tmp/src/b /usr/src/debian
-/usr/bin/time -o $result/$pkg/b/stats su -c "cd /usr/src/debian/$build_dir && DEB_BUILD_OPTIONS=nocheck DEB_BUILD_TIMESTAMP=$timestamp dpkg-buildpackage -us -uc -b" pbuilder > $result/$pkg/b/log 2>&1
-du -sh /usr/src/debian >> $result/$pkg/b/stats
+/usr/bin/time -o $result/$pkg/b/$base.stats su -c "cd /usr/src/debian/$build_dir && DEB_BUILD_OPTIONS=nocheck DEB_BUILD_TIMESTAMP=$timestamp dpkg-buildpackage -us -uc -b" pbuilder > $result/$pkg/b/$base.log 2>&1
+du -sh /usr/src/debian >> $result/$pkg/b/$base.stats
 umount /usr/src/debian
 
-changes=/tmp/src/b/*.changes
+changes=/tmp/src/b/$base.changes
 if [ ! -f $changes ]; then
     echo "Second build of $pkg failed"
     exit 4
 fi
 
-if diff -u $result/$pkg/a/*.changes $changes; then
+if diff -u $result/$pkg/a/$base.changes $changes; then
     touch $result/$pkg/b/reproducible
 else
     dcmd cp $changes $result/$pkg/b

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-builds mailing list