csw-upload-pkg should not break in the middle of insertions
Brought to you by:
dmichelsen,
wahwah
Here is a scenario:
dam@login [login]:/home/dam/staging/build-29.Jun.2011 > csw-upload-pkg libassuan*
Processing 5 file(s). Please wait.
Uploading 'libassuan0-2.0.2,REV=2011.06.29-SunOS5.9-i386-CSW.pkg.gz'
Uploading 'libassuan0-2.0.2,REV=2011.06.29-SunOS5.9-sparc-CSW.pkg.gz'
Uploading 'libassuan_dev-2.0.2,REV=2011.06.29-SunOS5.9-i386-CSW.pkg.gz'
Uploading 'libassuan_dev-2.0.2,REV=2011.06.29-SunOS5.9-sparc-CSW.pkg.gz'
Uploading 'libassuan_stub-2.0.2,REV=2011.06.29-SunOS5.9-all-CSW.pkg.gz'
Checking 3 package(s) against catalog unstable sparc SunOS5.9
Checking 3 package(s) against catalog unstable i386 SunOS5.9
Checking 3 package(s) against catalog unstable sparc SunOS5.10
Checking 3 package(s) against catalog unstable i386 SunOS5.10
All checks successful. Proceeding.
Inserting libassuan0 (i386 SunOS5.9) into catalog unstable i386 SunOS5.10
Inserting libassuan_dev (i386 SunOS5.9) into catalog unstable i386 SunOS5.10
Inserting libassuan_stub (all SunOS5.9) into catalog unstable i386 SunOS5.10
CRITICAL:root:Response: 406 {"error_message": "There already is a package with that pkgname: CSWlibassuan"}
Traceback (most recent call last):
File "/home/dam/bin/csw-upload-pkg", line 596, in <module>
uploader.Upload()
File "/home/dam/bin/csw-upload-pkg", line 172, in Upload
self._InsertIntoCatalog(filename, arch, osrel, file_metadata)
File "/home/dam/bin/csw-upload-pkg", line 375, in _InsertIntoCatalog
raise RestCommunicationError("%s - HTTP code: %s" % (url, http_code))
__main__.RestCommunicationError: http://buildfarm.opencsw.org/releases/catalogs/unstable/i386/SunOS5.10/1d025c2aeb07fed61e29124f0862f02f/ - HTTP code: 406
zsh: 843 exit 1 csw-upload-pkg libassuan*
dam@login [login]:/home/dam/staging/build-29.Jun.2011 >
There are two different issues here:
Fixing the first one is relatively easy, I'll do that. Implementing the second one is more complex and requires significant effort.