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 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
Date: Mon, 20 Apr 2015 19:46:13
Message-Id: 1429559160-11646-2-git-send-email-bertrand@jacquin.bzh
In Reply to: [gentoo-portage-dev] [PATCHv3 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/DECkeysym.h
15 * Removing /usr/include/X11/HPkeysym.h
16 * Removing /usr/include/X11/Sunkeysym.h
17 * Removing /usr/include/X11/X.h
18 * Removing /usr/include/X11/XF86keysym.h
19 * Removing /usr/include/X11/XWDFile.h
20 * Removing /usr/include/X11/Xalloca.h
21 * Removing /usr/include/X11/Xarch.h
22 * Removing /usr/include/X11/Xatom.h
23 * Removing /usr/include/X11/Xdefs.h
24 * Removing /usr/include/X11/Xfuncproto.h
25 * Removing /usr/include/X11/Xfuncs.h
26 * Removing /usr/include/X11/Xmd.h
27 * Removing /usr/include/X11/Xos.h
28 * Removing /usr/include/X11/Xos_r.h
29 * Removing /usr/include/X11/Xosdefs.h
30 * Removing /usr/include/X11/Xpoll.h
31 * Removing /usr/include/X11/Xproto.h
32 * Removing /usr/include/X11/Xprotostr.h
33 * Removing /usr/include/X11/Xthreads.h
34 * Removing /usr/include/X11/Xw32defs.h
35 * Removing /usr/include/X11/Xwindows.h
36 * Removing /usr/include/X11/Xwinsock.h
37 * Removing /usr/include/X11/ap_keysym.h
38 * Removing /usr/include/X11/keysym.h
39 * Removing /usr/include/X11/keysymdef.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, 7 insertions(+), 1 deletion(-)
47
48 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
49 index 36a3bb8..68c0c76 100755
50 --- a/bin/misc-functions.sh
51 +++ b/bin/misc-functions.sh
52 @@ -276,7 +276,13 @@ install_mask() {
53
54 # we also need to handle globs (*.a, *.h, etc)
55 find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
56 - -exec rm -fR {} \; >/dev/null 2>&1
57 + -print0 2> /dev/null \
58 + | LC_ALL=C sort -z \
59 + | while read -r -d ''; 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