public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Bertrand Jaquin <bertrand@jacquin.bzh>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Bertrand Jacquin <bertrand@jacquin.bzh>
Subject: [gentoo-portage-dev] [PATCHv3 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
Date: Mon, 20 Apr 2015 21:46:00 +0200	[thread overview]
Message-ID: <1429559160-11646-2-git-send-email-bertrand@jacquin.bzh> (raw)
In-Reply-To: <1429559160-11646-1-git-send-email-bertrand@jacquin.bzh>

From: Bertrand Jacquin <bertrand@jacquin.bzh>

When glob are defined in INSTALL_MASK, no output is given on what file
has been deleted.

The following patch provide more information to user about what is
actually removed.

Example:

  # INSTALL_MASK='*.h' emerge -va1t x11-proto/xproto
  ..
  >>> Installing (1 of 2) x11-proto/xproto-7.0.27::gentoo
   * Removing /usr/include/X11/DECkeysym.h
   * Removing /usr/include/X11/HPkeysym.h
   * Removing /usr/include/X11/Sunkeysym.h
   * Removing /usr/include/X11/X.h
   * Removing /usr/include/X11/XF86keysym.h
   * Removing /usr/include/X11/XWDFile.h
   * Removing /usr/include/X11/Xalloca.h
   * Removing /usr/include/X11/Xarch.h
   * Removing /usr/include/X11/Xatom.h
   * Removing /usr/include/X11/Xdefs.h
   * Removing /usr/include/X11/Xfuncproto.h
   * Removing /usr/include/X11/Xfuncs.h
   * Removing /usr/include/X11/Xmd.h
   * Removing /usr/include/X11/Xos.h
   * Removing /usr/include/X11/Xos_r.h
   * Removing /usr/include/X11/Xosdefs.h
   * Removing /usr/include/X11/Xpoll.h
   * Removing /usr/include/X11/Xproto.h
   * Removing /usr/include/X11/Xprotostr.h
   * Removing /usr/include/X11/Xthreads.h
   * Removing /usr/include/X11/Xw32defs.h
   * Removing /usr/include/X11/Xwindows.h
   * Removing /usr/include/X11/Xwinsock.h
   * Removing /usr/include/X11/ap_keysym.h
   * Removing /usr/include/X11/keysym.h
   * Removing /usr/include/X11/keysymdef.h
   * checking 1 files for package collisions
  >>> Merging x11-proto/xproto-7.0.27 to /

Signed-off-by: Bertrand Jacquin <bertrand@jacquin.bzh>
---
 bin/misc-functions.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 36a3bb8..68c0c76 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -276,7 +276,13 @@ install_mask() {
 
 		# we also need to handle globs (*.a, *.h, etc)
 		find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
-			-exec rm -fR {} \; >/dev/null 2>&1
+			-print0 2> /dev/null \
+		| LC_ALL=C sort -z \
+		| while read -r -d ''; do
+			__quiet_mode || einfo "Removing /${REPLY#${root}}"
+			rm -Rf "${REPLY}" >&/dev/null
+		done
+
 	done
 	# set everything back the way we found it
 	set +o noglob


  reply	other threads:[~2015-04-20 19:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 19:45 [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK Bertrand Jaquin
2015-04-20 19:46 ` Bertrand Jaquin [this message]
2015-04-20 23:39 ` Zac Medico
2015-04-21  0:31   ` Bertrand Jacquin
2015-04-21  0:37     ` Zac Medico
2015-04-21  9:48       ` [gentoo-portage-dev] " Duncan
2015-04-21 11:21         ` Michael Orlitzky
2015-04-21 17:28           ` Zac Medico
2015-04-21 19:08             ` Michael Orlitzky
2015-04-21 19:20               ` Zac Medico
2015-04-21 17:27         ` Zac Medico
2015-04-21 17:30           ` Zac Medico
2015-04-22 23:44       ` [gentoo-portage-dev] " Bertrand Jacquin
2015-04-23  1:43         ` Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429559160-11646-2-git-send-email-bertrand@jacquin.bzh \
    --to=bertrand@jacquin.bzh \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox