linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	Kevin Cernekee <cernekee@gmail.com>
Subject: Re: [PATCH 0/2] small mtd-utils fixes
Date: Wed, 23 Nov 2011 11:38:38 +0200	[thread overview]
Message-ID: <1322041124.24797.269.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <CAMjpGUdsdppTEOuPdWTGGU=ztbyvoF4_=TiZ1RqQ4W1_wFhbkQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2205 bytes --]

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 <<EOF
Usage: ${0##*/} <new_ver> <outdir>

<new_ver>  - mtd utils version to create in X.Y.Z format
<outdir>   - 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="$1"; shift
outdir="$1"; shift

release_name="mtd-utils-$new_ver"
tag_name="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 = [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' Makefile ||
	fatal "Makefile does not contain \"Version = 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 = [[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/VERSION = $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=tar --prefix="$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/$release_name.tar.bz2"

cat <<EOF
Created $outdir/$release_name.tar.bz2
Please, verify, then push the tag and upload the tarball and the signature
You can use these commands:
git push origin $tag_name
scp $outdir/$release_name.tar.bz2 $outdir/$release_name.tar.bz2.asc casper.infradead.org:/var/ftp/pub/mtd-utils
EOF


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2011-11-23  9:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 20:03 [PATCH 0/2] small mtd-utils fixes Brian Norris
2011-11-16 20:03 ` [PATCH 1/2] mtd-utils: add jffs2reader to .gitignore Brian Norris
2011-11-17  5:40   ` Mike Frysinger
2011-11-16 20:03 ` [PATCH 2/2] mtdinfo: provide info when used without arguments Brian Norris
2011-11-17  5:41   ` Mike Frysinger
2011-11-17 22:19 ` [PATCH 0/2] small mtd-utils fixes Artem Bityutskiy
2011-11-17 23:56   ` Brian Norris
2011-11-18 22:00     ` Artem Bityutskiy
2011-11-18 22:44       ` Peter Korsgaard
2011-11-18 23:37         ` Brian Norris
2011-11-19 20:47           ` Artem Bityutskiy
2011-11-19 20:55             ` Mike Frysinger
2011-11-19 23:04               ` Artem Bityutskiy
2011-11-20  8:41                 ` Mike Frysinger
2011-11-20 13:10                   ` Artem Bityutskiy
2011-11-20 11:55                 ` David Woodhouse
2011-11-20 13:08                   ` Artem Bityutskiy
2011-11-21  4:22                     ` Mike Frysinger
2011-11-22 21:38                       ` Artem Bityutskiy
2011-11-22 22:21                         ` Mike Frysinger
2011-11-23  7:45                           ` Artem Bityutskiy
2011-11-24  1:45                             ` Mike Frysinger
2011-11-24  7:26                               ` Artem Bityutskiy
2011-12-05  0:28                                 ` Mike Frysinger
2011-12-07  7:12                                   ` Artem Bityutskiy
2011-11-23  9:38                       ` Artem Bityutskiy [this message]
2011-11-22 22:21                     ` Mike Frysinger
2011-11-23  9:39                       ` Artem Bityutskiy
2011-11-17 22:22 ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322041124.24797.269.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).