mirror of
https://github.com/rworkman/slackpkg
synced 2025-02-02 07:57:52 +01:00
Reduce false positives in DOUBLEFILES detection
Add extra formatting for search/doublefiles
This commit is contained in:
parent
7faebfbdb1
commit
612b6553ae
1 changed files with 17 additions and 25 deletions
|
@ -860,8 +860,15 @@ function searchlist() {
|
||||||
echo "[${STATUS}] - ${INSTPKG}"
|
echo "[${STATUS}] - ${INSTPKG}"
|
||||||
else
|
else
|
||||||
STATUS=" upgrade "
|
STATUS=" upgrade "
|
||||||
|
INSTPKG=$( printf "$INSTPKG" | tr '\n' ' ' )
|
||||||
|
|
||||||
|
if echo "$INSTPKG" | grep -q ' '; then
|
||||||
|
printf "%s - %s / %s\n --> %s\n" \
|
||||||
|
"[${STATUS}]" ${INSTPKG} ${RAWNAME}
|
||||||
|
else
|
||||||
echo "[${STATUS}] - ${INSTPKG} --> ${RAWNAME}"
|
echo "[${STATUS}] - ${INSTPKG} --> ${RAWNAME}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "[${STATUS}] - ${RAWNAME}"
|
echo "[${STATUS}] - ${RAWNAME}"
|
||||||
fi
|
fi
|
||||||
|
@ -1242,18 +1249,10 @@ function sanity_check() {
|
||||||
mv $ROOT/var/log/scripts/${i} $ROOT/var/log/scripts/${REVNAME}
|
mv $ROOT/var/log/scripts/${i} $ROOT/var/log/scripts/${REVNAME}
|
||||||
done
|
done
|
||||||
|
|
||||||
ls -1 $ROOT/var/log/packages/ | egrep "^.*-(${ARCH}|fw|noarch)-[^-]+$" | \
|
DOUBLEFILES=$( ls -1 $ROOT/var/log/packages/ |
|
||||||
batchcutpkg | sort > $TMPDIR/list1
|
rev | cut -d- -f4- | rev | uniq -D | sort -u | applyblacklist |
|
||||||
cat $TMPDIR/list1 | uniq > $TMPDIR/list2
|
xargs -I '{}' find $ROOT/var/log/packages/ -regex \
|
||||||
FILES="$(diff $TMPDIR/list1 $TMPDIR/list2 | grep '<' | cut -f2 -d\ )"
|
".*/{}-[^-]+-\($ARCH\|noarch\|fw\)-[^-]+" | xargs -I '{}' basename '{}' )
|
||||||
|
|
||||||
if [ "$FILES" != "" ]; then
|
|
||||||
for i in $FILES ; do
|
|
||||||
echo "${i}" | grep -qE -f ${TMPDIR}/blacklist && continue
|
|
||||||
DOUBLEFILES="$DOUBLEFILES $i"
|
|
||||||
done
|
|
||||||
unset FILES
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm ${TMPDIR}/waiting
|
rm ${TMPDIR}/waiting
|
||||||
echo -e "DONE"
|
echo -e "DONE"
|
||||||
|
@ -1264,10 +1263,8 @@ You have a broken $ROOT/var/log/packages/ - with two versions of the same packag
|
||||||
The list of packages duplicated in your machine is shown below, but don't\n\
|
The list of packages duplicated in your machine is shown below, but don't\n\
|
||||||
worry about this list - when you select your action, slackpkg will show a\n\
|
worry about this list - when you select your action, slackpkg will show a\n\
|
||||||
better list:\n"
|
better list:\n"
|
||||||
for i in $DOUBLEFILES ; do
|
printf "%s\n" $DOUBLEFILES
|
||||||
ls -1 $ROOT/var/log/packages/ |\
|
|
||||||
egrep -i -- "^${i}-[^-]+-(${ARCH}|fw|noarch)-"
|
|
||||||
done
|
|
||||||
echo -ne "\n\
|
echo -ne "\n\
|
||||||
You can (R)emove, or (I)gnore these packages.\n\
|
You can (R)emove, or (I)gnore these packages.\n\
|
||||||
Select your action (R/I): "
|
Select your action (R/I): "
|
||||||
|
@ -1275,17 +1272,12 @@ Select your action (R/I): "
|
||||||
echo
|
echo
|
||||||
case "$ANSWER" in
|
case "$ANSWER" in
|
||||||
R|r)
|
R|r)
|
||||||
for i in $DOUBLEFILES ; do
|
showlist "$DOUBLEFILES" remove
|
||||||
FILE=$(ls -1 $ROOT/var/log/packages/ |\
|
|
||||||
egrep -i -- "^${i}-[^-]+-(${ARCH}|fw|noarch)-")
|
|
||||||
FILES="$FILES $FILE"
|
|
||||||
done
|
|
||||||
showlist "$FILES" remove
|
|
||||||
remove_pkg
|
remove_pkg
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\n\
|
echo "Remove or blacklist the affected packages in order for \
|
||||||
Remove or blacklist the affected packages in order for slackpkg to work properly.\n"
|
slackpkg to work properly."
|
||||||
cleanup
|
cleanup
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue