r2pm: Allow package script to declare cleaning is done (#17411) ##tools
This commit is contained in:
parent
a94718304c
commit
7ed581d2de
|
@ -570,6 +570,7 @@ case "$1" in
|
|||
while [ -n "$2" ]; do
|
||||
echo "Cleaning $2..."
|
||||
FILE="$(pkgFilePath "$2")"
|
||||
R2PM_CLEAN_GITDIR=1
|
||||
if [ -f "${FILE}" ]; then
|
||||
NAME="$2"
|
||||
ACTION=clean
|
||||
|
@ -581,15 +582,17 @@ case "$1" in
|
|||
RC=1
|
||||
fi
|
||||
|
||||
if [ -d "${R2PM_GITDIR}/$2" ]; then
|
||||
echo "Cleaning up ${R2PM_GITDIR}/$2..."
|
||||
rm -rf "${R2PM_GITDIR}/$2"
|
||||
elif [ -d "${R2PM_GITDIR}/$2.git" ]; then
|
||||
echo "Cleaning up ${R2PM_GITDIR}/$2.git..."
|
||||
rm -rf "${R2PM_GITDIR}/$2.git"
|
||||
else
|
||||
echo "Cannot find $2 or $2.git in ${R2PM_GITDIR}"
|
||||
RC=1
|
||||
if [ "${R2PM_CLEAN_GITDIR}" = 1 ]; then
|
||||
if [ -d "${R2PM_GITDIR}/$2" ]; then
|
||||
echo "Cleaning up ${R2PM_GITDIR}/$2..."
|
||||
rm -rf "${R2PM_GITDIR}/$2"
|
||||
elif [ -d "${R2PM_GITDIR}/$2.git" ]; then
|
||||
echo "Cleaning up ${R2PM_GITDIR}/$2.git..."
|
||||
rm -rf "${R2PM_GITDIR}/$2.git"
|
||||
else
|
||||
echo "Cannot find $2 or $2.git in ${R2PM_GITDIR}"
|
||||
RC=1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue