summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-10-08 19:00:06 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-10-08 19:00:06 +0200
commitdf6c03ef6b8e5ccda7e9c42c99fc4e71bb5a23d5 (patch)
tree7998f9114bb8f271b21ed9349d6488bfb963c3d5 /include
parent1f92f8a22febba8f100f458f7f91321768a253f8 (diff)
Add on-demand update of remote list. Caution: Not yet 100% tested
Diffstat (limited to 'include')
-rwxr-xr-xinclude/pkglist24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/pkglist b/include/pkglist
index 2af4d4a..f4474ff 100755
--- a/include/pkglist
+++ b/include/pkglist
@@ -1,14 +1,28 @@
#!/usr/bin/env zsh
-cd $1 || exit 100
+# Some backwards-compatibility foobar...
+# XXX: Remove this as soon as everyone should have the new version
+typeset -g -i newmode=0
+[[ -n $PDIR ]] && newmode=1
+(( newmode )) || cd $1 || exit 100
+(( newmode )) && cd /${(j:/:)${(s:/:)0}[1,-4]}
-rm -f .list
+(( newmode )) || rm -f .list
for i in *(/,@); {
if [[ -d $i/.git ]] {
- echo -n "$i git " >> .list
- git --git-dir=$i/.git log | fgrep commit | head -n 1 | cut -d ' ' -f 2 >> .list
+ if (( newmode )) {
+ echo -n "$i git "
+ git --git-dir=$i/.git log | fgrep commit | head -n 1 | cut -d ' ' -f 2
+ } else {
+ echo -n "$i git " >> .list
+ git --git-dir=$i/.git log | fgrep commit | head -n 1 | cut -d ' ' -f 2 >> .list
+ }
} else {
- echo "Unsupported package: $i" >&2
+ echo "$i: Unsupported or no repository" >&2
}
}
+
+if (( newmode == 0 )) {
+ echo "Running pkglist manually or via cron is no longer neccessary and therefore depracated" >&2
+}