Tue 25 Jan 2005 03:25:27 PM UTC, original submission:
[this is a re-submission - it was already fixed in 1.2.2 but apparently didn't make it into 1.3]
Hi,
"tla grab" fails without an error message if "Archive-Name" has not yet
been registered. I suppose the expected behaviour would be that it does
register the archive.
I've verified the bug with the official tla-1.2 and tla-1.2.1 [and 1.3] releases.
Test case:
address@bogus.example.com:/tmp> mkdir test
address@bogus.example.com:/tmp> cd test
address@bogus.example.com:/tmp/test> HOME=`pwd` tla grab
http://www.unix-ag.uni-kl.de/~conrad/greylisting/releases--0.1
archive not registered: -unavailable-
(see register-archive)
Grabbing:
address@bogus.example.com/address@bogus.example.com">http://www.unix-ag.uni-kl.de/~conrad/Archives/address@bogus.example.com
Source: address@bogus.example.com">http://www.unix-ag.uni-kl.de/~conrad/Archives/address@bogus.example.com, Dest:
greylisting-spp--releases--0.1
address@bogus.example.com:/tmp/test> ls -alR
.:
insgesamt 3
drwxr-xr-x 2 conrad users 48 2004-08-27 14:27
,,grab.greylisting-spp--releases--0.1.1093609651.3011.2
drwxr-xr-x 3 conrad users 120 2004-08-27 14:27 .
drwxrwxrwt 20 root root 1800 2004-08-27 14:27 ..
./,,grab.greylisting-spp--releases--0.1.1093609651.3011.2:
insgesamt 1
drwxr-xr-x 2 conrad users 48 2004-08-27 14:27 .
drwxr-xr-x 3 conrad users 120 2004-08-27 14:27 ..
address@bogus.example.com:/tmp/test> # failed, obviously
address@bogus.example.com:/tmp/test> cd ..
address@bogus.example.com:/tmp> rm -rf test
address@bogus.example.com:/tmp>
This works:
address@bogus.example.com:/tmp> mkdir test
address@bogus.example.com:/tmp> cd test
address@bogus.example.com:/tmp/test> HOME=`pwd` tla register-archive -unavailable-
address@bogus.example.com">http://www.unix-ag.uni-kl.de/~conrad/Archives/address@bogus.example.com
address@bogus.example.com:/tmp/test> HOME=`pwd` tla grab
http://www.unix-ag.uni-kl.de/~conrad/greylisting/releases--0.1
Grabbing:
address@bogus.example.com/address@bogus.example.com">http://www.unix-ag.uni-kl.de/~conrad/Archives/address@bogus.example.com
Source: address@bogus.example.com">http://www.unix-ag.uni-kl.de/~conrad/Archives/address@bogus.example.com, Dest:
greylisting-spp--releases--0.1
- from archive cached: address@bogus.example.com/greylisting-spp--releases--0.1--base-0
- patching for revision: address@bogus.example.com/greylisting-spp--releases--0.1--patch-1
[...]
- patching for revision: address@bogus.example.com/greylisting-spp--releases--0.1--patch-7
address@bogus.example.com:/tmp/test> ls -al
insgesamt 4
drwxr-xr-x 4 conrad users 128 2004-08-27 14:35 .
drwxrwxrwt 20 root root 1800 2004-08-27 14:35 ..
drwx------ 3 conrad users 80 2004-08-27 14:34 .arch-params
drwxr-xr-x 6 conrad users 240 2004-08-27 14:35
greylisting-spp--releases--0.1
address@bogus.example.com:/tmp/test> # expected result
address@bogus.example.com:/tmp/test> cd ..
address@bogus.example.com:/tmp> rm -rf test
address@bogus.example.com:/tmp>
Looking at the source of libarch/cmd-grab.c this seems to be easy to fix:
[...]
> /********************
> * Time to grab the archive
> */
> final_revision = find_latest_revision (archive_name, target_revision);
> arch_set_archive_location(archive_name, archive_location, 0,
> ARCH_REG_FAIL_QUIET);
>
> archive = arch_archive_connect (archive_name, 0);
[...]
find_latest_revision is called before the archive has been registered!
Swapping the two lines (find_latest_revision and arch_set_archive_location)
seems to solve the problem, see the attached patch.
Bye,
Peter
|