small runtime improvement to the cowpacman2srm script

This prevents trying to create the directories twice by removing duplicate
entries from the file list. Saves about 3 seconds of runtime when testing
with the "atom" package.
This commit is contained in:
Gerd v. Egidy 2020-11-08 19:26:15 +01:00
parent 6736e47e41
commit c1ab9675c5

View file

@ -105,7 +105,7 @@ mkdir -p $TMP_TARGET
# read all filenames installed by the packages in COW space
# sort to make sure dir names come before files in the dir
pacman -Q --list --quiet $PACKAGENAMES | sort >$PKG_FILELIST
pacman -Q --list --quiet $PACKAGENAMES | sort -u >$PKG_FILELIST
if cat $PKG_FILELIST | wc -l | grep -q "^0$"; then
echo "ERROR: empty file list for the installed packages"