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] [PATCH 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
Date: Sun, 19 Apr 2015 22:36:11
Message-Id: 1429482945-24032-2-git-send-email-bertrand@jacquin.bzh
In Reply to: [gentoo-portage-dev] [PATCH 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK by Bertrand Jaquin
1 From: Bertrand Jacquin <bertrand@×××××××.bzh>
2
3 When glob are defined in INSTALL_MASK, no output is given on what file
4 has been deleted.
5
6 The following patch provide more information to user about what is
7 actually removed.
8
9 Example:
10
11 # INSTALL_MASK='*.h' emerge -va1t x11-proto/xproto
12 ..
13 >>> Installing (1 of 2) x11-proto/xproto-7.0.27::gentoo
14 * Removing /usr/include/X11/Xproto.h
15 * Removing /usr/include/X11/keysym.h
16 * Removing /usr/include/X11/HPkeysym.h
17 * Removing /usr/include/X11/Xthreads.h
18 * Removing /usr/include/X11/Xalloca.h
19 * Removing /usr/include/X11/Xwinsock.h
20 * Removing /usr/include/X11/DECkeysym.h
21 * Removing /usr/include/X11/XWDFile.h
22 * Removing /usr/include/X11/Xos_r.h
23 * Removing /usr/include/X11/XF86keysym.h
24 * Removing /usr/include/X11/Xarch.h
25 * Removing /usr/include/X11/Xfuncs.h
26 * Removing /usr/include/X11/keysymdef.h
27 * Removing /usr/include/X11/Xwindows.h
28 * Removing /usr/include/X11/Xw32defs.h
29 * Removing /usr/include/X11/Xdefs.h
30 * Removing /usr/include/X11/Xprotostr.h
31 * Removing /usr/include/X11/Xatom.h
32 * Removing /usr/include/X11/Xpoll.h
33 * Removing /usr/include/X11/Xos.h
34 * Removing /usr/include/X11/ap_keysym.h
35 * Removing /usr/include/X11/Xosdefs.h
36 * Removing /usr/include/X11/Xmd.h
37 * Removing /usr/include/X11/Sunkeysym.h
38 * Removing /usr/include/X11/Xfuncproto.h
39 * Removing /usr/include/X11/X.h
40 * checking 1 files for package collisions
41 >>> Merging x11-proto/xproto-7.0.27 to /
42
43 Signed-off-by: Bertrand Jacquin <bertrand@×××××××.bzh>
44 ---
45 bin/misc-functions.sh | 8 ++++++--
46 1 file changed, 6 insertions(+), 2 deletions(-)
47
48 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
49 index 36a3bb8..a7c431c 100755
50 --- a/bin/misc-functions.sh
51 +++ b/bin/misc-functions.sh
52 @@ -275,8 +275,12 @@ install_mask() {
53 fi
54
55 # we also need to handle globs (*.a, *.h, etc)
56 - find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
57 - -exec rm -fR {} \; >/dev/null 2>&1
58 + find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) 2> /dev/null \
59 + | while read; do
60 + __quiet_mode || einfo "Removing /${REPLY#${root}}"
61 + rm -Rf "${REPLY}" >&/dev/null
62 + done
63 +
64 done
65 # set everything back the way we found it
66 set +o noglob

Replies