File: apt-file.is-cache-empty

package info (click to toggle)
apt-file 2.5.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 608 kB
  • sloc: perl: 1,246; python: 132; makefile: 99; sh: 87
file content (16 lines) | stat: -rw-r--r-- 370 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# This script checks if the cache directory is empty
#
# TODO: might exclude obsolete files from check, so it returns false/1 in case of upgrades.


for dir in $XDG_CACHE_HOME/apt-file $HOME/.cache/apt-file /var/cache/apt/apt-file
do
	if [ -d $dir ] && [ -n "$(find $dir -mindepth 1 -not -name '*tmp')" ]
	then
		# Cache is not empty
		exit 1
	fi
done

exit 0