else:
self.orig_dir = '%s-%s' % (self.source, self.version.upstream)
self.orig_tar = '%s_%s.orig.tar.xz' % (self.source, self.version.upstream)
- if options.tag is None:
- options.tag = 'RELEASE-' + self.version.upstream
def __call__(self):
out = "../orig/%s" % self.orig_tar
self.log("Generate tarball %s\n" % out)
+ if self.options.tag:
+ treeish = self.options.tag
+ else:
+ if self.changelog_entry.version.pre_commit:
+ treeish = self.changelog_entry.version.pre_commit
+ elif self.changelog_entry.version.rc_commit:
+ treeish = self.changelog_entry.version.rc_commit
+ else:
+ treeish = 'RELEASE-%s' % self.version.upstream
+
try:
os.stat(out)
raise RuntimeError("Destination already exists")
try:
with open(out, 'wb') as f:
- tag = self.options.tag or 'HEAD'
- _cmd = ('git', 'archive', '--prefix', '%s/' % self.orig_dir, tag)
+ _cmd = ('git', 'archive', '--prefix', '%s/' % self.orig_dir, treeish)
p1 = subprocess.Popen(_cmd, stdout=subprocess.PIPE, cwd=self.repo)
subprocess.check_call(('xz', ), stdin=p1.stdout, stdout=f)
if p1.wait():
^
(?P<version>\d+\.\d+)
(?:
- \.\d+(?:~pre(?:\+\d+\.[0-9a-f]{10}))?
+ \.\d+(?:~pre(?:\+\d+\.(?P<pre_commit>[0-9a-f]{10})))?
|
- ~rc\d+(?:\+\d+\.[0-9a-f]{10})?
+ ~rc\d+(?:\+\d+\.(?P<rc_commit>[0-9a-f]{10}))?
)
-
(?:[^-]+)
raise ValueError("Invalid debian xen version")
d = match.groupdict()
self.xen_version = d['version']
-
+ self.pre_commit = d['pre_commit']
+ self.rc_commit = d['rc_commit']