Improve remove logic
Thanks @kou1okada http://github.com/transcode-open/apt-cyg/commit/1b3c49d#commitcomment-6329645
This commit is contained in:
parent
a9f9fea4e6
commit
b09f55c46d
7
apt-cyg
7
apt-cyg
|
@ -456,13 +456,16 @@ case "$command" in
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cygcheck awk bash bunzip2 grep gzip mv sed tar xargs xz | awk '
|
cygcheck awk bash bunzip2 grep gzip mv sed tar xargs xz | awk '
|
||||||
NR>1 &&
|
|
||||||
/bin/ &&
|
/bin/ &&
|
||||||
! fd[$NF]++ &&
|
! fd[$NF]++ &&
|
||||||
$0 = $NF
|
$0 = $NF
|
||||||
' FS='\\' > /tmp/cygcheck.txt
|
' 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
|
then
|
||||||
echo apt-cyg cannot remove package $pkg, exiting
|
echo apt-cyg cannot remove package $pkg, exiting
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue