mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-07 15:01:34 +00:00
syncpackage: Fix sponsoring for fake sync.
This commit is contained in:
parent
3e72a73484
commit
518a6006d6
33
syncpackage
33
syncpackage
@ -151,11 +151,12 @@ def add_fixed_bugs(changes, bugs, verbose=False):
|
|||||||
|
|
||||||
return "\n".join(changes + [""])
|
return "\n".join(changes + [""])
|
||||||
|
|
||||||
def sync_dsc(dscurl, debian_dist, release, uploader, bugs, keyid=None, verbose=False):
|
def sync_dsc(dscurl, debian_dist, release, name, email, bugs, keyid=None, verbose=False):
|
||||||
assert dscurl.endswith(".dsc")
|
assert dscurl.endswith(".dsc")
|
||||||
dscname = os.path.basename(dscurl)
|
dscname = os.path.basename(dscurl)
|
||||||
basepath = os.path.dirname(dscurl)
|
basepath = os.path.dirname(dscurl)
|
||||||
(srcpkg, new_ver) = dscname.split('_')
|
(srcpkg, new_ver) = dscname.split('_')
|
||||||
|
uploader = name + " <" + email + ">"
|
||||||
|
|
||||||
if os.path.exists(os.path.join(basepath, dscname)):
|
if os.path.exists(os.path.join(basepath, dscname)):
|
||||||
dscfile = dscurl
|
dscfile = dscurl
|
||||||
@ -172,6 +173,7 @@ def sync_dsc(dscurl, debian_dist, release, uploader, bugs, keyid=None, verbose=F
|
|||||||
ubuntu_dsc = ubuntu_dsc[0]
|
ubuntu_dsc = ubuntu_dsc[0]
|
||||||
except udtexceptions.PackageNotFoundException:
|
except udtexceptions.PackageNotFoundException:
|
||||||
ubuntu_ver = '~'
|
ubuntu_ver = '~'
|
||||||
|
ubuntu_dsc = None
|
||||||
|
|
||||||
# No need to continue if version is not greater than current one
|
# No need to continue if version is not greater than current one
|
||||||
apt_pkg.init()
|
apt_pkg.init()
|
||||||
@ -187,7 +189,10 @@ def sync_dsc(dscurl, debian_dist, release, uploader, bugs, keyid=None, verbose=F
|
|||||||
print 'Source files:', map(lambda x: x.get_name(), source_files)
|
print 'Source files:', map(lambda x: x.get_name(), source_files)
|
||||||
map(lambda f: f.download(verbose), files)
|
map(lambda f: f.download(verbose), files)
|
||||||
|
|
||||||
ubuntu_files = dsc_getfiles(ubuntu_dsc)
|
if ubuntu_dsc is None:
|
||||||
|
ubuntu_files = None
|
||||||
|
else:
|
||||||
|
ubuntu_files = dsc_getfiles(ubuntu_dsc)
|
||||||
|
|
||||||
# do we need the orig.tar.gz?
|
# do we need the orig.tar.gz?
|
||||||
need_orig = True
|
need_orig = True
|
||||||
@ -289,9 +294,10 @@ def sync_dsc(dscurl, debian_dist, release, uploader, bugs, keyid=None, verbose=F
|
|||||||
else:
|
else:
|
||||||
message = "Fake sync due to mismatching orig tarball."
|
message = "Fake sync due to mismatching orig tarball."
|
||||||
cmd = ["dch", "-v", new_ver, "-D", release, message]
|
cmd = ["dch", "-v", new_ver, "-D", release, message]
|
||||||
|
env = {"DEBFULLNAME": name, "DEBEMAIL": email}
|
||||||
|
|
||||||
# update the Maintainer field
|
# update the Maintainer field
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd, env=env)
|
||||||
subprocess.check_call(["update-maintainer"])
|
subprocess.check_call(["update-maintainer"])
|
||||||
|
|
||||||
# Build source package
|
# Build source package
|
||||||
@ -312,7 +318,10 @@ def get_debian_dscurl(package, dist, release, version=None, component=None):
|
|||||||
|
|
||||||
if version is None or component is None:
|
if version is None or component is None:
|
||||||
debian_srcpkg = getDebianSrcPkg(package, dist)
|
debian_srcpkg = getDebianSrcPkg(package, dist)
|
||||||
ubuntu_version = getUbuntuSrcPkg(package, release).getVersion()
|
try:
|
||||||
|
ubuntu_version = getUbuntuSrcPkg(package, release).getVersion()
|
||||||
|
except udtexceptions.PackageNotFoundException:
|
||||||
|
ubuntu_version = '~'
|
||||||
apt_pkg.init()
|
apt_pkg.init()
|
||||||
if apt_pkg.check_dep(ubuntu_version, ">=", debian_srcpkg.getVersion()):
|
if apt_pkg.check_dep(ubuntu_version, ">=", debian_srcpkg.getVersion()):
|
||||||
# The LP importer is maybe out of date
|
# The LP importer is maybe out of date
|
||||||
@ -351,10 +360,14 @@ if __name__ == "__main__":
|
|||||||
help="Specify the component to sync from.", dest="component", default=None)
|
help="Specify the component to sync from.", dest="component", default=None)
|
||||||
parser.add_option("-v", "--verbose", help="print more information",
|
parser.add_option("-v", "--verbose", help="print more information",
|
||||||
dest="verbose", action="store_true", default=False)
|
dest="verbose", action="store_true", default=False)
|
||||||
parser.add_option("-u", "--uploader", dest="uploader",
|
parser.add_option("-n", "--uploader-name", dest="uploader_name",
|
||||||
help="Use UPLOADER as the name and email address of the maintainer "
|
help="Use UPLOADER_NAME as the name of the maintainer "
|
||||||
"for this upload instead of evaluating DEBFULLNAME and DEBEMAIL.",
|
"for this upload instead of evaluating DEBFULLNAME.",
|
||||||
default = os.environ["DEBFULLNAME"] + " <" + os.environ["DEBEMAIL"] + ">")
|
default = os.environ["DEBFULLNAME"])
|
||||||
|
parser.add_option("-e", "--uploader-email", dest="uploader_email",
|
||||||
|
help="Use UPLOADER_EMAIL as email address of the maintainer "
|
||||||
|
"for this upload instead of evaluating DEBEMAIL.",
|
||||||
|
default = os.environ["DEBEMAIL"])
|
||||||
parser.add_option("-k", "--key", dest="keyid",
|
parser.add_option("-k", "--key", dest="keyid",
|
||||||
help="Specify the key ID to be used for signing.", default=None)
|
help="Specify the key ID to be used for signing.", default=None)
|
||||||
parser.add_option("-b", "--bug", metavar="BUG",
|
parser.add_option("-b", "--bug", metavar="BUG",
|
||||||
@ -388,5 +401,5 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
print ".dsc url: " + dscurl
|
print ".dsc url: " + dscurl
|
||||||
sync_dsc(dscurl, options.dist, options.release, options.uploader,
|
sync_dsc(dscurl, options.dist, options.release, options.uploader_name,
|
||||||
options.bugs, options.keyid, options.verbose)
|
options.uploader_email, options.bugs, options.keyid, options.verbose)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user