mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-13 21:05:05 -05:00
* Added confirmation step to makepkg -C operation to ensure user is deleting
exactly what they think they are.
This commit is contained in:
parent
28aca444a2
commit
0a1ca73183
@ -486,16 +486,28 @@ fi
|
|||||||
|
|
||||||
if [ "$CLEANCACHE" = "1" ]; then
|
if [ "$CLEANCACHE" = "1" ]; then
|
||||||
#fix flyspray feature request #5223
|
#fix flyspray feature request #5223
|
||||||
if [ -n "$SRCDEST" ]; then
|
if [ -n "$SRCDEST" -a "$SRCDEST" != "$startdir" ]; then
|
||||||
msg "Cleaning up source files from the cache."
|
msg "Cleaning up ALL files from $SRCDEST."
|
||||||
|
echo -n " Are you sure you wish to do this? [Y/n] "
|
||||||
|
read answer
|
||||||
|
answer=$(echo $answer | tr [:upper:] [:lower:])
|
||||||
|
if [ "$answer" = "yes" -o "$answer" = "y" ]; then
|
||||||
rm -rf "$SRCDEST"/*
|
rm -rf "$SRCDEST"/*
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
error "Problem removing files; you may not have correct permissions in $SRCDEST"
|
error "Problem removing files; you may not have correct permissions in $SRCDEST"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
# removal worked
|
||||||
|
msg "Source cache cleaned."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
# answer = no
|
||||||
|
"No files have been removed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# SRCDEST undefined (should never happen)
|
||||||
error "Source destination must be defined in makepkg.conf."
|
error "Source destination must be defined in makepkg.conf."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user