mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
makepkg: remove the cleancache option
This is a fairly useless feature given all it does is an "rm" on a directory. It is also unlikely that you would want to remove the entire SRCDEST anyway, but rather just the old files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
4f8ae2bab6
commit
c45cfb1741
@ -48,10 +48,6 @@ Options
|
|||||||
*-c, \--clean*::
|
*-c, \--clean*::
|
||||||
Clean up leftover work files and directories after a successful build.
|
Clean up leftover work files and directories after a successful build.
|
||||||
|
|
||||||
*-C, \--cleancache*::
|
|
||||||
Removes all cached source files from the directory specified in `SRCDEST`
|
|
||||||
in linkman:makepkg.conf[5].
|
|
||||||
|
|
||||||
*\--config* <file>::
|
*\--config* <file>::
|
||||||
Use an alternate config file instead of the +{sysconfdir}/makepkg.conf+
|
Use an alternate config file instead of the +{sysconfdir}/makepkg.conf+
|
||||||
default.
|
default.
|
||||||
|
@ -52,7 +52,6 @@ readonly -a packaging_options other_options splitpkg_overrides
|
|||||||
# Options
|
# Options
|
||||||
ASROOT=0
|
ASROOT=0
|
||||||
CLEANUP=0
|
CLEANUP=0
|
||||||
CLEANCACHE=0
|
|
||||||
DEP_BIN=0
|
DEP_BIN=0
|
||||||
FORCE=0
|
FORCE=0
|
||||||
INFAKEROOT=0
|
INFAKEROOT=0
|
||||||
@ -1661,7 +1660,6 @@ usage() {
|
|||||||
echo "$(gettext "Options:")"
|
echo "$(gettext "Options:")"
|
||||||
printf "$(gettext " -A, --ignorearch Ignore incomplete %s field in %s")\n" "arch" "$BUILDSCRIPT"
|
printf "$(gettext " -A, --ignorearch Ignore incomplete %s field in %s")\n" "arch" "$BUILDSCRIPT"
|
||||||
echo "$(gettext " -c, --clean Clean up work files after build")"
|
echo "$(gettext " -c, --clean Clean up work files after build")"
|
||||||
echo "$(gettext " -C, --cleancache Clean up source files from the cache")"
|
|
||||||
echo "$(gettext " -d, --nodeps Skip all dependency checks")"
|
echo "$(gettext " -d, --nodeps Skip all dependency checks")"
|
||||||
printf "$(gettext " -e, --noextract Do not extract source files (use existing %s dir)")\n" "src/"
|
printf "$(gettext " -e, --noextract Do not extract source files (use existing %s dir)")\n" "src/"
|
||||||
echo "$(gettext " -f, --force Overwrite existing package")"
|
echo "$(gettext " -f, --force Overwrite existing package")"
|
||||||
@ -1719,7 +1717,7 @@ ARGLIST=("$@")
|
|||||||
|
|
||||||
# Parse Command Line Options.
|
# Parse Command Line Options.
|
||||||
OPT_SHORT="AcCdefFghiLmop:rRsV"
|
OPT_SHORT="AcCdefFghiLmop:rRsV"
|
||||||
OPT_LONG="allsource,asroot,ignorearch,check,clean,cleancache,nodeps"
|
OPT_LONG="allsource,asroot,ignorearch,check,clean,nodeps"
|
||||||
OPT_LONG+=",noextract,force,forcever:,geninteg,help,holdver"
|
OPT_LONG+=",noextract,force,forcever:,geninteg,help,holdver"
|
||||||
OPT_LONG+=",install,key:,log,nocolor,nobuild,nocheck,nosign,pkg:,rmdeps"
|
OPT_LONG+=",install,key:,log,nocolor,nobuild,nocheck,nosign,pkg:,rmdeps"
|
||||||
OPT_LONG+=",repackage,skipinteg,sign,source,syncdeps,version,config:"
|
OPT_LONG+=",repackage,skipinteg,sign,source,syncdeps,version,config:"
|
||||||
@ -1744,7 +1742,6 @@ while true; do
|
|||||||
--asroot) ASROOT=1 ;;
|
--asroot) ASROOT=1 ;;
|
||||||
-A|--ignorearch) IGNOREARCH=1 ;;
|
-A|--ignorearch) IGNOREARCH=1 ;;
|
||||||
-c|--clean) CLEANUP=1 ;;
|
-c|--clean) CLEANUP=1 ;;
|
||||||
-C|--cleancache) CLEANCACHE=1 ;;
|
|
||||||
--check) RUN_CHECK='y' ;;
|
--check) RUN_CHECK='y' ;;
|
||||||
--config) shift; MAKEPKG_CONF=$1 ;;
|
--config) shift; MAKEPKG_CONF=$1 ;;
|
||||||
-d|--nodeps) NODEPS=1 ;;
|
-d|--nodeps) NODEPS=1 ;;
|
||||||
@ -1876,37 +1873,6 @@ if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( CLEANCACHE )); then
|
|
||||||
#fix flyspray feature request #5223
|
|
||||||
if [[ -n $SRCDEST && ! $SRCDEST -ef "${startdir}" ]]; then
|
|
||||||
msg "$(gettext "Cleaning up ALL files from %s.")" "$SRCDEST"
|
|
||||||
echo -n "$(gettext " Are you sure you wish to do this? ")"
|
|
||||||
echo -n "$(gettext "[y/N]")"
|
|
||||||
read answer
|
|
||||||
answer=$(tr '[:lower:]' '[:upper:]' <<< "$answer")
|
|
||||||
if [[ $answer = $(gettext YES) || $answer = $(gettext Y) ]]; then
|
|
||||||
rm "$SRCDEST"/*
|
|
||||||
if (( $? )); then
|
|
||||||
error "$(gettext "Problem removing files; you may not have correct permissions in %s")" "$SRCDEST"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
# removal worked
|
|
||||||
msg "$(gettext "Source cache cleaned.")"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# answer = no
|
|
||||||
msg "$(gettext "No files have been removed.")"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# $SRCDEST is $startdir, two possibilities
|
|
||||||
error "$(gettext "Source destination must be defined in %s.")" "$MAKEPKG_CONF"
|
|
||||||
plain "$(gettext "In addition, please run %s outside of your cache directory.")" "makepkg -C"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( ! INFAKEROOT )); then
|
if (( ! INFAKEROOT )); then
|
||||||
if (( EUID == 0 && ! ASROOT )); then
|
if (( EUID == 0 && ! ASROOT )); then
|
||||||
# Warn those who like to live dangerously.
|
# Warn those who like to live dangerously.
|
||||||
|
Loading…
Reference in New Issue
Block a user