Commit b54fe383 authored by Hideki Yamane's avatar Hideki Yamane

Merge branch 'henrich/debootstrap.invalid' into 'master'

Fix "debootstrap does not carry --components across --foreign/--second-stage" (Close: #877855) See merge request !7
parents 87d3e7bf 48d77abf
Pipeline #9212 passed with stage
in 2 minutes 16 seconds
......@@ -625,14 +625,9 @@ fi
. "$SCRIPT"
if [ "$SECOND_STAGE_ONLY" = "true" ]; then
MIRRORS=null:
else
MIRRORS="$DEF_MIRROR"
if [ "$USER_MIRROR" != "" ]; then
MIRRORS="$USER_MIRROR"
MIRRORS="${MIRRORS%/}"
fi
MIRRORS="$DEF_MIRROR"
if [ "$USER_MIRROR" != "" ]; then
MIRRORS="${USER_MIRROR%/}"
fi
export MIRRORS
......@@ -734,6 +729,13 @@ if am_doing_phase first_stage; then
chmod 755 "$TARGET/debootstrap/debootstrap"
fi
# create sources.list
if [ "${MIRRORS#http*://}" != "$MIRRORS" ]; then
setup_apt_sources "${MIRRORS%% *}"
else
setup_apt_sources "$DEF_MIRROR"
fi
fi
if am_doing_phase second_stage; then
......@@ -746,22 +748,8 @@ if am_doing_phase second_stage; then
# second stage uses the chroot to clean itself up -- has to be able to
# work from entirely within the chroot (in case we've booted into it,
# possibly over NFS eg)
second_stage_install
# create sources.list
# first, kill debootstrap.invalid sources.list
if [ -e "$TARGET/etc/apt/sources.list" ]; then
rm -f "$TARGET/etc/apt/sources.list"
fi
if [ "${MIRRORS#http*://}" != "$MIRRORS" ]; then
setup_apt_sources "${MIRRORS%% *}"
mv_invalid_to "${MIRRORS%% *}"
else
setup_apt_sources "$DEF_MIRROR"
mv_invalid_to "$DEF_MIRROR"
fi
if [ -e "$TARGET/debootstrap/debootstrap.log" ]; then
if [ "$KEEP_DEBOOTSTRAP_DIR" = true ]; then
cp "$TARGET/debootstrap/debootstrap.log" "$TARGET/var/log/bootstrap.log"
......
......@@ -475,28 +475,11 @@ apt_dest () {
;;
pkg)
local m="$5"
m="debootstrap.invalid"
#if [ "${m#http://}" != "$m" ]; then
# m="${m#http://}"
#elif [ "${m#file://}" != "$m" ]; then
# m="file_localhost_${m#file://*/}"
#elif [ "${m#file:/}" != "$m" ]; then
# m="file_localhost_${m#file:/}"
#fi
printf "%s" "$APTSTATE/lists/"
echo "${m}_$6" | sed 's/\//_/g'
;;
rel)
local m="$3"
m="debootstrap.invalid"
#if [ "${m#http://}" != "$m" ]; then
# m="${m#http://}"
#elif [ "${m#file://}" != "$m" ]; then
# m="file_localhost_${m#file://*/}"
#elif [ "${m#file:/}" != "$m" ]; then
# m="file_localhost_${m#file:/}"
#fi
printf "%s" "$APTSTATE/lists/"
echo "${m}_$4" | sed 's/\//_/g'
;;
......@@ -1070,16 +1053,6 @@ conditional_cp () {
fi
}
mv_invalid_to () {
local m="$1"
m="$(echo "${m#http://}" | tr '/' '_' | sed 's/_*//')"
(cd "$TARGET/$APTSTATE/lists" || exit 1
for a in debootstrap.invalid_*; do
mv "$a" "${m}_${a#*_}"
done
)
}
setup_apt_sources () {
mkdir -p "$TARGET/etc/apt"
for m in "$@"; do
......@@ -1098,10 +1071,6 @@ setup_etc () {
conditional_cp /etc/resolv.conf "$TARGET"
conditional_cp /etc/hostname "$TARGET"
if [ "$DLDEST" = apt_dest ] && [ ! -e "$TARGET/etc/apt/sources.list" ]; then
setup_apt_sources "http://debootstrap.invalid/"
fi
}
UMOUNT_DIRS=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment