aboutsummaryrefslogtreecommitdiff
path: root/debian/roll-tarballs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debian/roll-tarballs.sh')
-rwxr-xr-xdebian/roll-tarballs.sh56
1 files changed, 28 insertions, 28 deletions
diff --git a/debian/roll-tarballs.sh b/debian/roll-tarballs.sh
index c7cac5f08..954986b5f 100755
--- a/debian/roll-tarballs.sh
+++ b/debian/roll-tarballs.sh
@@ -33,33 +33,33 @@ usage() {
PROJECT="nx-libs"
NULL=""
-test -d .git || usage
+test -d ".git" || usage
RELEASE="$1"
test -n "${RELEASE}" || usage
CHECKOUT="$2"
test -n "$CHECKOUT" || usage
-if [ "x$CHECKOUT" = "xserver" ] || [ "x$CHECKOUT" = "xfull" ]; then
- MODE="full"
- CHECKOUT="redist-server/${RELEASE}"
- RELEASE_SUFFIX='-full'
-elif [ "x$CHECKOUT" = "xclient" ] || [ "x$CHECKOUT" = "xlite" ]; then
- MODE="lite"
- CHECKOUT="redist-client/${RELEASE}"
- RELEASE_SUFFIX='-lite'
+if [ "x$CHECKOUT" = "xserver" ] || [ "x${CHECKOUT}" = "xfull" ]; then
+ MODE="full"
+ CHECKOUT="redist-server/${RELEASE}"
+ RELEASE_SUFFIX='-full'
+elif [ "x$CHECKOUT" = "xclient" ] || [ "x${CHECKOUT}" = "xlite" ]; then
+ MODE="lite"
+ CHECKOUT="redist-client/${RELEASE}"
+ RELEASE_SUFFIX='-lite'
else
- usage
+ usage
fi
if [ x"$RELEASE" == "xHEAD" ]; then
- CHECKOUT=HEAD
+ CHECKOUT="HEAD"
fi
if ! git rev-parse --verify -q "$CHECKOUT" >/dev/null; then
- echo " '${RELEASE}' is not a valid release number because there is no git tag named $CHECKOUT."
+ echo " '${RELEASE}' is not a valid release number because there is no git tag named ${CHECKOUT}."
echo " Please specify one of the following releases:"
echo "HEAD"
- git tag -l | grep ^redist | cut -f2 -d/ | sort -u
+ git tag -l | grep "^redist" | cut -f2 -d"/" | sort -u
exit 1
fi
@@ -71,42 +71,42 @@ TEMP_DIR="$(mktemp -d)"
trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0
# create local copy of Git project at temp location
-git archive --format=tar ${CHECKOUT} --prefix=${PROJECT}-${RELEASE}/ | ( cd $TEMP_DIR; tar xf - )
+git archive --format=tar "${CHECKOUT}" --prefix="${PROJECT}-${RELEASE}/" | ( cd "$TEMP_DIR"; tar xf - )
echo "Created tarball for $CHECKOUT"
-cd "$TEMP_DIR/${PROJECT}-${RELEASE}/"
+cd "${TEMP_DIR}/${PROJECT}-${RELEASE}/"
-mkdir -p doc/applied-patches
+mkdir -p "doc/applied-patches"
# prepare patches for lite and full tarball
if [ "x$MODE" = "xfull" ]; then
- cat debian/patches/series | sort | grep -v ^# | egrep "([0-9]+_.*\.(full|full\+lite)\.patch)" | while read file
+ cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+_.*\.(full|full\+lite)\.patch)" | while read file
do
- cp -v debian/patches/$file doc/applied-patches
- echo ${file##*/} >> doc/applied-patches/series
+ cp -v "debian/patches/$file" "doc/applied-patches/"
+ echo "${file##*/}" >> "doc/applied-patches/series"
done
else
rm -Rf "nxcompshad"*
rm -Rf "nxcompext"*
rm -Rf "nx-X11"*
- cat debian/patches/series | sort | grep -v ^# | egrep "([0-9]+_.*\.full\+lite\.patch)" | while read file
+ cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+_.*\.full\+lite\.patch)" | while read file
do
- cp -v debian/patches/$file doc/applied-patches
- echo ${file##*/} >> doc/applied-patches/series
+ cp -v "debian/patches/$file" "doc/applied-patches/"
+ echo "${file##*/}" >> "doc/applied-patches/series"
done
fi
# apply all patches shipped in debian/patches and create a copy of them that we ship with the tarball
if [ -s "doc/applied-patches/series" ]; then
- QUILT_PATCHES=doc/applied-patches quilt --quiltrc /dev/null push -a -q
+ QUILT_PATCHES="doc/applied-patches" quilt --quiltrc /dev/null push -a -q
else
echo "No patches applied at all. Very old release?"
fi
# very old release did not add any README
for f in $(ls README* 2>/dev/null); do
- mv -v $f doc/;
+ mv -v "$f" "doc/";
done
# remove folders that we do not want to roll into the tarball
@@ -116,15 +116,15 @@ rm -Rf "debian/"
# remove files, that we do not want in the tarballs (build cruft)
rm -Rf nx*/configure nx*/autom4te.cache*
-cd $OLDPWD
+cd "$OLDPWD"
# create target location for tarball
-mkdir -p "$TARGETDIR/_releases_/source/${PROJECT}/"
+mkdir -p "${TARGETDIR}/_releases_/source/${PROJECT}/"
# roll the ball...
cd "$TEMP_DIR"
find "${PROJECT}-${RELEASE}" -type f | sort > "$MANIFEST"
-cd $OLDPWD
+cd "$OLDPWD"
tar c -C "$TEMP_DIR" \
--owner 0 \
@@ -133,6 +133,6 @@ tar c -C "$TEMP_DIR" \
--no-recursion \
--files-from "$MANIFEST" \
--gzip \
- > "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}-${RELEASE}${RELEASE_SUFFIX}.tar.gz" \
+ > "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}-${RELEASE}${RELEASE_SUFFIX}.tar.gz"
echo "$TARGETDIR/_releases_/source/${PROJECT}/${PROJECT}-${RELEASE}${RELEASE_SUFFIX}.tar.gz is ready"