Problem with run script on linux
I checked out the calendar server to try to get it running on Slackware version 11.0. When I went to install it, the setup section of the run script failed on trying to remove all the .pyc files for the programs it was downloading. The way it's written, it will work when there are actually files to remove, but the whole script will fail out if the files are already missing. The following patch makes this work correctly on Linux. I would think it would still work as it should on OSX, but I don't have an OSX machine to test with. Other than this, the program works great on Linux, as long as extended attributes are installed in the kernel. -Andy Brook --- run.orig 2007-02-07 13:50:35.000000000 -0500 +++ run 2007-02-07 13:50:18.000000000 -0500 @@ -216,7 +216,7 @@ echo "Removing build directory ${path}/build..." rm -rf "${path}/build"; echo "Removing pyc files from ${path}..." - find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm -f; } www_get () {
Andy Brook wrote:
I checked out the calendar server to try to get it running on Slackware version 11.0. When I went to install it, the setup section of the run script failed on trying to remove all the .pyc files for the programs it was downloading. The way it's written, it will work when there are actually files to remove, but the whole script will fail out if the files are already missing.
The following patch makes this work correctly on Linux. I would think it would still work as it should on OSX, but I don't have an OSX machine to test with.
Other than this, the program works great on Linux, as long as extended attributes are installed in the kernel.
-Andy Brook
--- run.orig 2007-02-07 13:50:35.000000000 -0500 +++ run 2007-02-07 13:50:18.000000000 -0500 @@ -216,7 +216,7 @@ echo "Removing build directory ${path}/build..." rm -rf "${path}/build"; echo "Removing pyc files from ${path}..." - find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm -f; }
I observed the same issue and prefered this solution... - find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -r -0 rm; :-)
What's -r? It's not on OS X, so I don't think it's a portable option... Is xargs on Linux calling rm with an empty argument list? -wsv On Feb 8, 2007, at 2:10 AM, Frank Strauß wrote:
Andy Brook wrote:
I checked out the calendar server to try to get it running on Slackware version 11.0. When I went to install it, the setup section of the run script failed on trying to remove all the .pyc files for the programs it was downloading. The way it's written, it will work when there are actually files to remove, but the whole script will fail out if the files are already missing. The following patch makes this work correctly on Linux. I would think it would still work as it should on OSX, but I don't have an OSX machine to test with. Other than this, the program works great on Linux, as long as extended attributes are installed in the kernel. -Andy Brook --- run.orig 2007-02-07 13:50:35.000000000 -0500 +++ run 2007-02-07 13:50:18.000000000 -0500 @@ -216,7 +216,7 @@ echo "Removing build directory ${path}/build..." rm -rf "${path}/build"; echo "Removing pyc files from ${path}..." - find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm -f; }
I observed the same issue and prefered this solution...
- find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -r -0 rm;
:-) _______________________________________________ calendarserver-dev mailing list calendarserver-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/calendarserver-dev
On Tue, 2007-02-13 at 16:37 -0800, Wilfredo Sánchez Vega wrote:
What's -r? It's not on OS X, so I don't think it's a portable option...
Is xargs on Linux calling rm with an empty argument list?
*snip* --no-run-if-empty, -r If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. This option is a GNU extension. -- Stuart Jansen <sjansen@gurulabs.com> Guru Labs, L.C.
Wilfredo Sánchez Vega wrote:
What's -r? It's not on OS X, so I don't think it's a portable option...
Oh, I'm sorry. I did not check portability.
Is xargs on Linux calling rm with an empty argument list?
Yes, as long as -r is not used. I'm using a Debian/sarge Linux system with GNU xargs version 4.1.20. strauss@aligator$ echo a b c | xargs echo a b c strauss@aligator$ echo a b c | xargs -r echo a b c strauss@aligator$ echo "" | xargs echo strauss@aligator$ echo "" | xargs -r echo strauss@aligator$
Committed in r1194. -wsv On Feb 7, 2007, at 10:54 AM, Andy Brook wrote:
I checked out the calendar server to try to get it running on Slackware version 11.0. When I went to install it, the setup section of the run script failed on trying to remove all the .pyc files for the programs it was downloading. The way it's written, it will work when there are actually files to remove, but the whole script will fail out if the files are already missing.
The following patch makes this work correctly on Linux. I would think it would still work as it should on OSX, but I don't have an OSX machine to test with.
Other than this, the program works great on Linux, as long as extended attributes are installed in the kernel.
-Andy Brook
--- run.orig 2007-02-07 13:50:35.000000000 -0500 +++ run 2007-02-07 13:50:18.000000000 -0500 @@ -216,7 +216,7 @@ echo "Removing build directory ${path}/build..." rm -rf "${path}/build"; echo "Removing pyc files from ${path}..." - find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm; + find "${path}" -type f -name '*.pyc' -print0 | xargs -0 rm -f; }
www_get () { _______________________________________________ calendarserver-dev mailing list calendarserver-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/calendarserver-dev
participants (4)
-
Andy Brook
-
Frank Strauß
-
Stuart Jansen
-
Wilfredo Sánchez Vega