Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian QA
jenkins.debian.net
Commits
661879f8
Commit
661879f8
authored
Aug 29, 2022
by
Holger Levsen
Browse files
reproducible Debian: refactoring
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
835bdc62
Changes
1
Show whitespace changes
Inline
Side-by-side
bin/reproducible_debstrap.sh
View file @
661879f8
...
@@ -28,8 +28,8 @@ cleanup() {
...
@@ -28,8 +28,8 @@ cleanup() {
}
}
cleanup_unreproducible_file
(){
cleanup_unreproducible_file
(){
TYPE
=
$1
local
TYPE
=
$1
FILE
=
$2
local
FILE
=
$2
if
[
-f
$FILE
]
;
then
if
[
-f
$FILE
]
;
then
output_echo
"Warning: modifying
$TOOL
result, deleting
$TYPE
$FILE
"
output_echo
"Warning: modifying
$TOOL
result, deleting
$TYPE
$FILE
"
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
/
$FILE
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
/
$FILE
...
@@ -76,17 +76,21 @@ for LOOP in "first" "second" ; do
...
@@ -76,17 +76,21 @@ for LOOP in "first" "second" ; do
;;
;;
debootstrap|cdebootstrap
)
debootstrap|cdebootstrap
)
sudo
$REALTOOL
$SUITE
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
sudo
$REALTOOL
$SUITE
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
# work around logfiles and files kept by both debootstrap and cdebootstrap
# work around unreproducible artifacts
for
FILE
in
/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log
;
do
case
${
TOOL
}
in
debootstrap
)
BAD_LOGFILES
=
"/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log"
BAD_FILES
=
"/etc/machine-id /var/cache/ldconfig/aux-cache"
;;
cdebootstrap
)
BAD_LOGFILES
=
"/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log /var/log/apt/history.log /var/log/apt/term.log"
BAD_FILES
=
"/etc/machine-id"
;;
esac
for
FILE
in
$BAD_LOGFILES
;
do
cleanup_unreproducible_file
"unreproducible logfile"
$FILE
cleanup_unreproducible_file
"unreproducible logfile"
$FILE
done
done
for
FILE
in
/etc/machine-id /var/cache/ldconfig/aux-cache
;
do
for
FILE
in
$BAD_FILES
;
do
cleanup_unreproducible_file
"unreproducible file"
$FILE
cleanup_unreproducible_file
"unreproducible file"
$FILE
done
done
# work around some more logfiles kept only by cdebootstrap
for
FILE
in
/var/log/apt/history.log /var/log/apt/term.log /var/log/bootstrap.log
;
do
cleanup_unreproducible_file
"unreproducible logfile"
$FILE
done
sudo tar
--mtime
=
"@
$SOURCE_DATE_EPOCH
"
--clamp-mtime
-C
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
-cf
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
.tar
${
SUITE
}
sudo tar
--mtime
=
"@
$SOURCE_DATE_EPOCH
"
--clamp-mtime
-C
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
-cf
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
.tar
${
SUITE
}
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
;;
;;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment