From 49ce23470ef3e2401c152273a15d6d774fd687ff Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Thu, 24 May 2018 17:04:09 +0300 Subject: [PATCH] pkgpriorities: generalize for any stage2 install2 and live are both stage2 flavours, and I see no reason rescue (the last one) should be any different here. --- .../install2/lib/50-pkgpriorities.mk | 29 ------------------- .../{live => stage2}/lib/50-pkgpriorities.mk | 0 2 files changed, 29 deletions(-) delete mode 100644 features.in/pkgpriorities/install2/lib/50-pkgpriorities.mk rename features.in/pkgpriorities/{live => stage2}/lib/50-pkgpriorities.mk (100%) diff --git a/features.in/pkgpriorities/install2/lib/50-pkgpriorities.mk b/features.in/pkgpriorities/install2/lib/50-pkgpriorities.mk deleted file mode 100644 index 363a5451..00000000 --- a/features.in/pkgpriorities/install2/lib/50-pkgpriorities.mk +++ /dev/null @@ -1,29 +0,0 @@ -# NB: A copy of ../../live/lib/50-aptprefs.mk. -# TODO: Manage things to make duplicate files unnecessary. - -_IMAGE_APTBOX_ = $(WORKDIR)/chroot/$(WORKDIRNAME)/aptbox - -# Add prerequisite to the `build-image` target of -# $(MKIMAGE_PREFIX)/targets.mk. -build-image: $(_IMAGE_APTBOX_)/etc/apt/pkgpriorities - -_PINNED_PACKAGES_ = $(foreach pp,$(PINNED_PACKAGES),$(if $(findstring :,$(pp)),$(pp),$(pp):$(PIN_PRIORITY))) -_PIN_PRIORITIES_ = $(sort $(foreach pp,$(_PINNED_PACKAGES_),$(lastword $(subst :, ,$(pp))))) -_PKGPRIORITIES_ = $(subst \n ,\n,$(foreach pri,$(_PIN_PRIORITIES_),$(pri):$(patsubst %:$(pri),\n %,$(filter %:$(pri),$(_PINNED_PACKAGES_)))\n)) - -$(_IMAGE_APTBOX_)/etc/apt/pkgpriorities: prepare-image-workdir - @echo -e '$(_PKGPRIORITIES_)' | sed -e 's/[[:space:]]\+$$//' >$@ - @if [ -s $@ ]; then \ - if grep -q '^\(APT::\)\?Dir::Etc::pkgpriorities[[:space:]]' \ - $(_IMAGE_APTBOX_)/etc/apt/apt.conf; \ - then \ - sed -i -e 's/\(Dir::Etc::pkgpriorities\)[[:space:]].*$$/\1 "$@";/g' \ - $(_IMAGE_APTBOX_)/etc/apt/apt.conf; \ - else \ - echo 'Dir::Etc::pkgpriorities "$@";' \ - >>$(_IMAGE_APTBOX_)/etc/apt/apt.conf; \ - fi; \ - echo "--- Package priorities ---" >&2; \ - cat $@ >&2; \ - echo "---" >&2; \ - fi diff --git a/features.in/pkgpriorities/live/lib/50-pkgpriorities.mk b/features.in/pkgpriorities/stage2/lib/50-pkgpriorities.mk similarity index 100% rename from features.in/pkgpriorities/live/lib/50-pkgpriorities.mk rename to features.in/pkgpriorities/stage2/lib/50-pkgpriorities.mk