2 # Purges packages/ checkouts
3 # - if package has clean state, the dir is removed
4 # - otherwise git gc is called
7 topdir=$(rpm -E %_topdir)
8 purgedir=$topdir/purged
11 if [ -d "$purgedir" ]; then
12 echo >&2 "Previous pruge dir exists: $purgedir, remove it to resume"
20 status=$(git status --porcelain)
21 stash=$(git stash list)
23 # FIXME: does not currently handle if some pushes are not made!
24 if [ -n "$status" ] || [ -n "$stash" ]; then
26 * Package $pkg - Untracked files or stash not empty. Invoke gc
33 * Package $pkg - State clean. Removing
40 rmdir --ignore-fail-on-non-empty $purgedir