Commit 9d445a56 authored by Aaron Wells's avatar Aaron Wells
Browse files

Patching lptools to send the auto-generated release files

We were *always* getting prompted for the changes & releasenotes
three times on each release. That's because the optional lptools
arguments for change & release notes must be the 5th and 6th.
But, we couldn't provide them, because the lptools 4th optional
argument is "new milestone", and if you try to provide one that
already exists, it errors out.

So, we had to leave "new milestone" empty, and that meant we
also had to leave change & release notes empty.

Rather than getting deep into the logic of the lptools utility,
I just patched is so that it always skips the "new milestone"
parent 49dd45b9
......@@ -85,10 +85,10 @@ def cat_file(f):
return content.strip()
def main():
if len(sys.argv) < 4 or len(sys.argv) > 7:
if len(sys.argv) < 4 or len(sys.argv) > 6:
print >> sys.stderr, '''Upload a release tarball to a Launchpad project.
Usage: %s <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]''' % sys.argv[0]
Usage: %s <project name> <version> <tarball> [changelog file] [releasenotes file]''' % sys.argv[0]
new_milestone = None
......@@ -97,12 +97,11 @@ def main():
if len(sys.argv) == 4:
(project, version, tarball) = sys.argv[1:]
elif len(sys.argv) == 5:
(project, version, tarball, new_milestone) = sys.argv[1:]
(project, version, tarball, changelog_file) = sys.argv[1:]
elif len(sys.argv) == 6:
(project, version, tarball, new_milestone, changelog_file) = sys.argv[1:]
elif len(sys.argv) == 7:
(project, version, tarball, new_milestone, changelog_file, releasenotes_file) = sys.argv[1:]
(project, version, tarball, changelog_file, releasenotes_file) = sys.argv[1:]
print "Uploading..."
launchpad = config.get_launchpad("project-upload")
......@@ -270,13 +270,13 @@ else {
# Prepare release notes
// TODO: Replace this with a simple find/replace, to remove the m4 dependency
$TMP_M4_FILE = '/tmp/mahara-releasenotes.m4.tmp';
passthru("sed 's/^/ * /g' ${CURRENTDIR}/changes.temp >> ${CURRENTDIR}/changes.noasterisks.temp");
passthru("sed 's/^/ * /g' ${CURRENTDIR}/changes.temp >> ${CURRENTDIR}/changes.withasterisks.temp");
$m4script = <<<STRING
file_put_contents($TMP_M4_FILE, $m4script);
......@@ -319,9 +319,9 @@ gpg --armor --sign --detach-sig ${CURRENTDIR}/mahara-${RELEASE}.tar.bz2
gpg --armor --sign --detach-sig ${CURRENTDIR}/mahara-${RELEASE}.zip
lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.tar.gz
lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.tar.bz2
lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.zip
${CURRENTDIR}/lptools/lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.tar.gz changes.withasterisks.temp releasenotes-${RELEASE}.txt
${CURRENTDIR}/lptools/lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.tar.bz2 changes.withasterisks.temp releasenotes-${RELEASE}.txt
${CURRENTDIR}/lptools/lp-project-upload mahara ${RELEASE} mahara-${RELEASE}.zip changes.withasterisks.temp releasenotes-${RELEASE}.txt
echo "All done. Once you've checked that the files were uploaded successfully, run this:"
......@@ -332,10 +332,11 @@ file_put_contents($CLEANUPSCRIPT, $cleanup);
chmod($CLEANUPSCRIPT, 0700);
# Clean up
passthru("rm ${VERSIONFILE}.temp");
passthru("rm ${CURRENTDIR}/ChangeLog.temp");
passthru("rm ${CURRENTDIR}/changes.temp");
passthru("rm ${TMP_M4_FILE}");
// Let people clean these up manually. They might be useful for debugging.
// passthru("rm ${VERSIONFILE}.temp");
// passthru("rm ${CURRENTDIR}/ChangeLog.temp");
// passthru("rm ${CURRENTDIR}/changes.temp");
// passthru("rm ${TMP_M4_FILE}");
echo "\n\nTarballs, release notes & changelog for Launchpad:\n\n";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment