File: apt-file.is-cache-empty

package info (click to toggle)
apt-file 2.5.4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 632 kB
  • ctags: 77
  • sloc: perl: 1,309; python: 132; makefile: 100; 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