[PATCH 3/6] auto-packager: Add mktar.sh to make the release tarball
Keng-Yu Lin
kengyu at canonical.com
Thu Jul 26 09:34:57 UTC 2012
The script makes the tarball for release and generate the checksum.
Signed-off-by: Keng-Yu Lin <kengyu at canonical.com>
---
auto-packager/mktar.sh | 100 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100755 auto-packager/mktar.sh
diff --git a/auto-packager/mktar.sh b/auto-packager/mktar.sh
new file mode 100755
index 0000000..364ab12
--- /dev/null
+++ b/auto-packager/mktar.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2010-2012 Canonical
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+
+#
+# Get fwts sources, strip out .git directory, add in necessary debian packaging
+# files, build source package ready for upload.
+#
+REPO=git://kernel.ubuntu.com/hwe/fwts.git
+FWTS=fwts
+
+#
+# Clone the repo
+#
+get_source()
+{
+ echo "Getting source"
+ pushd "$version" >& /dev/null
+ git clone $REPO
+ popd >& /dev/null
+}
+
+#
+# Checkout version
+#
+checkout_version()
+{
+ echo "Checking out version"
+ pushd "$version/$FWTS" >& /dev/null
+ git checkout -b latest $version
+ popd >& /dev/null
+}
+
+#
+# Remove the source
+#
+rm_source()
+{
+ rm -rf "$version/$FWTS"
+}
+
+#
+# Create source package ready for upload and build
+#
+mk_tarball()
+{
+ pushd "$version/$FWTS" >& /dev/null
+ git archive --format tar -o ../fwts-$version.tar $version
+ gzip ../fwts-$version.tar
+ popd >& /dev/null
+}
+
+#
+# Create checksums
+#
+
+mk_checksums()
+{
+ pushd "$version" >& /dev/null
+ sha256sum fwts-$version.tar.gz >> SHA256SUMS
+ popd >& /dev/null
+}
+
+#
+# Here we go..
+#
+if [ $# -eq 1 ]; then
+ version=$1
+ mkdir $version
+else
+ echo "Please specify a version"
+ exit
+fi
+
+rm_source
+get_source
+
+checkout_version
+
+mk_tarball
+mk_checksums
+
+rm_source
--
1.7.9.5
More information about the fwts-devel
mailing list