From 018ea50518c2081de4b4dc1fa41572c794ef7d94 Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Mon, 21 Sep 2020 21:45:21 +0700 Subject: [PATCH] cleanup, live: Added target use/live/no-cleanup (docs, rpmdb) It is customary to set a variable without the GLOBAL_ prefix. It is added to the name when exporting. I made by analogy use/cleanup/live-no-cleanup-docs. Since both targets have long names and are needed together, i made use/live/no-cleanup. Use target use/live/no-cleanup should be used instead of: @$(call set, GLOBAL_LIVE_NO_CLEANUPDB, yes) --- features.in/cleanup/config.mk | 9 ++++++++- features.in/cleanup/live/image-scripts.d/90-cleanup-docs | 4 +++- features.in/live/config.mk | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/features.in/cleanup/config.mk b/features.in/cleanup/config.mk index 35e98732..d944a94f 100644 --- a/features.in/cleanup/config.mk +++ b/features.in/cleanup/config.mk @@ -1,9 +1,16 @@ use/cleanup: @$(call add_feature) - @$(call xport,GLOBAL_LIVE_NO_CLEANUPDB) + @$(call xport,LIVE_NO_CLEANUPDB) + @$(call xport,LIVE_NO_CLEANUP_DOCS) @$(call xport,CLEANUP_PACKAGES) @$(call xport,CLEANUP_BASE_PACKAGES) +use/cleanup/live-no-cleanupdb: + @$(call set,LIVE_NO_CLEANUPDB,yes) + +use/cleanup/live-no-cleanup-docs: + @$(call set,LIVE_NO_CLEANUP_DOCS,yes) + use/cleanup/libs: @$(call add,BASE_PACKAGES,apt-scripts) @$(call add,INSTALL2_PACKAGES,installer-feature-cleanup-libs-stage3) diff --git a/features.in/cleanup/live/image-scripts.d/90-cleanup-docs b/features.in/cleanup/live/image-scripts.d/90-cleanup-docs index d02190c9..4b712089 100755 --- a/features.in/cleanup/live/image-scripts.d/90-cleanup-docs +++ b/features.in/cleanup/live/image-scripts.d/90-cleanup-docs @@ -2,7 +2,9 @@ # remove all docs # don't cripple the image to be copied over -[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install ] && exit 0 +[ -n "$GLOBAL_LIVE_NO_CLEANUP_DOCS" ] || \ + [ -x /usr/sbin/live-install ] || \ + [ -x /usr/sbin/livecd-install ] && exit 0 rpmquery -ad |grep ^/ |xargs -r rm -f -- rm -rf /usr/share/{doc,man,info,license,gfxboot} diff --git a/features.in/live/config.mk b/features.in/live/config.mk index 54d8cc1b..e7c4d216 100644 --- a/features.in/live/config.mk +++ b/features.in/live/config.mk @@ -24,6 +24,10 @@ use/live: use/stage2 sub/rootfs@live sub/stage2@live \ use/live/.base: use/live use/syslinux/ui/menu @$(call add,LIVE_LISTS,$(call tags,base live)) +use/live/no-cleanup: \ + use/cleanup/live-no-cleanupdb \ + use/cleanup/live-no-cleanup-docs; @: + use/live/base: use/live/.base use/net use/deflogin/live @$(call add,LIVE_LISTS,$(call tags,base network))