summaryrefslogtreecommitdiff
path: root/examples/pkglist-sh
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-02-23 15:37:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2012-02-23 15:37:01 +0100
commit7d105f4cec73620dffd437bf87e0cca47152e375 (patch)
tree45f0698318e95acebaab7de69bb64aec012ad1e5 /examples/pkglist-sh
parentbf0b5456245e2c03ccab53ead2a8e2f59a76606b (diff)
pkglist-sh: minor fixes
Diffstat (limited to 'examples/pkglist-sh')
-rwxr-xr-x[-rw-r--r--]examples/pkglist-sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/pkglist-sh b/examples/pkglist-sh
index aa60fba..7fcede3 100644..100755
--- a/examples/pkglist-sh
+++ b/examples/pkglist-sh
@@ -3,30 +3,30 @@
## non-zsh version
## used by ct update remote
-if [ -z ${PKG_PATH} -o -z ${PKG_PROTO} ]; then
+if [ -z "${PKG_PATH}" -o -z "${PKG_PROTO}" ]; then
echo "PKG_PATH and PKG_PROTO must be set while running ${0}" >&2
exit 1
fi
-if [ ! -d ${PKG_PATH} ]; then
+if [ ! -d "${PKG_PATH}" ]; then
echo "${0}: package root directory '${PKG_PATH}' does not exist!" >&2
exit 1
fi
set -e
-cd ${PKG_PATH}
+cd "${PKG_PATH}"
-for dir in $(find . -type d -mindepth 1 -maxdepth 1 ! -name ".?*"); do
+for dir in $(find . -mindepth 1 -maxdepth 1 ! -name ".?*" -type d | sed 's/.\///'); do
# git repo
if [ -d ${dir}/.git ]; then
echo -n "${dir} git "
- echo -n $(git --git-dir=${dir}/.git log -n 1 | cut -d ' ' -f 2)
+ echo -n $(git --git-dir=${dir}/.git log --format="format:%H" -n 1)
echo " ${PKG_PROTO}://${PKG_UAH}/${PKG_PATH}/${dir}/.git"
elif [ -d ${dir}/objects -a -d ${dir}/refs ]; then
# bare git repo
echo -n "${dir} git "
- echo -n $(git --git-dir=${dir} log -n 1 | cut -d ' ' -f 2)
+ echo -n $(git --git-dir=${dir} log --format="format:%H" -n 1)
echo " ${PKG_PROTO}://${PKG_UAH}/${PKG_PATH}/${dir}"
else
# unknown