[Geoserver-devel] Build failures in 1.7.x nightlies

Hi,
the build on the server is failing during the part
that removes the old extension directories:

+ rm -rf /var/www/html/geoserver/1.7.x/ext-latest
+ mkdir /var/www/html/geoserver/1.7.x/ext-latest
+ cp target/release/geoserver-1.7.7-SNAPSHOT-arcsde-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-charts-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-db2ng-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-db2-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-excel-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-feature-pregeneralized-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-gdal-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-geosearch-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-gml-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-h2-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-imagemap-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-imagemosaic-jdbc-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-mysql-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-ogr-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-oracleng-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-oracle-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-pyramid-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-restconfig-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-sqlserver-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-vpf-plugin.zip target/release/geoserver-1.7.7-SNAPSHOT-wfsv-plugin.zip /var/www/html/geoserver/1.7.x/ext-latest
+ find /var/www/html/geoserver/1.7.x -name 'geoserver*bin.zip' -mtime +6 -exec rm '{}' ';'
+ find /var/www/html/geoserver/1.7.x -name 'geoserver*war.zip' -mtime +6 -exec rm '{}' ';'
+ find /var/www/html/geoserver/1.7.x -name 'ext-*' -type d -mtime +6 -exec rm -rf '{}' ';'
find: /var/www/html/geoserver/1.7.x/ext-2009-08-11: No such file or directory
find: /var/www/html/geoserver/1.7.x/ext-2009-08-12: No such file or directory

However I don't understand what is going on there... how can it be
that the directory is found (the names comes from somewhere no?)
and then it's missing (and btw, it's find itself complaining,
rm -rf would not).

Any idea?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Andrea Aime wrote:

+ find /var/www/html/geoserver/1.7.x -name 'geoserver*bin.zip' -mtime +6 -exec rm '{}' ';'
+ find /var/www/html/geoserver/1.7.x -name 'geoserver*war.zip' -mtime +6 -exec rm '{}' ';'
+ find /var/www/html/geoserver/1.7.x -name 'ext-*' -type d -mtime +6 -exec rm -rf '{}' ';'
find: /var/www/html/geoserver/1.7.x/ext-2009-08-11: No such file or directory
find: /var/www/html/geoserver/1.7.x/ext-2009-08-12: No such file or directory
However I don't understand what is going on there... how can it be
that the directory is found (the names comes from somewhere no?)
and then it's missing (and btw, it's find itself complaining,
rm -rf would not).

I have seen exactly this behaviour running find locally. It has always bugged me, even though it works. Now I have the solution: use the find -depth flag.

What is going on is that:
(1) find locates a matching directory
(2) runs your arbitrary command on it
(3) descends into the matching directory looking for more matching directories.

Unfortunately, because (2) removes the directory, (3) fails. The find continues, but returns a failure error code. The solution is to add -depth as the first non-path argument to find to cause it to process the contents of each directory before the directory itself (i.e. depth first).

For example:

$ mkdir -p a/b
$ find . -name a -exec rm -rf {} \;
find: `./a': No such file or directory
$ echo $?
1

(Return code 1 is a failure.)

$ mkdir -p a/b
$ find . -depth -name a -exec rm -rf {} \;
$ echo $?
0

(Return code 0 is a success.)

Success!

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

Ben Caradoc-Davies ha scritto:

I have seen exactly this behaviour running find locally. It has always bugged me, even though it works. Now I have the solution: use the find -depth flag.

What is going on is that:
(1) find locates a matching directory
(2) runs your arbitrary command on it
(3) descends into the matching directory looking for more matching directories.

Unfortunately, because (2) removes the directory, (3) fails. The find continues, but returns a failure error code. The solution is to add -depth as the first non-path argument to find to cause it to process the contents of each directory before the directory itself (i.e. depth first).

Aaah!

For example:

$ mkdir -p a/b
$ find . -name a -exec rm -rf {} \;
find: `./a': No such file or directory
$ echo $?
1

(Return code 1 is a failure.)

$ mkdir -p a/b
$ find . -depth -name a -exec rm -rf {} \;
$ echo $?
0

(Return code 0 is a success.)

Success!

Brilliant, Hudson is working fine now!
Thanks a lot

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.