From patchwork Thu Jul 26 09:34:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keng-Yu Lin X-Patchwork-Id: 173382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 39D2F2C0091 for ; Thu, 26 Jul 2012 19:35:26 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SuKTd-0005J3-0F for incoming@patchwork.ozlabs.org; Thu, 26 Jul 2012 09:35:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SuKTa-0005Ih-Qh for fwts-devel@lists.ubuntu.com; Thu, 26 Jul 2012 09:35:22 +0000 Received: from [210.242.151.101] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SuKTZ-0005hy-UR; Thu, 26 Jul 2012 09:35:22 +0000 From: Keng-Yu Lin To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/6] auto-packager: Add mktar.sh to make the release tarball Date: Thu, 26 Jul 2012 17:34:57 +0800 Message-Id: <1343295300-17440-4-git-send-email-kengyu@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343295300-17440-1-git-send-email-kengyu@canonical.com> References: <1343295300-17440-1-git-send-email-kengyu@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com The script makes the tarball for release and generate the checksum. Signed-off-by: Keng-Yu Lin Acked-by: Colin Ian King Acked-by: Ivan Hu --- 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