summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/exec-install.sh6
-rwxr-xr-xscripts/format.sh2
-rwxr-xr-xscripts/link.sh5
-rwxr-xr-xscripts/lint.sh5
-rwxr-xr-xscripts/locale_install.sh3
-rwxr-xr-xscripts/safe-install.sh12
6 files changed, 25 insertions, 8 deletions
diff --git a/scripts/exec-install.sh b/scripts/exec-install.sh
index 3b9375af3834..8180b29c9997 100755
--- a/scripts/exec-install.sh
+++ b/scripts/exec-install.sh
@@ -60,6 +60,12 @@ fi
# If it's a symlink, create an equivalent in the install directory.
for exe in $bindir/*; do
+ # Skip any directories in case the bin/ directory is also used as the
+ # prefix.
+ if [ -d "$exe" ]; then
+ continue
+ fi
+
base=$(basename "$exe")
if [ -L "$exe" ]; then
diff --git a/scripts/format.sh b/scripts/format.sh
index efb90ef1f328..dd227555b0fe 100755
--- a/scripts/format.sh
+++ b/scripts/format.sh
@@ -29,6 +29,8 @@
scriptdir=$(dirname "$0")
+. "$scriptdir/functions.sh"
+
cd "$scriptdir/.."
if [ "$#" -gt 0 ]; then
diff --git a/scripts/link.sh b/scripts/link.sh
index 4a472828f3e9..7d95f866e17b 100755
--- a/scripts/link.sh
+++ b/scripts/link.sh
@@ -32,6 +32,11 @@ usage() {
exit 1
}
+script="$0"
+scriptdir=$(dirname "$script")
+
+. "$scriptdir/functions.sh"
+
# Command-line processing.
test "$#" -gt 1 || usage
diff --git a/scripts/lint.sh b/scripts/lint.sh
index 78260dff2daa..5a217204f8f5 100755
--- a/scripts/lint.sh
+++ b/scripts/lint.sh
@@ -27,7 +27,10 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-scriptdir=$(dirname "$0")
+script="$0"
+scriptdir=$(dirname "$script")
+
+. "$scriptdir/functions.sh"
cd "$scriptdir/.."
diff --git a/scripts/locale_install.sh b/scripts/locale_install.sh
index 75534a735cdb..3816f54ef495 100755
--- a/scripts/locale_install.sh
+++ b/scripts/locale_install.sh
@@ -184,11 +184,12 @@ all_locales=0
while getopts "l" opt; do
case "$opt" in
- l) all_locales=1 ; shift ;;
+ l) all_locales=1 ;;
?) usage "Invalid option: $opt" ;;
esac
done
+shift $(($OPTIND - 1))
test "$#" -ge 2 || usage "Must have at least two arguments"
diff --git a/scripts/safe-install.sh b/scripts/safe-install.sh
index 041088386682..5774a17e20de 100755
--- a/scripts/safe-install.sh
+++ b/scripts/safe-install.sh
@@ -41,7 +41,7 @@ set -e
if test "$mkdirp" ; then
umask 022
-case "$2" in
+case "$dst" in
*/*) mkdir -p "${dst%/*}" ;;
esac
fi
@@ -51,15 +51,15 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
umask 077
if test "$symlink" ; then
-ln -s "$1" "$tmp"
+ln -s "$src" "$tmp"
else
-cat < "$1" > "$tmp"
+cat < "$src" > "$tmp"
chmod "$mode" "$tmp"
fi
-mv -f "$tmp" "$2"
-test -d "$2" && {
-rm -f "$2/$tmp"
+mv -f "$tmp" "$dst"
+test -d "$dst" && {
+rm -f "$dst/$tmp"
printf "%s: %s is a directory\n" "$0" "$dst" 1>&2
exit 1
}