[rb-general] Bug#926242: jenkins.debian.org: Please test reproducibility status of Debian Installer images
Chris Lamb
lamby at debian.org
Wed Jun 12 10:19:14 UTC 2019
Philip Hands wrote:
> BTW I note that in the original (and therefore in this too) that the
> exclusion of cdrom: and the 'deb file' to 'deb copy' bits only work if
> there's no [option] bit in the line -- was that an oversight?
I would guess so, yes.
In light of that (and whilst my shell is a little rusty) but how about
we just make this all more explicit instead of abusing sed/awk?
For example:
get_mirrors () {
local file
local line
for file in $@; do
while read line
do
if ! echo "$line" | grep -qs '^deb[[:space:]]'; then
continue
fi
local options=
local uri="$(echo "$line" | cut -d' ' -f2)"
local dist="$(echo "$line" | cut -d' ' -f3)"
local components="$(echo "$line" | cut -d' ' -f4-)"
case "$uri" in
\[*)
options="$uri "
uri="$(echo "$line" | cut -d' ' -f3)"
dist="$(echo "$line" | cut -d' ' -f4)"
components="$(echo "$line" | cut -d' ' -f5-)"
;;
esac
case "$uri" in
cdrom:*|*security.debian.org*|*volatile.debian.*)
continue
;;
file:*)
uri="$(echo "${uri}" | sed 's,^file,copy,')"
;;
esac
echo "deb ${options}${uri} ${dist} ${components}"
done < $file
done
}
Best wishes,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org 🍥 chris-lamb.co.uk
`-
More information about the rb-general
mailing list