]> git.pld-linux.org Git - projects/cleanbuild.git/blame - cleanpoldekcache
- call builder script with stdin from /dev/null (act like th builders)
[projects/cleanbuild.git] / cleanpoldekcache
CommitLineData
1eafe265 1#!/usr/bin/sudo /bin/sh
2
3CACHEDIR="$PWD/poldekcache"
4
4d64e496 5[ -r .cleanbuildrc ] && . ./.cleanbuildrc
1eafe265 6
7export LC_ALL=C
8unset LANGUAGE
9unset LANG
10
11cd "$CACHEDIR" || exit 1
12
13cleandir()
14{
15 DIR="$1"
16 /usr/bin/poldek --skip-installed -s "$DIR" --cachedir="$CACHEDIR" \
17 --shcmd="ls" > cleanpoldekcache.pkgs
18 for PKG in $(ls $DIR); do
19 case "$PKG" in
20 dirindex.pndir.tndb* | packages.ndir.*)
21 ;;
22 *)
23 if ! grep -q "${PKG%%.rpm}" cleanpoldekcache.pkgs; then
24 rm -v $DIR/$PKG
25 fi
26 ;;
27 esac
28 done
29 rm cleanpoldekcache.pkgs
30}
31
32for FILE in *; do
33 case "$FILE" in
34 ftp*.packages.i|http*.packages.i)
35 echo "removing $FILE if empty"
36 rmdir -v "$FILE"
37 ;;
38 ftp*|http*)
39 echo "cleaning inside $FILE"
40 cleandir "$FILE"
41 ;;
42 _* | tmpmd)
43 echo "removing $FILE"
44 rm -rv "$FILE"
45 ;;
46 *)
47 echo "removing $FILE"
48 rm -v "$FILE"
49 ;;
50 esac
51done
52
53# vim: ts=4 sw=4 filetype=sh
This page took 0.02831 seconds and 4 git commands to generate.