summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-04-14 21:32:06 +0200
committerTomas Chvatal <scarabeus@gentoo.org>2009-04-14 21:32:12 +0200
commit33e3f5409d62e7897a718e5cca92b3ff278c6710 (patch)
treeeffa52cc2669999d6a1d0647d560f3fa330b2731
parentd3d6ebad00db9ddafc4f2ee1d6bfe611625d29bc (diff)
Update scripts to work from scripts folder same as from / dir
-rwxr-xr-xscripts/clean.sh24
-rwxr-xr-xscripts/generate_gettext_pot.sh3
-rwxr-xr-xscripts/kr.sh2
3 files changed, 17 insertions, 12 deletions
diff --git a/scripts/clean.sh b/scripts/clean.sh
index 6304b57..461b226 100755
--- a/scripts/clean.sh
+++ b/scripts/clean.sh
@@ -1,29 +1,31 @@
#!/usr/bin/env bash
-
+PWD=$(pwd)
+[[ ${PWD/*\//} = scripts ]] && pushd .. > /dev/null || pushd . > /dev/null
# remove compiled files
[ -e "[Mm]akefile" ] && make clean
# remove folders
-find ../ -type d -name CMakeFiles -print | xargs -i rm {} -rf
+find ./ -type d -name CMakeFiles -print | xargs -i rm {} -rf
# some people build Tuxanci in speacial folder
-rm -rf ../build
+rm -rf ./build
# remove cmake files
-find ../ \( -type f -name \*.so -print , -type f -name \*.cmake -print , -type f -name CMakeCache.txt -print , -type f -name Makefile -print \) | grep -v "./cmake" | xargs -i rm {} -f
-find ../ \( -type f -name install_manifest.txt -print , -type f -name cmake_install.cmake -print \) | xargs -i rm {} -f
+find ./ \( -type f -name \*.so -print , -type f -name \*.cmake -print , -type f -name CMakeCache.txt -print , -type f -name Makefile -print \) | grep -v "./cmake" | xargs -i rm {} -f
+find ./ \( -type f -name install_manifest.txt -print , -type f -name cmake_install.cmake -print \) | xargs -i rm {} -f
# remove precompiled in files
-find ../ -name \*.in -print | while read r; do rm -f ${r/\.in/}; done
+find ./ -name \*.in -print | while read r; do rm -f ${r/\.in/}; done
# remove compiled binaries
-find ../src -name tuxanci -print | xargs -i rm {} -f
-find ../src -name tuxanci-server -print | xargs -i rm {} -f
+find ./src -name tuxanci -print | xargs -i rm {} -f
+find ./src -name tuxanci-server -print | xargs -i rm {} -f
# remove compiled gettext files
-find ../ -name \*.gmo -print | xargs -i rm {} -f
+find ./ -name \*.gmo -print | xargs -i rm {} -f
# remove temporary backup files
-find ../ -type f -name \*~ -print | xargs -i rm {} -f
+find ./ -type f -name \*~ -print | xargs -i rm {} -f
# remove so libraries
-find ../src/modules -type f -name mod\*.so\* | xargs -i rm {} -f
+find ./src/modules -type f -name mod\*.so\* | xargs -i rm {} -f
+popd >> /dev/null
diff --git a/scripts/generate_gettext_pot.sh b/scripts/generate_gettext_pot.sh
index 8a0ffb8..48c0787 100755
--- a/scripts/generate_gettext_pot.sh
+++ b/scripts/generate_gettext_pot.sh
@@ -1,5 +1,6 @@
#!/bin/bash
-pushd ../ > /dev/null
+PWD=$(pwd)
+[[ ${PWD/*\//} = scripts ]] && pushd .. > /dev/null || pushd . > /dev/null
xgettext --default-domain=tuxanci --add-comments=/// -k_ `find ./ -name \*.c | grep -v .git | tr '\n' ' '` -o ./po/tuxanci.pot
cd po/
find ./ -name \*.po -print | xargs -i msgmerge -U {} tuxanci.pot
diff --git a/scripts/kr.sh b/scripts/kr.sh
index dbc1842..4977efc 100755
--- a/scripts/kr.sh
+++ b/scripts/kr.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+PWD=$(pwd)
+[[ ${PWD/*\//} = scripts ]] && pushd .. > /dev/null || pushd . > /dev/null
if [ ! "$1" ]; then
echo "Help: this script indents code according to the K&R standard"