Merge lp:~stefanor/bzr-builddeb/upstream-version-strip-711826 into lp:bzr-builddeb

Proposed by Stefano Rivera
Status: Merged
Merged at revision: 508
Proposed branch: lp:~stefanor/bzr-builddeb/upstream-version-strip-711826
Merge into: lp:bzr-builddeb
Diff against target: 92 lines (+10/-11)
4 files modified
cmds.py (+3/-3)
dh_make.py (+1/-1)
tests/test_upstream.py (+1/-2)
upstream.py (+5/-5)
To merge this branch: bzr merge lp:~stefanor/bzr-builddeb/upstream-version-strip-711826
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+48303@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Hi Stefano,

On Wed, 2011-02-02 at 12:47 +0000, Stefano Rivera wrote:
> Stefano Rivera has proposed merging lp:~stefanor/bzr-builddeb/upstream-version-strip-711826 into lp:bzr-builddeb.
>
> Requested reviews:
> Bzr-builddeb-hackers (bzr-builddeb-hackers)
> Related bugs:
> #711826 bzr-builddeb strips two "-X" blocks from the end of the version instead of only one, when looking for the upstream tarball
> https://bugs.launchpad.net/bugs/711826
Thanks for the patch. This seems reasonable, though I also wonder if we
shouldn't fix it in the other place instead - that way upstream.py
doesn't need to know about Debian versions at all, and it could just
stick to upstream versions everywhere.

Cheers,

Jelmer

Revision history for this message
James Westby (james-w) wrote :

> Thanks for the patch. This seems reasonable, though I also wonder if we
> shouldn't fix it in the other place instead - that way upstream.py
> doesn't need to know about Debian versions at all, and it could just
> stick to upstream versions everywhere.

That sounds like a good idea to me. I don't know why upstream.py would need
to know about the full version.

Stefano, would you be comfortable making that change, or would you like one
of us to do it?

Thanks,

James

507. By Jelmer Vernooij

Merge support for TarfileSource and for automatically detecting v3 source packages in merge-upstream.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Yeah that sounds reasonable, I'll have a shot at it now.

The quick easy solution is almost never the one the upstream wants for long term :)

Revision history for this message
Stefano Rivera (stefanor) wrote :

There.

Tests pass (as much as they currently do) :)

509. By Stefano Rivera

Only pass upstream version string to UpstreamProvider

510. By Stefano Rivera

UpstreamProvider's version is now an upstream-component version string

511. By Stefano Rivera

Use string version in _SimpleUpstreamProvider

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Wed, 2011-02-02 at 21:01 +0000, Stefano Rivera wrote:
> There.
Thanks. Looks good to me, and great to see we don't even need Version in
upstream.py anymore. (:

  review approve

> Tests pass (as much as they currently do) :)
Do you have broken tests in trunk at the moment? If so, please do file
bugs. That's not the desired state of the testsuite. :)

Cheers,

Jelmer

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

> Do you have broken tests in trunk at the moment?

They look configobj related. /me files bugs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmds.py'
2--- cmds.py 2011-02-02 16:12:04 +0000
3+++ cmds.py 2011-02-02 21:03:21 +0000
4@@ -405,7 +405,7 @@
5 upstream_sources.append(SelfSplitSource(tree))
6
7 upstream_provider = UpstreamProvider(changelog.package,
8- changelog.version, orig_dir, upstream_sources)
9+ changelog.version.upstream_version, orig_dir, upstream_sources)
10
11 if build_type == BUILD_TYPE_MERGE:
12 distiller_cls = MergeModeDistiller
13@@ -996,8 +996,8 @@
14 if orig_dir is None:
15 orig_dir = default_orig_dir
16
17- upstream_provider = UpstreamProvider(changelog.package,
18- changelog.version.upstream_version, orig_dir,
19+ upstream_provider = UpstreamProvider(changelog.package,
20+ changelog.version.upstream_version, orig_dir,
21 [PristineTarSource(t, t.branch),
22 AptSource(),
23 GetOrigSourceSource(t, larstiq),
24
25=== modified file 'dh_make.py'
26--- dh_make.py 2011-02-02 16:04:04 +0000
27+++ dh_make.py 2011-02-02 21:03:21 +0000
28@@ -66,7 +66,7 @@
29 trace.note("Fetching tarball")
30 repack_tarball(tarball, dest_name, target_dir=orig_dir,
31 force_gz=not use_v3)
32- provider = upstream.UpstreamProvider(package_name, "%s-1" % version,
33+ provider = upstream.UpstreamProvider(package_name, version,
34 orig_dir, [])
35 provider.provide(os.path.join(tree.basedir, ".."))
36 return tarball_filename, util.md5sum_filename(tarball_filename)
37
38=== modified file 'tests/test_upstream.py'
39--- tests/test_upstream.py 2011-02-02 13:18:56 +0000
40+++ tests/test_upstream.py 2011-02-02 21:03:21 +0000
41@@ -47,7 +47,6 @@
42 UpstreamProvider,
43 UpstreamSource,
44 UScanSource,
45- Version,
46 )
47
48
49@@ -395,7 +394,7 @@
50
51 def __init__(self, package, version, store_dir):
52 self.package = package
53- self.version = Version(version)
54+ self.version = version
55 self.store_dir = store_dir
56
57 def provide(self, target_dir):
58
59=== modified file 'upstream.py'
60--- upstream.py 2011-02-02 13:18:56 +0000
61+++ upstream.py 2011-02-02 21:03:21 +0000
62@@ -434,7 +434,7 @@
63 :param store_dir: A directory to cache the tarballs.
64 """
65 self.package = package
66- self.version = Version(version)
67+ self.version = version
68 self.store_dir = store_dir
69 self.source = StackedUpstreamSource(sources)
70
71@@ -472,7 +472,7 @@
72 os.makedirs(self.store_dir)
73 try:
74 path = self.source.fetch_tarball(self.package,
75- self.version.upstream_version, self.store_dir)
76+ self.version, self.store_dir)
77 except PackageVersionNotPresent:
78 raise MissingUpstreamTarball(self._tarball_names()[0])
79 assert isinstance(path, basestring)
80@@ -506,9 +506,9 @@
81 return path
82
83 def _tarball_names(self):
84- return [tarball_name(self.package, self.version.upstream_version),
85- tarball_name(self.package, self.version.upstream_version, format='bz2'),
86- tarball_name(self.package, self.version.upstream_version, format='lzma')]
87+ return [tarball_name(self.package, self.version),
88+ tarball_name(self.package, self.version, format='bz2'),
89+ tarball_name(self.package, self.version, format='lzma')]
90
91
92 class TarfileSource(UpstreamSource):

Subscribers

People subscribed via source and target branches