Merge lp:~jelmer/launchpad/sync-tbz2 into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Jelmer Vernooij on 2010-02-08 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~jelmer/launchpad/sync-tbz2 |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
916 lines (+303/-297) 7 files modified
lib/canonical/launchpad/scripts/logger.py (+1/-1) lib/lp/soyuz/scripts/ftpmaster.py (+27/-27) lib/lp/soyuz/scripts/tests/sync_source_home/Debian_incoming_main_Sources (+28/-0) lib/lp/soyuz/scripts/tests/sync_source_home/sample1_1.0-1.dsc (+37/-0) lib/lp/soyuz/scripts/tests/test_sync_source.py (+105/-28) scripts/ftpmaster-tools/dak_utils.py (+3/-153) scripts/ftpmaster-tools/sync-source.py (+102/-88) |
| To merge this branch: | bzr merge lp:~jelmer/launchpad/sync-tbz2 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Guilherme Salgado (community) | code | 2010-02-04 | Approve on 2010-02-05 |
|
Review via email:
|
|||
Commit Message
Fixes support for syncing packages in the the version 3 source format.
| Jelmer Vernooij (jelmer) wrote : | # |
| Guilherme Salgado (salgado) wrote : | # |
Hi Jelmer,
I have just a few comments/questions below, but this looks good. And
thanks a lot for getting rid of the untested/duplicated code.
review approve code
On Thu, 2010-02-04 at 16:24 +0000, Jelmer Vernooij wrote:
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
[...]
> @@ -847,19 +854,14 @@
> Return the fetched filename if it was present in Librarian or None
> if it wasn't.
> """
> - # XXX cprov 2007-01-10 bug=78683: Looking for files within ubuntu
> - # only. It doesn't affect the usual sync-source procedure. However
> - # it needs to be revisited for derivation, we probably need
> - # to pass the target distribution in order to make proper lookups.
> - ubuntu = getUtility(
Does this mean the bug above will be fixed too?
> try:
> - libraryfilealias = ubuntu.
> + libraryfilealias = self.todistro.
> filename, source=True, binary=False)
> except NotFoundError:
> return None
>
> - self.debug(
> - "\t%s: already in distro - downloading from librarian" %
> + self.logger.info(
> + "%s: already in distro - downloading from librarian" %
> filename)
>
> output_file = open(filename, 'w')
> @@ -871,23 +873,23 @@
> """Try to fetch files from Librarian.
>
> It raises SyncSourceError if anything else then an
> - 'orig.tar.gz' was found in Librarian.
> - Return a boolean indicating whether or not the 'orig.tar.gz' is
> - required in the upload.
> + orig tarball was found in Librarian.
> + Return the names of the files retrieved from the librarian.
> """
> - orig_filename = None
> + retrieved = []
> for filename in self.files.keys():
> if not self.fetchFileF
> continue
> + file_type = determine_
> # set the return code if an orig was, in fact,
> # fetched from Librarian
> - if filename.
> - orig_filename = filename
> - else:
> + if not file_type in (SourcePackageF
> + SourcePackageFi
The indentation above is a bit odd; the two elements of the tuple should
be lined up.
> raise SyncSourceError(
> - 'Oops, only orig.tar.gz can be retrieved from librarian')
> + 'Oops, only orig tarball can be retrieved from librarian.')
> + retrieved.
>
> - return orig_filename
> + return retrieved
>
> def fetchSyncFiles(
> """Fetch files from the original sync source.
>
> === modified file 'scripts/
> --- scripts/
| Jelmer Vernooij (jelmer) wrote : | # |
Hi Guilherme,
Thanks for the review.
On Fri, 2010-02-05 at 17:48 +0000, Guilherme Salgado wrote:
> On Thu, 2010-02-04 at 16:24 +0000, Jelmer Vernooij wrote:
> > === modified file 'lib/canonical/
> > --- lib/canonical/
> > +++ lib/canonical/
> [...]
> > @@ -847,19 +854,14 @@
> > Return the fetched filename if it was present in Librarian or None
> > if it wasn't.
> > """
> > - # XXX cprov 2007-01-10 bug=78683: Looking for files within ubuntu
> > - # only. It doesn't affect the usual sync-source procedure. However
> > - # it needs to be revisited for derivation, we probably need
> > - # to pass the target distribution in order to make proper lookups.
> > - ubuntu = getUtility(
> Does this mean the bug above will be fixed too?
Partially - bug 78683 is about sync-source only working with Ubuntu, and
this change gets us further in that direction but there are still some
places where we hardcode 'ubuntu' in scripts/
I've addressed the style issue you've raised and I'll ec2 land after I
finish testing on dogfood.
Cheers,
Jelmer

Fixes support for syncing packages in the the version 3 source format (bug 225151).
This patch adds support for .orig.tar.bz2 files as well as multiple component orig tarballs in the script that syncs source packages from Debian. These new file formats are used by the new Debian source package format, v3.0.
This branch also refactors sync-source.py to use code from lp.soyuz. scripts. ftpmaster (well unit tested) rather its local copy (no tests). It also removes duplicate code for parsing dsc files from lp.soyuz. scripts. dak_utils in favor of the Dsc parser in debian_ bundle. deb822.