* [gentoo-portage-dev] [PATCHv2 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK
@ 2015-04-20 0:01 Bertrand Jaquin
2015-04-20 0:01 ` [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob Bertrand Jaquin
0 siblings, 1 reply; 4+ messages in thread
From: Bertrand Jaquin @ 2015-04-20 0:01 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Bertrand Jacquin
From: Bertrand Jacquin <bertrand@jacquin.bzh>
When FEATURES="nodoc noinfo noman" is used, you will get the following
output for every packages, even virtual that contain no file:
# FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
..
>>> Installing (1 of 1) virtual/cron-0::gentoo
* Removing /usr/share/man
* Removing /usr/share/info
* Removing /usr/share/doc
* checking 0 files for package collisions
>>> Merging virtual/cron-0 to /
The following patch makes the output as:
# FEATURES="nodoc noinfo noman" emerge -va1t virtual/cron
..
>>> Installing (1 of 1) virtual/cron-0::gentoo
* checking 0 files for package collisions
>>> Merging virtual/cron-0 to /
Signed-off-by: Bertrand Jacquin <bertrand@jacquin.bzh>
---
bin/misc-functions.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index e08c228..36a3bb8 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -267,9 +267,12 @@ install_mask() {
local no_inst
for no_inst in ${install_mask}; do
set +o noglob
- __quiet_mode || einfo "Removing ${no_inst}"
+
# normal stuff
- rm -Rf "${root}"/${no_inst} >&/dev/null
+ if [[ -e "${root}"/${no_inst} ]] ; then
+ __quiet_mode || einfo "Removing ${no_inst}"
+ rm -Rf "${root}"/${no_inst} >&/dev/null
+ fi
# we also need to handle globs (*.a, *.h, etc)
find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
2015-04-20 0:01 [gentoo-portage-dev] [PATCHv2 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK Bertrand Jaquin
@ 2015-04-20 0:01 ` Bertrand Jaquin
2015-04-20 3:26 ` Zac Medico
0 siblings, 1 reply; 4+ messages in thread
From: Bertrand Jaquin @ 2015-04-20 0:01 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Bertrand Jacquin
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/Xproto.h
* Removing /usr/include/X11/keysym.h
* Removing /usr/include/X11/HPkeysym.h
* Removing /usr/include/X11/Xthreads.h
* Removing /usr/include/X11/Xalloca.h
* Removing /usr/include/X11/Xwinsock.h
* Removing /usr/include/X11/DECkeysym.h
* Removing /usr/include/X11/XWDFile.h
* Removing /usr/include/X11/Xos_r.h
* Removing /usr/include/X11/XF86keysym.h
* Removing /usr/include/X11/Xarch.h
* Removing /usr/include/X11/Xfuncs.h
* Removing /usr/include/X11/keysymdef.h
* Removing /usr/include/X11/Xwindows.h
* Removing /usr/include/X11/Xw32defs.h
* Removing /usr/include/X11/Xdefs.h
* Removing /usr/include/X11/Xprotostr.h
* Removing /usr/include/X11/Xatom.h
* Removing /usr/include/X11/Xpoll.h
* Removing /usr/include/X11/Xos.h
* Removing /usr/include/X11/ap_keysym.h
* Removing /usr/include/X11/Xosdefs.h
* Removing /usr/include/X11/Xmd.h
* Removing /usr/include/X11/Sunkeysym.h
* Removing /usr/include/X11/Xfuncproto.h
* Removing /usr/include/X11/X.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..4c37f10 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 \
+ | sort \
+ | 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
2015-04-20 0:01 ` [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob Bertrand Jaquin
@ 2015-04-20 3:26 ` Zac Medico
2015-04-20 4:41 ` Brian Dolbec
0 siblings, 1 reply; 4+ messages in thread
From: Zac Medico @ 2015-04-20 3:26 UTC (permalink / raw
To: gentoo-portage-dev
On 04/19/2015 05:01 PM, Bertrand Jaquin wrote:
> diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
> index 36a3bb8..4c37f10 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 \
> + | sort \
sort -z
Maybe also set LANG=C for locale independence?
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob
2015-04-20 3:26 ` Zac Medico
@ 2015-04-20 4:41 ` Brian Dolbec
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-04-20 4:41 UTC (permalink / raw
To: gentoo-portage-dev
On Sun, 19 Apr 2015 20:26:35 -0700
Zac Medico <zmedico@gentoo.org> wrote:
> On 04/19/2015 05:01 PM, Bertrand Jaquin wrote:
> > diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
> > index 36a3bb8..4c37f10 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 \
> > + | sort \
>
> sort -z
>
> Maybe also set LANG=C for locale independence?
>
Looks good, Zac can you just edit those changes in while you merge it
please.
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-20 4:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 0:01 [gentoo-portage-dev] [PATCHv2 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK Bertrand Jaquin
2015-04-20 0:01 ` [gentoo-portage-dev] [PATCHv2 2/2] MEDIUM: misc-functions: Be more verbose when removing INSTALL_MASK glob Bertrand Jaquin
2015-04-20 3:26 ` Zac Medico
2015-04-20 4:41 ` Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox