From a69c40d403c0c25915ee3de18b8613d46446a6d6 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 16 Nov 2022 17:49:13 -0800 Subject: [PATCH 1/3] Set up preferences for -proposed with NotAutomatic: yes As of lunar, Ubuntu sets NotAutomatic: yes for its -proposed pockets. For sbuild chroots, we want to continue to explicitly install from -proposed by default; so override with apt preferences to get the correct behavior. --- mk-sbuild | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mk-sbuild b/mk-sbuild index e280fbb..40f673f 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -858,6 +858,13 @@ EOM fi fi if [ -z "$SKIP_PROPOSED" ]; then + TEMP_PREFERENCES=`mktemp -t preferences-XXXXXX` + cat >> "$TEMP_PREFERENCES" <> "$TEMP_SOURCES" < $MNT/etc/apt/sources.list" rm -f "$TEMP_SOURCES" +if [ -n "$TEMP_PREFERENCES" ]; then + sed -e "s|RELEASE|$RELEASE|g" < "$TEMP_PREFERENCES" | \ + sudo bash -c "cat > $MNT/etc/apt/preferences" + rm -f "$TEMP_PREFERENCES" +fi # Copy the timezone (comment this out if you want to leave the chroot at UTC) sudo cp -P --remove-destination /etc/localtime /etc/timezone "$MNT"/etc/ From 8430d445d89a4316f7ddb59ab1960dd238f4c0a0 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 12 Apr 2023 09:28:38 -0700 Subject: [PATCH 2/3] Align with the Launchpad buildd implementation, per review comments --- mk-sbuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mk-sbuild b/mk-sbuild index 40f673f..aab252b 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -862,8 +862,8 @@ EOM cat >> "$TEMP_PREFERENCES" <> "$TEMP_SOURCES" < $MNT/etc/apt/preferences" + sudo bash -c "cat > $MNT/etc/apt/preferences.d/proposed.pref" rm -f "$TEMP_PREFERENCES" fi From 53fcd577e83b14685d80cc473bc008f8ccd0592d Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 12 Apr 2023 09:41:52 -0700 Subject: [PATCH 3/3] We no longer need to run sed --- mk-sbuild | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mk-sbuild b/mk-sbuild index aab252b..accd8d7 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -891,9 +891,7 @@ cat "$TEMP_SOURCES" | sed -e "s|RELEASE|$RELEASE|g" | \ sudo bash -c "cat > $MNT/etc/apt/sources.list" rm -f "$TEMP_SOURCES" if [ -n "$TEMP_PREFERENCES" ]; then - sed -e "s|RELEASE|$RELEASE|g" < "$TEMP_PREFERENCES" | \ - sudo bash -c "cat > $MNT/etc/apt/preferences.d/proposed.pref" - rm -f "$TEMP_PREFERENCES" + sudo mv "TEMP_PREFERENCES" $MNT/etc/apt/preferences.d/proposed.pref fi # Copy the timezone (comment this out if you want to leave the chroot at UTC)