Re: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-22 Thread Zac Medico
On 04/22/2015 04:44 PM, Bertrand Jacquin wrote:
> On 21/04/2015 01:37, Zac Medico wrote:
>> On 04/20/2015 05:31 PM, Bertrand Jacquin wrote:
>>> On 21/04/2015 00:39, Zac Medico wrote:
 These are in the master branch now:

 https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911


 https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670e3f043608fced9847e54bdbb19f35169


>>>
>>> Thanks for that :)
>>>
 I modified the test as follows in order to ensure that it still works
 with shell globs:

 if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo
 "${root}"/${no_inst}) ]] ; then
>>>
>>> I do not really understand the use case here, do you have an example ?
>>>
>>> Cheers,
>>>
>>
>> Well, I don't use INSTALL_MASK myself, so I don't have a real-world
>> use-case for you. However, it's clear that the code will expand shell
>> globs, so I preserved that behavior for compatibility.
> 
> Sorry Zac, I was speaking about the $(echo ..), what does it bring to
> use it here ?
> 
> Cheers,
> 

It's a way to check the result of check the result of shell glob
expansion. The rm call that follows will be subject to identical expansion.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-22 Thread Bertrand Jacquin

On 21/04/2015 01:37, Zac Medico wrote:

On 04/20/2015 05:31 PM, Bertrand Jacquin wrote:

On 21/04/2015 00:39, Zac Medico wrote:

These are in the master branch now:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670e3f043608fced9847e54bdbb19f35169



Thanks for that :)


I modified the test as follows in order to ensure that it still works
with shell globs:

if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo
"${root}"/${no_inst}) ]] ; then


I do not really understand the use case here, do you have an example ?

Cheers,



Well, I don't use INSTALL_MASK myself, so I don't have a real-world
use-case for you. However, it's clear that the code will expand shell
globs, so I preserved that behavior for compatibility.


Sorry Zac, I was speaking about the $(echo ..), what does it bring to 
use it here ?


Cheers,

--
Bertrand



Re: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-20 Thread Zac Medico
On 04/20/2015 05:31 PM, Bertrand Jacquin wrote:
> On 21/04/2015 00:39, Zac Medico wrote:
>> These are in the master branch now:
>>
>> https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911
>>
>> https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670e3f043608fced9847e54bdbb19f35169
>>
> 
> Thanks for that :)
> 
>> I modified the test as follows in order to ensure that it still works
>> with shell globs:
>>
>> if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo
>> "${root}"/${no_inst}) ]] ; then
> 
> I do not really understand the use case here, do you have an example ?
> 
> Cheers,
> 

Well, I don't use INSTALL_MASK myself, so I don't have a real-world
use-case for you. However, it's clear that the code will expand shell
globs, so I preserved that behavior for compatibility.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-20 Thread Bertrand Jacquin

On 21/04/2015 00:39, Zac Medico wrote:

These are in the master branch now:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911
https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670e3f043608fced9847e54bdbb19f35169


Thanks for that :)


I modified the test as follows in order to ensure that it still works
with shell globs:

if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo
"${root}"/${no_inst}) ]] ; then


I do not really understand the use case here, do you have an example ?

Cheers,

--
Bertrand



Re: [gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-20 Thread Zac Medico
These are in the master branch now:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e74e2670e3f043608fced9847e54bdbb19f35169


On 04/20/2015 12:45 PM, Bertrand Jaquin wrote:
> 
>   # 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

I modified the test as follows in order to ensure that it still works
with shell globs:

if [[ -e "${root}"/${no_inst} || "${root}"/${no_inst} != $(echo
"${root}"/${no_inst}) ]] ; then

-- 
Thanks,
Zac



[gentoo-portage-dev] [PATCHv3 1/2] MEDIUM: misc-functions: Be more quiet when removing non existing INSTALL_MASK

2015-04-20 Thread Bertrand Jaquin
From: Bertrand Jacquin 

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 
---
 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}" \) \