summaryrefslogtreecommitdiffstats
path: root/php-PhpCollection-strip.sh
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-03-19 17:45:24 +0100
committerRemi Collet <fedora@famillecollet.com>2013-03-19 17:45:24 +0100
commit395f2fc7fc7e4010b46e5b7219d1633b5d251313 (patch)
treef3b9d0296e26586ab96e58445e1a537baa027865 /php-PhpCollection-strip.sh
php-PhpCollection: import from rawhide
Diffstat (limited to 'php-PhpCollection-strip.sh')
-rwxr-xr-xphp-PhpCollection-strip.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/php-PhpCollection-strip.sh b/php-PhpCollection-strip.sh
new file mode 100755
index 0000000..e0a65f5
--- /dev/null
+++ b/php-PhpCollection-strip.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+if [ $# != 2 ]; then
+ echo "Usage: $0 VERSION GITHUB_COMMIT" 1>&2
+ exit 1
+fi
+
+VERSION=$1
+GITHUB_COMMIT=$2
+
+ORIGINAL_SOURCE_FILE="${GITHUB_COMMIT}.tar.gz"
+NEW_SOURCE_FILE="php-PhpCollection-${VERSION}-${GITHUB_COMMIT}.tar.gz"
+
+if [ ! -f "$ORIGINAL_SOURCE_FILE" ]; then
+ echo "ERROR: Original source file '${ORIGINAL_SOURCE_FILE}' not found" 1>&2
+ exit 1
+fi
+
+TAR=`which tar`
+
+$TAR -xzf "$ORIGINAL_SOURCE_FILE"
+rm -rf "php-collection-${GITHUB_COMMIT}/doc" "$NEW_SOURCE_FILE"
+$TAR -czf "$NEW_SOURCE_FILE" "php-collection-${GITHUB_COMMIT}"
+
+echo "${NEW_SOURCE_FILE} created"
+exit 0