Gentoo Archives: gentoo-portage-dev

From: Bertrand Jaquin <bertrand@×××××××.bzh>
To: gentoo-portage-dev@l.g.o
Cc: Bertrand Jacquin <bertrand@×××××××.bzh>
Subject: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK
Date: Mon, 20 Apr 2015 19:46:06
Message-Id: 1429559160-11646-1-git-send-email-bertrand@jacquin.bzh
1 From: Bertrand Jacquin <bertrand@×××××××.bzh>
2
3 When FEATURES="nodoc noinfo noman" is used, you will get the following
4 output for every packages, even virtual that contain no file:
5
6 # FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
7 ..
8 >>> Installing (1 of 1) virtual/cron-0::gentoo
9 * Removing /usr/share/man
10 * Removing /usr/share/info
11 * Removing /usr/share/doc
12 * checking 0 files for package collisions
13 >>> Merging virtual/cron-0 to /
14
15 The following patch makes the output as:
16
17 # FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
18 ..
19 >>> Installing (1 of 1) virtual/cron-0::gentoo
20 * checking 0 files for package collisions
21 >>> Merging virtual/cron-0 to /
22
23 Signed-off-by: Bertrand Jacquin <bertrand@×××××××.bzh>
24 ---
25 bin/misc-functions.sh | 7 +++++--
26 1 file changed, 5 insertions(+), 2 deletions(-)
27
28 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
29 index e08c228..36a3bb8 100755
30 --- a/bin/misc-functions.sh
31 +++ b/bin/misc-functions.sh
32 @@ -267,9 +267,12 @@ install_mask() {
33 local no_inst
34 for no_inst in ${install_mask}; do
35 set +o noglob
36 - __quiet_mode || einfo "Removing ${no_inst}"
37 +
38 # normal stuff
39 - rm -Rf "${root}"/${no_inst} >&/dev/null
40 + if [[ -e "${root}"/${no_inst} ]] ; then
41 + __quiet_mode || einfo "Removing ${no_inst}"
42 + rm -Rf "${root}"/${no_inst} >&/dev/null
43 + fi
44
45 # we also need to handle globs (*.a, *.h, etc)
46 find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \

Replies