> gina needs to support 3.0 (quilt) and 3.0 (native) sources. To do this, it
> just needs to identify files as the correct types. Since archiveuploader
> already has a function to do this, I've altered gina to use that rather
> than the duplicated canonical.launchpad.helpers.getFileType. As gina was
> the final callsite of getFileType, I've removed that.
>
> Since determine_source_file_type only does source files, I've added
> determine_binary_file_type. It could possibly go along with
> determine_source_file_type in lp.archiveuploader.utils, but I'm not quite
> sure.
I think it should go there to be consistent.
>
> For testing, I've added a 3.0 (quilt) source to the test archive.
>
Great, thanks for making this change William! It looks good to me so I
approved it. There's just a couple of minor comments inline.
I think Gina is the only thing using getBinaryPackageFormat - it might be
worth de-cluttering helpers.py and moving it to the gina module.
>+
>+
>+def determine_binary_file_type(filename):
>+ """Determine the BinaryPackageFileType of the given filename."""
>+
>+ if filename.endswith(".deb"):
>+ return BinaryPackageFileType.DEB
>+ elif filename.endswith(".udeb"):
>+ return BinaryPackageFileType.DEB
This should be UDEB I think?
Everything else looks good! Remind me to land this and the other branch when
PQM opens.
review approve
merge approve
> gina needs to support 3.0 (quilt) and 3.0 (native) sources. To do this, it launchpad. helpers. getFileType. As gina was source_ file_type only does source files, I've added binary_ file_type. It could possibly go along with source_ file_type in lp.archiveuploa der.utils, but I'm not quite
> just needs to identify files as the correct types. Since archiveuploader
> already has a function to do this, I've altered gina to use that rather
> than the duplicated canonical.
> the final callsite of getFileType, I've removed that.
>
> Since determine_
> determine_
> determine_
> sure.
I think it should go there to be consistent.
>
> For testing, I've added a 3.0 (quilt) source to the test archive.
>
Great, thanks for making this change William! It looks good to me so I
approved it. There's just a couple of minor comments inline.
[snip]
>=== modified file 'lib/lp/ soyuz/scripts/ gina/handlers. py' soyuz/scripts/ gina/handlers. py 2009-11-07 09:50:37 +0000 soyuz/scripts/ gina/handlers. py 2009-12-01 10:10:48 +0000 sher.diskpool import poolify der.tagfiles import parse_tagfile der.utils import determine_ source_ file_type database. sqlbase import sqlvalues interfaces. person import IPersonSet, ationale from lp.registry. interfaces. sourcepackage import interfaces. binarypackagere lease import leType from lp.soyuz. interfaces. binarypackagena me import ameSet from lp.soyuz. interfaces. build import BuildStatus interfaces. publishing import PackagePublishi ngStatus launchpad. helpers import getFileType, getBinaryPackag eFormat launchpad. helpers import getBinaryPackag eFormat
>--- lib/lp/
>+++ lib/lp/
>@@ -29,6 +29,7 @@
>
> from lp.archivepubli
> from lp.archiveuploa
>+from lp.archiveuploa
>
> from canonical.
>
>@@ -46,10 +47,22 @@
>
> from lp.registry.
> PersonCreationR
> SourcePackageType +from lp.soyuz.
> BinaryPackageFi
> IBinaryPackageN
> from lp.soyuz.
>-from canonical.
>+from canonical.
I think Gina is the only thing using getBinaryPackag eFormat - it might be
worth de-cluttering helpers.py and moving it to the gina module.
>+ binary_ file_type( filename) : leType of the given filename.""" endswith( ".deb") : leType. DEB endswith( ".udeb" ): leType. DEB
>+
>+def determine_
>+ """Determine the BinaryPackageFi
>+
>+ if filename.
>+ return BinaryPackageFi
>+ elif filename.
>+ return BinaryPackageFi
This should be UDEB I think?
Everything else looks good! Remind me to land this and the other branch when
PQM opens.
Cheers
J