aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/lib/src/util/mkks.sh4
-rwxr-xr-xnx-X11/x-indent-all.sh2
-rwxr-xr-xnx-X11/x-indent.sh2
-rwxr-xr-xregenerate-symbol-docs.sh20
-rw-r--r--replace.sh2
-rwxr-xr-xroll-tarballs.sh20
-rwxr-xr-xversion.sh2
7 files changed, 27 insertions, 25 deletions
diff --git a/nx-X11/lib/src/util/mkks.sh b/nx-X11/lib/src/util/mkks.sh
index ab5ca80c9..7af0e51ab 100644
--- a/nx-X11/lib/src/util/mkks.sh
+++ b/nx-X11/lib/src/util/mkks.sh
@@ -1,10 +1,10 @@
#!/bin/sh
-cat $* | awk 'BEGIN { \
+awk 'BEGIN { \
printf "/*\n * This file is generated from %s. Do not edit.\n */\n", \
"$(INCLUDESRC)/keysymdef.h";\
} \
/^#define/ { \
len = length($2)-3; \
printf("{ \"%s\", %s },\n", substr($2,4,len), $3); \
-}'
+}' "$@"
diff --git a/nx-X11/x-indent-all.sh b/nx-X11/x-indent-all.sh
index 6addaf400..d3c4113de 100755
--- a/nx-X11/x-indent-all.sh
+++ b/nx-X11/x-indent-all.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-where=`dirname $0`
+where=$(dirname $0)
git ls-files | grep '\.[chm]$' | xargs sh "$where"/x-indent.sh
diff --git a/nx-X11/x-indent.sh b/nx-X11/x-indent.sh
index e662cce09..327aa6a4f 100755
--- a/nx-X11/x-indent.sh
+++ b/nx-X11/x-indent.sh
@@ -2,7 +2,7 @@
# We want GNU indent, so first search for gindent to avoid /usr/bin/indent
# on the BSDs, which won't work for us
-INDENT=`which gnuindent || which gindent || which indent`
+INDENT=$(which gnuindent || which gindent || which indent)
if [ -z "${INDENT}" ] ; then
echo "Could not find indent, sorry..." >&2
diff --git a/regenerate-symbol-docs.sh b/regenerate-symbol-docs.sh
index 20322247f..05548bdb0 100755
--- a/regenerate-symbol-docs.sh
+++ b/regenerate-symbol-docs.sh
@@ -24,11 +24,11 @@ SYMBOLS_FILE="doc/libNX_X11/symbols/libNX_X11::symbols.txt"
DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_internally.txt"
echo "Scanning for libNX_X11 symbols: in libNX_X11 internally: $DOC_FILE"
cd nx-X11/lib/X11/
-cat "../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do
+grep -v -E "^#" "../../../$SYMBOLS_FILE" | while read -r symbol; do
echo
echo "#### $symbol ####"
- grep -n $symbol *.{c,h} 2>/dev/null
+ grep -n "$symbol" *.{c,h} 2>/dev/null
done > "../../../$DOC_FILE"
cd - 1>/dev/null
@@ -36,11 +36,11 @@ cd - 1>/dev/null
DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxagent.txt"
echo "Scanning for libNX_X11 symbols: in hw/nxagent: $DOC_FILE"
cd nx-X11/programs/Xserver/hw/nxagent/
-cat "../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do
+grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do
echo
echo "#### $symbol ####"
- grep -n $symbol *.{c,h} 2>/dev/null
+ grep -n "$symbol" *.{c,h} 2>/dev/null
done > "../../../../../$DOC_FILE"
cd - 1>/dev/null
@@ -48,11 +48,11 @@ cd - 1>/dev/null
DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxcompext.txt"
echo "Scanning for libNX_X11 symbols: in hw/nxagent/compext: $DOC_FILE"
cd nx-X11/programs/Xserver/hw/nxagent/compext/
-cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do
+grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do
echo
echo "#### $symbol ####"
- grep -n $symbol *.{c,h} 2>/dev/null
+ grep -n "$symbol" *.{c,h} 2>/dev/null
done > "../../../../../../$DOC_FILE"
cd - 1>/dev/null
@@ -65,11 +65,11 @@ SYMBOLS_FILE="doc/nxcompext/symbols/nxcompext::symbols.txt"
DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_internally.txt"
echo "Scanning for nxcompext symbols: in hw/nxagent/compext internally: $DOC_FILE"
cd nx-X11/programs/Xserver/hw/nxagent/compext/
-cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do
+grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do
echo
echo "#### $symbol ####"
- grep -n $symbol *.{c,h} 2>/dev/null
+ grep -n "$symbol" *.{c,h} 2>/dev/null
done > "../../../../../../$DOC_FILE"
cd - 1>/dev/null
@@ -77,11 +77,11 @@ cd - 1>/dev/null
DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_nxagent.txt"
echo "Scanning for nxcompext symbols: in hw/nxagent: $DOC_FILE"
cd nx-X11/programs/Xserver/hw/nxagent/
-cat ../../../../../$SYMBOLS_FILE | grep -v -E "^#" | while read symbol; do
+grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do
echo
echo "#### $symbol ####"
- grep -n $symbol *.{c,h} 2>/dev/null
+ grep -n "$symbol" *.{c,h} 2>/dev/null
done > "../../../../../$DOC_FILE"
cd - 1>/dev/null
diff --git a/replace.sh b/replace.sh
index c2b187fda..28ce65aa4 100644
--- a/replace.sh
+++ b/replace.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Copyright (C) 2013 Jan Engelhardt <jengelh@inai.de>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/roll-tarballs.sh b/roll-tarballs.sh
index dc30a8a17..c9af13102 100755
--- a/roll-tarballs.sh
+++ b/roll-tarballs.sh
@@ -31,7 +31,6 @@ usage() {
}
PROJECT="nx-libs"
-NULL=""
test -d ".git" || usage
RELEASE="$1"
@@ -59,7 +58,7 @@ 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 " Please specify one of the following releases:"
- echo "HEAD (on branch `git rev-parse --abbrev-ref HEAD`)"
+ echo "HEAD (on branch $(git rev-parse --abbrev-ref HEAD))"
git tag -l | grep "^redist" | cut -f2 -d"/" | sort -u
exit 1
fi
@@ -81,7 +80,7 @@ cd "${TEMP_DIR}/${PROJECT}-${RELEASE}/"
# Replace symlinks by copies of the linked target files
# Note: We don't have symlinked directories!!!
-find . -type "l" | while read link; do
+find . -type "l" | while read -r link; do
TARGET="$(readlink "${link}")"
pushd "$(dirname "${link}")" >/dev/null
if [ -f "${TARGET}" ]; then
@@ -156,12 +155,12 @@ if [ "x$MODE" = "xfull" ]; then
rm -f "nx-X11/extras/Mesa/src/mesa/main/"*.py
rm -f "nx-X11/extras/Mesa/src/mesa/main/"{mesa.def,Imakefile,vsnprintf.c}
- find nx-X11/extras/Mesa/ -name Makefile | while read file; do rm "$file"; done
- find nx-X11/extras/Mesa/ -name Makefile.* | while read file; do rm "$file"; done
- find nx-X11/extras/Mesa/ -name descrip.mms | while read file; do rm "$file"; done
+ find nx-X11/extras/Mesa/ -name Makefile | while read -r file; do rm "$file"; done
+ find nx-X11/extras/Mesa/ -name 'Makefile.*' | while read -r file; do rm "$file"; done
+ find nx-X11/extras/Mesa/ -name descrip.mms | while read -r file; do rm "$file"; done
# this is for 3.5.0.x only...
- cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read file
+ sort "debian/patches/series" | grep -v '^#' | grep -E "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file
do
cp -v "debian/patches/$file" "doc/applied-patches/"
echo "${file##*/}" >> "doc/applied-patches/series"
@@ -198,7 +197,7 @@ else
mv LICENSE.nxcomp LICENSE
# this is for 3.5.0.x only...
- cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read file
+ sort "debian/patches/series" | grep -v '^#' | grep -E "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file
do
cp -v "debian/patches/$file" "doc/applied-patches/"
echo "${file##*/}" >> "doc/applied-patches/series"
@@ -217,8 +216,9 @@ rm -Rf "debian/"
rm -Rf "nx-libs.spec"
# very old release did not add any README
-for f in $(ls README* 2>/dev/null); do
- mv -v "$f" "doc/";
+for f in README*; do
+ [[ -e "$f" ]] || break # handle the case of no README* files
+ mv -v "$f" "doc/"
done
# remove files, that we do not want in the tarballs (build cruft)
diff --git a/version.sh b/version.sh
index 891536890..f46600c50 100755
--- a/version.sh
+++ b/version.sh
@@ -31,4 +31,4 @@ VER="$(head -n "1" "${VERSION_FILE}" | cut -d"." -f"${COMPONENT}")"
[ "x${VER}" = "x" ] && VER="0"
-printf "${VER}"
+printf "%s" "${VER}"