mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-25 01:41:08 +00:00
Add --fakesync option, relegating --no-lp to really crazy corner cases.
This commit is contained in:
parent
08513b1897
commit
5bf59a2cd7
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -9,6 +9,7 @@ ubuntu-dev-tools (0.134) UNRELEASED; urgency=low
|
|||||||
for it.
|
for it.
|
||||||
- Always display blacklist comments, if they exist.
|
- Always display blacklist comments, if they exist.
|
||||||
- Display timestamps for DSD blacklist comments.
|
- Display timestamps for DSD blacklist comments.
|
||||||
|
- Add --fakesync option, relegating --no-lp to really crazy corner cases.
|
||||||
|
|
||||||
[ Benjamin Drung ]
|
[ Benjamin Drung ]
|
||||||
* syncpackage: Catch user abort.
|
* syncpackage: Catch user abort.
|
||||||
|
@ -12,8 +12,8 @@ Ubuntu.
|
|||||||
Debian ones, as the common script used by Ubuntu archive administrators does,
|
Debian ones, as the common script used by Ubuntu archive administrators does,
|
||||||
this way you can preserve source files integrity between the two distributions.
|
this way you can preserve source files integrity between the two distributions.
|
||||||
.PP
|
.PP
|
||||||
\fBsyncpackage\fR will detect source tarballs with mismatching checksums
|
\fBsyncpackage\fR will detect source tarballs with mismatching
|
||||||
and will automatically create fake syncs instead.
|
checksums, and can perform fake syncs.
|
||||||
.SH WARNING
|
.SH WARNING
|
||||||
The use of \fBsyncpackage \-\-no\-lp\fR, which generates a changes file to
|
The use of \fBsyncpackage \-\-no\-lp\fR, which generates a changes file to
|
||||||
be directly uploaded to the Ubuntu primary archive or a PPA, is discouraged
|
be directly uploaded to the Ubuntu primary archive or a PPA, is discouraged
|
||||||
@ -49,6 +49,10 @@ Display more progress information.
|
|||||||
Construct sync locally rather than letting Launchpad copy the package
|
Construct sync locally rather than letting Launchpad copy the package
|
||||||
directly (not recommended).
|
directly (not recommended).
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-F\fR, \fB\-\-fakesync\fR
|
||||||
|
Perform a fakesync, to work around a tarball mismatch between Debian and
|
||||||
|
Ubuntu. This option ignores blacklisting, and performs a local sync.
|
||||||
|
.TP
|
||||||
\fB\-l\fI INSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
|
\fB\-l\fI INSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
|
||||||
Launchpad instance to connect to (default: production).
|
Launchpad instance to connect to (default: production).
|
||||||
.TP
|
.TP
|
||||||
@ -73,9 +77,6 @@ Mark a Launchpad bug as being fixed by this upload.
|
|||||||
.TP
|
.TP
|
||||||
\fB\-f\fR, \fB\-\-force\fR
|
\fB\-f\fR, \fB\-\-force\fR
|
||||||
Force sync over the top of Ubuntu changes.
|
Force sync over the top of Ubuntu changes.
|
||||||
If a sync is blacklisted because of a source tarball mismatch,
|
|
||||||
\fB\-\-force\fR can be used to override the blacklist, when doing a
|
|
||||||
local sync (\fB\-\-no\-lp\fR).
|
|
||||||
.TP
|
.TP
|
||||||
.B \-d \fIDEBIAN_MIRROR\fR, \fB\-\-debian\-mirror\fR=\fIDEBIAN_MIRROR\fR
|
.B \-d \fIDEBIAN_MIRROR\fR, \fB\-\-debian\-mirror\fR=\fIDEBIAN_MIRROR\fR
|
||||||
Use the specified mirror.
|
Use the specified mirror.
|
||||||
|
44
syncpackage
44
syncpackage
@ -119,7 +119,7 @@ def add_fixed_bugs(changes, bugs):
|
|||||||
return "\n".join(changes + [""])
|
return "\n".join(changes + [""])
|
||||||
|
|
||||||
def sync_dsc(src_pkg, debian_dist, release, name, email, bugs, ubuntu_mirror,
|
def sync_dsc(src_pkg, debian_dist, release, name, email, bugs, ubuntu_mirror,
|
||||||
keyid=None, simulate=False, force=False):
|
keyid=None, simulate=False, force=False, fakesync=False):
|
||||||
uploader = name + " <" + email + ">"
|
uploader = name + " <" + email + ">"
|
||||||
|
|
||||||
src_pkg.pull_dsc()
|
src_pkg.pull_dsc()
|
||||||
@ -162,11 +162,19 @@ def sync_dsc(src_pkg, debian_dist, release, name, email, bugs, ubuntu_mirror,
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
src_pkg.unpack()
|
src_pkg.unpack()
|
||||||
|
|
||||||
fakesync = not (need_orig or ubu_pkg.verify_orig())
|
needs_fakesync = not (need_orig or ubu_pkg.verify_orig())
|
||||||
|
|
||||||
|
if needs_fakesync and fakesync:
|
||||||
|
Logger.warn('Performing a fakesync')
|
||||||
|
elif not needs_fakesync and fakesync:
|
||||||
|
Logger.error('Fakesync not required, aborting.')
|
||||||
|
sys.exit(1)
|
||||||
|
elif needs_fakesync and not fakesync:
|
||||||
|
Logger.error('The checksums of the Debian and Ubuntu packages '
|
||||||
|
'mismatch. A fake sync using --fakesync is required.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if fakesync:
|
if fakesync:
|
||||||
Logger.warn('The checksums of the Debian and Ubuntu packages mismatch. '
|
|
||||||
'A fake sync is required.')
|
|
||||||
# Download Ubuntu files (override Debian source tarballs)
|
# Download Ubuntu files (override Debian source tarballs)
|
||||||
try:
|
try:
|
||||||
ubu_pkg.pull()
|
ubu_pkg.pull()
|
||||||
@ -359,7 +367,7 @@ def copy(src_pkg, release, bugs, simulate=False, force=False):
|
|||||||
ubuntu_pkg.pull_dsc()
|
ubuntu_pkg.pull_dsc()
|
||||||
if not src_pkg.dsc.compare_dsc(ubuntu_pkg.dsc):
|
if not src_pkg.dsc.compare_dsc(ubuntu_pkg.dsc):
|
||||||
Logger.error('The checksums of the Debian and Ubuntu packages '
|
Logger.error('The checksums of the Debian and Ubuntu packages '
|
||||||
'mismatch. A fake sync using --no-lp is required.')
|
'mismatch. A fake sync using --fakesync is required.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except udtexceptions.PackageNotFoundException:
|
except udtexceptions.PackageNotFoundException:
|
||||||
base_version = Version('~')
|
base_version = Version('~')
|
||||||
@ -490,6 +498,10 @@ def parse():
|
|||||||
parser.add_option("-v", "--verbose",
|
parser.add_option("-v", "--verbose",
|
||||||
dest="verbose", action="store_true", default=False,
|
dest="verbose", action="store_true", default=False,
|
||||||
help="Display more progress information.")
|
help="Display more progress information.")
|
||||||
|
parser.add_option("-F", "--fakesync",
|
||||||
|
dest="fakesync", action="store_true", default=False,
|
||||||
|
help="Perform a fakesync (a sync where Debian and Ubuntu "
|
||||||
|
"have a .orig.tar mismatch).")
|
||||||
parser.add_option("--no-lp",
|
parser.add_option("--no-lp",
|
||||||
dest="lp", action="store_false", default=True,
|
dest="lp", action="store_false", default=True,
|
||||||
help="Construct sync locally rather than letting "
|
help="Construct sync locally rather than letting "
|
||||||
@ -519,8 +531,7 @@ def parse():
|
|||||||
"upload.")
|
"upload.")
|
||||||
parser.add_option("-f", "--force",
|
parser.add_option("-f", "--force",
|
||||||
dest="force", action="store_true", default=False,
|
dest="force", action="store_true", default=False,
|
||||||
help="Force sync over the top of Ubuntu changes "
|
help="Force sync over the top of Ubuntu changes.")
|
||||||
"or a fake-sync when blacklisted.")
|
|
||||||
parser.add_option('-D', '--debian-mirror', metavar='DEBIAN_MIRROR',
|
parser.add_option('-D', '--debian-mirror', metavar='DEBIAN_MIRROR',
|
||||||
dest='debian_mirror',
|
dest='debian_mirror',
|
||||||
help='Preferred Debian mirror '
|
help='Preferred Debian mirror '
|
||||||
@ -541,6 +552,9 @@ def parse():
|
|||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.fakesync:
|
||||||
|
options.lp = False
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
parser.error('No .dsc URL/path or package name specified.')
|
parser.error('No .dsc URL/path or package name specified.')
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
@ -611,15 +625,14 @@ def main():
|
|||||||
"(blacklisted_current). Ubuntu ignores these for now. "
|
"(blacklisted_current). Ubuntu ignores these for now. "
|
||||||
"See also LP: #841372", src_pkg.source)
|
"See also LP: #841372", src_pkg.source)
|
||||||
else:
|
else:
|
||||||
if options.force and not options.lp:
|
if options.fakesync:
|
||||||
messages += ["Forcing fake-sync, overriding blacklist."]
|
messages += ["Doing a fakesync, overriding blacklist."]
|
||||||
else:
|
else:
|
||||||
blacklist_fail = True
|
blacklist_fail = True
|
||||||
messages += ["--force and --no-lp are required to override the "
|
messages += ["If this package needs a fakesync, use --fakesync",
|
||||||
"blacklist, if this package needs a fakesync."]
|
"If you think this package shouldn't be "
|
||||||
messages += ["If you think this package shouldn't be blacklisted, "
|
"blacklisted, please file a bug explaining your "
|
||||||
"please file a bug explaining your reasoning and "
|
"reasoning and subscribe ~ubuntu-archive."]
|
||||||
"subscribe ~ubuntu-archive."]
|
|
||||||
|
|
||||||
if blacklist_fail:
|
if blacklist_fail:
|
||||||
Logger.error(u"Source package %s is blacklisted.", src_pkg.source)
|
Logger.error(u"Source package %s is blacklisted.", src_pkg.source)
|
||||||
@ -646,7 +659,8 @@ def main():
|
|||||||
os.environ['DEB_VENDOR'] = 'Ubuntu'
|
os.environ['DEB_VENDOR'] = 'Ubuntu'
|
||||||
sync_dsc(src_pkg, options.dist, options.release, options.uploader_name,
|
sync_dsc(src_pkg, options.dist, options.release, options.uploader_name,
|
||||||
options.uploader_email, options.bugs, options.ubuntu_mirror,
|
options.uploader_email, options.bugs, options.ubuntu_mirror,
|
||||||
options.keyid, options.simulate, options.force)
|
options.keyid, options.simulate, options.force,
|
||||||
|
options.fakesync)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user