Re: [Libreoffice] [PATCH] Reducing chmod spawning by replacing exec by xargs

2011-01-12 Thread Julien Nabet

Le 12/01/2011 13:34, Christian Lohmaier a écrit :

Hi *,

On Sat, Jan 8, 2011 at 2:06 AM, Julien Nabetserval2...@yahoo.fr  wrote:
   

I used xargs instead of -exec to reduce chmod spawning.
Hope there's no mistake in it.
 

I don't see the point in using -i - since that in turn causes one
process per file, so you don't really gain anything, do you?

Furthermore -i is not supported on mac, and in my linux-xargs manpage
-i is flagged as being deprecated.
(-I would work on both), but again: Using -i / -I and thus the implied
-L 1 nullifies the benefit, doesn't it?

find $packagename -type d -print0 | xargs -0 chmod 775

should do the trick

ciao
Christian

   

Hello,

I didn't know that. I had learnt (some years ago) that xargs was better 
than -exec and I've been showed this command with -i.

Moreover, I didn't know too that the -i option brings 1 process per file.
So thank you a lot, I've learnt something and from now, I try to make no 
more this mistake !


Julien.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Reducing chmod spawning by replacing exec by xargs

2011-01-08 Thread Julien Nabet

Hello,

I used xargs instead of -exec to reduce chmod spawning.
Hope there's no mistake in it.

Julien.

commit d5a814812d592d36db85575bb80ab73817cd3e78
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jan 8 02:01:25 2011 +0100

Reducing spawning of chmod with xargs instead of exec

diff --git a/solenv/bin/modules/installer/epmfile.pm 
b/solenv/bin/modules/installer/epmfile.pm
index 9e9ef1e..84efc6e 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -2408,7 +2408,7 @@ sub create_packages_without_epm
 # Setting unix rights to 775 for all created directories 
inside the package,
 # that is saved in temp directory  
 
-$systemcall = cd $packagestempdir; find $packagename -type d 
-exec chmod 775 \{\} \\\;;
+$systemcall = cd $packagestempdir; find $packagename -type d 
| xargs -i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);
@@ -2471,7 +2471,7 @@ sub create_packages_without_epm
 
 # Setting unix rights to 775 for all created directories inside the 
package
 
-$systemcall = cd $destinationdir; find $packagename -type d -exec 
chmod 775 \{\} \\\;;
+$systemcall = cd $destinationdir; find $packagename -type d | xargs 
-i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Reducing chmod spawning by replacing exec by xargs

2011-01-08 Thread Julien Nabet

Hello,

I used xargs instead of -exec to reduce chmod spawning.
Hope there's no mistake in it.

Julien

PS : the first sending seemed not having worked.
commit d5a814812d592d36db85575bb80ab73817cd3e78
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jan 8 02:01:25 2011 +0100

Reducing spawning of chmod with xargs instead of exec

diff --git a/solenv/bin/modules/installer/epmfile.pm 
b/solenv/bin/modules/installer/epmfile.pm
index 9e9ef1e..84efc6e 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -2408,7 +2408,7 @@ sub create_packages_without_epm
 # Setting unix rights to 775 for all created directories 
inside the package,
 # that is saved in temp directory  
 
-$systemcall = cd $packagestempdir; find $packagename -type d 
-exec chmod 775 \{\} \\\;;
+$systemcall = cd $packagestempdir; find $packagename -type d 
| xargs -i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);
@@ -2471,7 +2471,7 @@ sub create_packages_without_epm
 
 # Setting unix rights to 775 for all created directories inside the 
package
 
-$systemcall = cd $destinationdir; find $packagename -type d -exec 
chmod 775 \{\} \\\;;
+$systemcall = cd $destinationdir; find $packagename -type d | xargs 
-i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Reducing chmod spawning by replacing exec by xargs

2011-01-08 Thread Julien Nabet

Hello,

I used xargs instead of -exec to reduce chmod spawning.
Hope there's no mistake in it.

Julien

PS : the 2 sendings with my yahoo.fr address seemed not having worked.
commit d5a814812d592d36db85575bb80ab73817cd3e78
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jan 8 02:01:25 2011 +0100

Reducing spawning of chmod with xargs instead of exec

diff --git a/solenv/bin/modules/installer/epmfile.pm 
b/solenv/bin/modules/installer/epmfile.pm
index 9e9ef1e..84efc6e 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -2408,7 +2408,7 @@ sub create_packages_without_epm
 # Setting unix rights to 775 for all created directories 
inside the package,
 # that is saved in temp directory  
 
-$systemcall = cd $packagestempdir; find $packagename -type d 
-exec chmod 775 \{\} \\\;;
+$systemcall = cd $packagestempdir; find $packagename -type d 
| xargs -i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);
@@ -2471,7 +2471,7 @@ sub create_packages_without_epm
 
 # Setting unix rights to 775 for all created directories inside the 
package
 
-$systemcall = cd $destinationdir; find $packagename -type d -exec 
chmod 775 \{\} \\\;;
+$systemcall = cd $destinationdir; find $packagename -type d | xargs 
-i chmod 775 \{\} \;;
 installer::logger::print_message( ... $systemcall ...\n );
 
 $returnvalue = system($systemcall);
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice