-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildandcopy.sh
executable file
·27 lines (22 loc) · 1.21 KB
/
buildandcopy.sh
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
#!/bin/sh
thedirs="."
repodir=/home/own-repo
thingsToDo=(
'for n in $thedirs; do ( cd $n && updpkgsums); done'
'for n in $thedirs; do ( cd $n && makepkg --force --nodeps --nobuild; makepkg --printsrcinfo > .SRCINFO ); done'
'git diff --quiet --no-ext-diff --exit-code && echo clean || ( git diff -b -w && git add -p && git commit ) || true'
'for n in $thedirs; do ( cd $n && makepkg --force --nodeps --noextract --cleanbuild --skipchecksums); done'
'test -n "$repodir" -a -d "$repodir" && for n in $thedirs; do for pkgdir in $(find $n -name "*.tar.xz" -printf "%h\n" | sort | uniq); do cpfn=$(ls -tc1 $pkgdir/*.tar.xz | head -2 | tr "\n" " "); echo "move [$cpfn]? (y*|n)"; read v; if [ ! "$v" = "n" -a ! "$v" = "N" ]; then sh -c "mv --interactive --update $cpfn $repodir && ( repo-add --new --quiet ${repodir}/ownrepo.db.tar.gz $repodir/*pkg.tar*; )"; fi; done; done'
'git push origin'
'for n in $thedirs; do ( cd $n && makepkg --nodeps --noextract --force --nobuild --noarchive --nocheck --noprepare --skipinteg --clean ); done'
)
set -e
for n in "${thingsToDo[@]}"; do
echo "Continue with [$n] (y*|n)?"
read v
if [ "$v" = "n" -o "$v" = "N" ]; then
echo "..command skipped..";
else
eval "$n";
fi
done