summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2011-10-07 21:59:39 +0200
committerJustin Davis <jrcd83@gmail.com>2011-10-07 21:59:39 +0200
commitedebea3bc55bed55522c5c5d419e9d80831d912a (patch)
treeb1e63cb4b7a57e344fcc3c2a5c8a7633ef6ce21c
parent2fe258beb84c7e19e15af0818b1e9d84ca7e8f9b (diff)
downloadgenpkg-edebea3bc55bed55522c5c5d419e9d80831d912a.tar.gz
genpkg-edebea3bc55bed55522c5c5d419e9d80831d912a.tar.xz
Tweak style in pushpkgs. Use sed for prepending $Id$.
-rwxr-xr-xpushpkgs21
1 files changed, 15 insertions, 6 deletions
diff --git a/pushpkgs b/pushpkgs
index 3463c67..b44c1d4 100755
--- a/pushpkgs
+++ b/pushpkgs
@@ -2,8 +2,13 @@
prependid()
{
- awk '!/^#/ && ! done { print "# $Id$"; done = 1 } 1' PKGBUILD \
- > PKGBUILD.new
+ sed -e '/^#/!{
+ i\
+\# $Id$
+ :loop
+ n
+ b loop
+ }' PKGBUILD >PKGBUILD.new
mv PKGBUILD.new PKGBUILD
}
@@ -16,7 +21,8 @@ syncsvn()
}
-if [ -z "$DEST" ] ; then
+if [ -z "$DEST" ]
+then
echo "Specify the destination directory with the DEST env var." 1>&2
exit 1
fi
@@ -24,15 +30,18 @@ fi
cd pkg || exit 1
pkgdir=$(pwd)
-while [ $# -gt 0 ] ; do
+while [ $# -gt 0 ]
+do
pkg=$1 ; shift
- if [ ! -d "$pkg" ] ; then
+ if [ ! -d "$pkg" ]
+ then
echo "pkg/$pkg was not found." 1>&2
continue
fi
echo "$DEST/$pkg"
- if [ -d "$DEST/$pkg" ] ; then
+ if [ -d "$DEST/$pkg" ]
+ then
rm -rf "$DEST/$pkg/trunk/"*
fi