summaryrefslogtreecommitdiff
path: root/include/pkglist
blob: f4474ffb8c9c2c66cdcbc75c3327f5a6d04b2dd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env zsh

# 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]}

(( newmode )) || rm -f .list

for i in *(/,@); {
	if [[ -d $i/.git ]] {
		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 "$i: Unsupported or no repository" >&2
	}
}

if (( newmode == 0 )) {
	echo "Running pkglist manually or via cron is no longer neccessary and therefore depracated" >&2
}