Improve remove logic

Thanks @kou1okada

http://github.com/transcode-open/apt-cyg/commit/1b3c49d#commitcomment-6329645
This commit is contained in:
Steven Penny 2014-05-15 00:11:54 -05:00
parent a9f9fea4e6
commit b09f55c46d
1 changed files with 5 additions and 2 deletions

View File

@ -456,13 +456,16 @@ case "$command" in
fi
cygcheck awk bash bunzip2 grep gzip mv sed tar xargs xz | awk '
NR>1 &&
/bin/ &&
! fd[$NF]++ &&
$0 = $NF
' FS='\\' > /tmp/cygcheck.txt
if apt-cyg listfiles $pkg | grep -wf /tmp/cygcheck.txt
apt-cyg listfiles $pkg | awk '
$0 = $NF
' FS=/ > /tmp/listfiles.txt
if grep -xf /tmp/cygcheck.txt /tmp/listfiles.txt
then
echo apt-cyg cannot remove package $pkg, exiting
exit 1