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
df02db89
Commit
df02db89
authored
Aug 29, 2022
by
Holger Levsen
Browse files
reproducible Debian: refactoring
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
f71341bb
Changes
1
Show whitespace changes
Inline
Side-by-side
bin/reproducible_debstrap.sh
View file @
df02db89
...
@@ -27,6 +27,16 @@ cleanup() {
...
@@ -27,6 +27,16 @@ cleanup() {
fi
fi
}
}
cleanup_unreproducible_file
(){
TYPE
=
$1
FILE
=
$2
if
[
-f
$FILE
]
;
then
output_echo
"Warning: modifying
$TOOL
result, deleting
$TYPE
$FILE
"
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
/
$FILE
else
output_echo
"Warning: shall remove
$FILE
but it does not exist. Maybe
$TOOL
was improved."
fi
}
# Init some variables
# Init some variables
export
TOOL
=
"
$1
"
export
TOOL
=
"
$1
"
...
@@ -66,21 +76,11 @@ for LOOP in "first" "second" ; do
...
@@ -66,21 +76,11 @@ for LOOP in "first" "second" ; do
;;
;;
debootstrap|cdebootstrap
)
debootstrap|cdebootstrap
)
sudo
$REALTOOL
$SUITE
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
sudo
$REALTOOL
$SUITE
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
for
LOGFILE
in
/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log
;
do
for
FILE
in
/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log
;
do
if
[
-f
$LOGFILE
]
;
then
cleanup_unreproducible_file
"unreproducible logfile"
$FILE
output_echo
"Warning: modifying
$TOOL
result, deleting unreproducible logfile
$LOGFILE
"
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
/
$LOGFILE
else
output_echo
"Warning: shall remove
$LOGFILE
but it does not exist. Maybe
$TOOL
was improved."
fi
done
done
for
FILE
in
/etc/machine-id /var/cache/ldconfig/aux-cache
;
do
for
FILE
in
/etc/machine-id /var/cache/ldconfig/aux-cache
;
do
if
[
-f
$LOGFILE
]
;
then
cleanup_unreproducible_file
"unreproducible file"
$FILE
output_echo
"Warning: modifying
$TOOL
result, deleting unreproducible file
$FILE
because it will be created as needed"
sudo rm
-rf
--one-file-system
$BUILDDIR
/
$SUBDIR
/
${
TOOL
}
/
${
SUITE
}
/
$FILE
else
output_echo
"Warning: shall remove
$FILE
but it does not exist. Maybe
$TOOL
was improved."
fi
done
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