forked from kiss-community/kiss
kiss: Simplify pkg_clean(), fixes #173
The package manager will no longer clean up any other pre-existing cache directories at exit. - Fixes a portability issue by removing usage of /proc. - Fixes issues when the user has KISS_PID set. - Outside of the realm of what the utility should do.
This commit is contained in:
parent
5ffa51aa67
commit
a92cb95673
14
kiss
14
kiss
@ -1300,19 +1300,7 @@ pkg_updates() {
|
|||||||
|
|
||||||
pkg_clean() {
|
pkg_clean() {
|
||||||
# Clean up on exit or error. This removes everything related to the build.
|
# Clean up on exit or error. This removes everything related to the build.
|
||||||
[ "$KISS_DEBUG" = 1 ] || {
|
[ "$KISS_DEBUG" = 1 ] || rm -rf "$mak_dir" "$pkg_dir" "$tar_dir"
|
||||||
# Create a list containing the current invocation's temporary files and
|
|
||||||
# directories.
|
|
||||||
set +f -- "$mak_dir" "$pkg_dir" "$tar_dir"
|
|
||||||
|
|
||||||
# Go through the cache and add any entries which don't belong to a
|
|
||||||
# currently running kiss instance.
|
|
||||||
for dir in "$cac_dir/"[bep]*-[0-9]*; do
|
|
||||||
[ -e "/proc/${dir##*-}" ] || set -- "$@" "$dir"
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf -- "$@"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
args() {
|
args() {
|
||||||
|
Loading…
Reference in New Issue
Block a user