backports_version = "(see git)"
kernel_version = "(see git)"
else:
- backports_version = git.describe(tree=source_dir)
+ backports_version = git.describe(tree=source_dir, extra_args=['--long'])
kernel_version = git.describe(rev=args.git_revision or 'HEAD',
- tree=args.kerneldir)
+ tree=args.kerneldir,
+ extra_args=['--long'])
f = open(os.path.join(args.outdir, 'versions'), 'w')
f.write('BACKPORTS_VERSION="%s"\n' % backports_version)
f.write('BACKPORTED_KERNEL_VERSION="%s"\n' % kernel_version)
raise SHAError()
return sha
-def describe(rev='HEAD', tree=None):
- process = subprocess.Popen(['git', 'describe', '--always', '--long', rev],
+def describe(rev='HEAD', tree=None, extra_args=[]):
+ cmd = ['git', 'describe', '--always']
+
+ cmd.extend(extra_args)
+ if rev is not None:
+ cmd.append(rev)
+
+ process = subprocess.Popen(cmd,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True, universal_newlines=True, cwd=tree)
stdout = process.communicate()[0]