Rev 3787: (mbp) add lp-upload-release script in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Oct 21 02:26:32 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3787
revision-id: pqm at pqm.ubuntu.com-20081021012629-d2xnxqmr42xrtiy2
parent: pqm at pqm.ubuntu.com-20081020020359-7f8c4hviijt1m5vq
parent: mbp at sourcefrog.net-20081021004957-hb823jymj6m2nbpw
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-10-21 02:26:29 +0100
message:
  (mbp) add lp-upload-release script
added:
  tools/packaging/lp-upload-release lpuploadrelease-20081020075647-56zdf9z6yav1bx81-1
modified:
  Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
  doc/developers/releasing.txt   releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
    ------------------------------------------------------------
    revno: 3778.3.5
    revision-id: mbp at sourcefrog.net-20081021004957-hb823jymj6m2nbpw
    parent: mbp at sourcefrog.net-20081020235812-itg90mk0u4dez92z
    parent: pqm at pqm.ubuntu.com-20081020020359-7f8c4hviijt1m5vq
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: release-scripts
    timestamp: Tue 2008-10-21 11:49:57 +1100
    message:
      merge trunk
    added:
      doc/developers/cycle.txt       cycle.txt-20081017031739-rw24r0cywm2ok3xu-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/patches.py              patches.py-20050727183609-378c1cc5972ce908
      bzrlib/plugins/launchpad/account.py account.py-20071011033320-50y6vfftywf4yllw-1
      bzrlib/plugins/launchpad/lp_directory.py lp_indirect.py-20070126012204-de5rugwlt22c7u7e-1
      bzrlib/plugins/launchpad/test_account.py test_account.py-20071011033320-50y6vfftywf4yllw-2
      bzrlib/plugins/launchpad/test_lp_directory.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
      bzrlib/tests/test_patches.py   test_patches.py-20051231203844-f4974d20f6aea09c
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
      doc/developers/index.txt       index.txt-20070508041241-qznziunkg0nffhiw-1
      doc/developers/releasing.txt   releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
    ------------------------------------------------------------
    revno: 3778.3.4
    revision-id: mbp at sourcefrog.net-20081020235812-itg90mk0u4dez92z
    parent: mbp at sourcefrog.net-20081020080933-xba7zw9ffozm6brl
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: release-scripts
    timestamp: Tue 2008-10-21 10:58:12 +1100
    message:
      lp-upload-release now handles names like bzr-1.8.tar.gz
    modified:
      tools/packaging/lp-upload-release lpuploadrelease-20081020075647-56zdf9z6yav1bx81-1
    ------------------------------------------------------------
    revno: 3778.3.3
    revision-id: mbp at sourcefrog.net-20081020080933-xba7zw9ffozm6brl
    parent: mbp at sourcefrog.net-20081020075805-txtgvuxddmnnf0vz
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: release-scripts
    timestamp: Mon 2008-10-20 19:09:33 +1100
    message:
      Build zip file from 'make dist' and document this; also tweak standard announcement mail
    modified:
      Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
      doc/developers/releasing.txt   releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
    ------------------------------------------------------------
    revno: 3778.3.2
    revision-id: mbp at sourcefrog.net-20081020075805-txtgvuxddmnnf0vz
    parent: mbp at sourcefrog.net-20081020075705-fervpy1m4xbcjg4y
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: release-scripts
    timestamp: Mon 2008-10-20 18:58:05 +1100
    message:
      Doc lp-upload-release
    modified:
      doc/developers/releasing.txt   releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
    ------------------------------------------------------------
    revno: 3778.3.1
    revision-id: mbp at sourcefrog.net-20081020075705-fervpy1m4xbcjg4y
    parent: pqm at pqm.ubuntu.com-20081015214444-ztwoizx180edy73v
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: release-scripts
    timestamp: Mon 2008-10-20 18:57:05 +1100
    message:
      Add a script to upload a download file to Ubuntu
    added:
      tools/packaging/lp-upload-release lpuploadrelease-20081020075647-56zdf9z6yav1bx81-1
=== modified file 'Makefile'
--- a/Makefile	2008-08-28 07:11:13 +0000
+++ b/Makefile	2008-10-20 08:09:33 +0000
@@ -209,25 +209,25 @@
 
 .PHONY: dist dist-upload-escudero check-dist-tarball
 
-# build a distribution tarball.
+# build a distribution tarball and zip file.
 #
 # this method of copying the pyrex generated files is a bit ugly; it would be
 # nicer to generate it from distutils.
-#
-# these are a bit ubuntu-specific.
 dist: 
 	version=`./bzr version --short` && \
 	echo Building distribution of bzr $$version && \
 	expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
 	expdir=$$expbasedir/bzr-$$version && \
 	tarball=$$PWD/../bzr-$$version.tar.gz && \
+	zipball=$$PWD/../bzr-$$version.zip && \
 	$(MAKE) clean && \
 	$(MAKE) && \
 	bzr export $$expdir && \
 	cp bzrlib/*.c $$expdir/bzrlib/. && \
 	tar cfz $$tarball -C $$expbasedir bzr-$$version && \
+	(cd $$expbasedir && zip -r $$zipball bzr-$$version) && \
 	gpg --detach-sign $$tarball && \
-	echo $$tarball done. && \
+	gpg --detach-sign $$zipball && \
 	rm -rf $$expbasedir
 
 # run all tests in a previously built tarball
@@ -245,10 +245,15 @@
 dist-upload-escudero:
 	version=`./bzr version --short` && \
 	tarball=../bzr-$$version.tar.gz && \
-	scp $$tarball $$tarball.sig \
+	zipball=../bzr-$$version.zip && \
+	scp $$zipball $$zipball.sig $$tarball $$tarball.sig \
 	    escudero.ubuntu.com:/srv/bazaar.canonical.com/www/releases/src \
 		&& \
 	echo verifying over http... && \
+	curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip \
+		| diff -s - $$zipball && \
+	curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip.sig \
+		| diff -s - $$zipball.sig 
 	curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz \
 		| diff -s - $$tarball && \
 	curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz.sig \

=== modified file 'doc/developers/releasing.txt'
--- a/doc/developers/releasing.txt	2008-10-17 21:44:24 +0000
+++ b/doc/developers/releasing.txt	2008-10-21 00:49:57 +0000
@@ -91,6 +91,9 @@
   
      make dist
 
+   This also makes a zip file, which is easier to access on Microsoft
+   Windows.
+
 #. Now we'll try expanding this tarball and running the test suite
    to check for packaging problems::
  
@@ -107,7 +110,9 @@
    series, to take you to e.g. <https://launchpad.net/bzr/1.1>.  Then
    click "Register a release", and add information about this release.
 
-#. Within that release, upload the source tarball and the GPG signature.
+#. Within that release, upload the source tarball and zipfile and the GPG
+   signature.  Or, if you prefer, use the
+   ``tools/packaging/lp-upload-release`` script to do this.
 
 #. Link from http://bazaar-vcs.org/Download to the tarball and signature.
 

=== added file 'tools/packaging/lp-upload-release'
--- a/tools/packaging/lp-upload-release	1970-01-01 00:00:00 +0000
+++ b/tools/packaging/lp-upload-release	2008-10-20 23:58:12 +0000
@@ -0,0 +1,82 @@
+#! /bin/zsh -e
+
+# upload a release file to Launchpad 
+#
+# usage: lp-upload-release [--staging] bzr-1.2.3.tgz
+
+setopt extended_glob
+
+if [ "$1" = "--staging" ]
+then
+	shift
+	server="staging.launchpad.net"
+else
+	server="launchpad.net"
+fi
+
+if [ $# -ne 1 ]
+then
+	echo "usage: lp-upload-release VERSION FILENAME"
+	exit 2
+fi
+
+if [ -z "$EMAIL" ]
+then
+	echo "please set $EMAIL to an address registered with Launchpad"
+	exit 2
+fi
+
+upfile="$1"
+if [ \! -f "$1" ]
+then
+	echo "$upfile is not a file"
+	exit 2
+fi
+
+sigfile="$upfile.sig"
+if [ \! -f "$sigfile" ]
+then
+	echo "couldn't find gpg signature $sigfile"
+	exit 2
+fi
+
+# just in case
+gpg $sigfile
+
+# parse the product and release number out of a filename like
+# "bzr-foo-1.23rc1.tar.gz"
+
+# need to strip off the .tar too for .tar.gz files
+headpart=${${upfile:r}%.tar}
+filetype="${upfile#${headpart}}"
+basename="${${headpart:t}%%-[0-9].*}"
+version="${${headpart:t}##*-}"
+echo $basename $version $filetype
+
+# bzr puts just the first part of the version into the series, e.g. 1.8 from 1.8rc1
+series=${version%(rc|beta|alpha)*}
+
+for v in basename version filetype series
+do
+	echo "$v=${(P)v}"
+done
+
+curl -u "$EMAIL" \
+	https://$server/$basename/$series/$version/+adddownloadfile \
+ 	-F field.description="$basename $version source" \
+ 	-F field.filecontent="@${upfile}" \
+ 	-F field.contenttype=CODETARBALL \
+ 	-F field.actions.add=Upload
+
+reported_md5=$( curl https://$server/$basename/$series/$version/+download/$filetail/+md5 )
+expected_md5="$(md5sum "$upfile")"
+expected_md5=${${(z)expected_md5}[1]}
+
+for v in reported_md5 expected_md5
+do
+	echo "$v=${(P)v}"
+done
+
+[ $reported_md5 = $expected_md5 ]
+
+# vim: sw=4




More information about the bazaar-commits mailing list