]> piware.de Git - bin.git/blobdiff - requestsync
do not mirror dapper/i836 any more
[bin.git] / requestsync
index 2c48f3b90d8770c9d2d20bfa60c17430f4895b5c..a5b35ad8756ca1fcfb430d76340b5a85e882aa8f 100755 (executable)
@@ -37,13 +37,23 @@ def debian_changelog(sourcepkg, version):
 # entry point
 #
 
-if len(sys.argv) != 3:
-    print 'Usage: requestsync <source package> <target release>'
+if len(sys.argv) < 3:
+    print '''Usage: requestsync <source package> <target release> [basever]
+
+In some cases, the base version (fork point from Debian) cannot be determined
+automatically, and you'll get a complete Debian changelog. Specify the correct
+base version in that case.'''
     sys.exit (1)
 
-(srcpkg, release) = sys.argv[1:]
+(srcpkg, release) = sys.argv[1:3]
+force_base_ver = None
+if len(sys.argv) >= 4:
+    force_base_ver = sys.argv[3]
 (cur_ver, component) = cur_version_component(srcpkg, release)
 
+# TODO: figure this out from packages.qa.debian.org; changelogs.d.n only works
+# for main ATM anyway, though
+debiancomponent = 'main'
 
 # generate bug report
 report = ''
@@ -54,19 +64,23 @@ report += ''' affects distros/ubuntu/%s
 
 ''' % srcpkg
 
-report += 'Please sync %s (%s) from Debian unstable.\n' % (srcpkg, component)
+report += 'Please sync %s (%s) from Debian unstable (%s).\n' % (srcpkg, component, debiancomponent)
 
+ubuntuchanges = False
 base_ver = cur_ver
 uidx = base_ver.find('ubuntu')
 if uidx > 0:
     base_ver = base_ver[:uidx]
-    report += '\nOverriding Ubuntu changes is ok.\n'
+    ubuntuchanges = True
 
 if changelog:
     uidx = base_ver.find('build')
     if uidx > 0:
        base_ver = base_ver[:uidx]
 
+    if force_base_ver:
+       base_ver = force_base_ver
+    
     report += '\nChangelog since current %s version %s:\n\n' % (release, cur_ver)
     report += debian_changelog(srcpkg, base_ver) + '\n'
 
@@ -86,15 +100,19 @@ to = 'new@bugs.launchpad.net'
 
 mail = '''From: %s
 To: %s
-Subject: Please sync %s (%s) from unstable
+Subject: Please sync %s (%s) from unstable (%s)
 
-%s''' % (myemailaddr, to, srcpkg, component, signed_report)
+%s''' % (myemailaddr, to, srcpkg, component, debiancomponent, signed_report)
 
 print mail
+
 print 'Press enter to file this bug, Control-C to abort'
 sys.stdin.readline()
 
-s = smtplib.SMTP()
-s.connect()
+s = smtplib.SMTP('fiordland.ubuntu.com')
 s.sendmail(myemailaddr, to, mail)
-s.close()
+s.quit()
+
+if ubuntuchanges:
+    print 'You need to write a followup bug comment with some short explanation of the Ubuntu delta and why it can be dropped.'
+