From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw0-f49.google.com ([209.85.213.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RT9HD-0006wo-6w for linux-mtd@lists.infradead.org; Wed, 23 Nov 2011 09:37:59 +0000 Received: by ywa12 with SMTP id 12so1365250ywa.36 for ; Wed, 23 Nov 2011 01:37:58 -0800 (PST) Subject: Re: [PATCH 0/2] small mtd-utils fixes From: Artem Bityutskiy To: Mike Frysinger Date: Wed, 23 Nov 2011 11:38:38 +0200 In-Reply-To: References: <1321473837-27891-1-git-send-email-computersforpeace@gmail.com> <1321568352.2272.33.camel@koala> <1321653636.2141.0.camel@koala> <87k46xrqyr.fsf@macbook.be.48ers.dk> <1321735668.2167.2.camel@koala> <1321743864.2167.6.camel@koala> <1321790131.15493.85.camel@shinybook.infradead.org> <1321794503.2170.3.camel@koala> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-0phEGU0evioO3UeSUC5u" Message-ID: <1322041124.24797.269.camel@sauron.fi.intel.com> Mime-Version: 1.0 Cc: Brian Norris , David Woodhouse , linux-mtd@lists.infradead.org, Kevin Cernekee Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --=-0phEGU0evioO3UeSUC5u Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, updated the script as you suggested. Did not do the "outdir should be optional" part because it is not needed now - we can do this later if we want. #!/bin/sh -uef # A small helper script to release mtd-utils. Takes the new version # as a parameter. fatal() { printf "Error: %s\n" "$1" >&2 exit 1 } usage() { cat < - mtd utils version to create in X.Y.Z format - the output directory where to store the tarball with the gpg signature EOF exit 0 } [ $# -eq 0 ] && usage [ $# -eq 2 ] || fatal "Insufficient or too many argumetns" new_ver=3D"$1"; shift outdir=3D"$1"; shift release_name=3D"mtd-utils-$new_ver" tag_name=3D"v$new_ver" # Make sure the input is sane and the makefile contains sensible version echo "$new_ver" | egrep -q -x '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' || fatal "please, provide new version in X.Y.Z format" egrep -q -x 'VERSION =3D [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' Makefile= || fatal "Makefile does not contain \"Version =3D X.Y.Z\" line" # Make sure the git index is up-to-date [ -z "$(git status --porcelain)" ] || fatal "Git index is not up-to-date" # Make sure the tag does not exist [ -z "$(git tag -l "$tag_name")" ] || fatal "Tag $tag_name already exists" # Change the version in the Makefile sed -i -e "s/^VERSION =3D [[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/VERSI= ON =3D $new_ver/" Makefile # And commit the change git commit -s -m "Release $release_name" Makefile # Create new signed tag echo "Signing tag $tag_name" git tag -m "$release_name" -s "$tag_name" # Prepare signed tarball git archive --format=3Dtar --prefix=3D"$release_name/" "$tag_name" | \ bzip2 > "$outdir/$release_name.tar.bz2" echo "Signing the tarball" gpg -o "$outdir/$release_name.tar.bz2.asc" --detach-sign -a "$outdir/$relea= se_name.tar.bz2" cat <