lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 3347c48 3/3: Prefer 'find ... -not' to 'find


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3347c48 3/3: Prefer 'find ... -not' to 'find ... !'
Date: Thu, 14 May 2020 16:26:28 -0400 (EDT)

branch: master
commit 3347c485cd6126641a16a5089d4c7a7d7465eca8
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prefer 'find ... -not' to 'find ... !'
    
    '!' is hazardous: it may need to be escaped, depending on the shell.
    '-not' isn't posix, but it's BSD and GNU/Linux, and that's good enough.
---
 gwc/share_git1.sh            | 6 +++---
 gwc/share_git2.sh            | 6 +++---
 install_libxml2_libxslt.make | 2 +-
 install_msw.sh               | 4 ++--
 install_wx.sh                | 2 +-
 install_wxpdfdoc.sh          | 2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gwc/share_git1.sh b/gwc/share_git1.sh
index aa08a43..37534e8 100755
--- a/gwc/share_git1.sh
+++ b/gwc/share_git1.sh
@@ -44,7 +44,7 @@ chgrp -R audio "$inited"
 git -C "$inited" remote add origin https://github.com/wxWidgets/zlib.git
 git -C "$inited" fetch origin
 
-find ./"$inited" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$inited" -not -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group write permissions:
 ls -l ./"$inited"/*HEAD
 
@@ -78,14 +78,14 @@ chmod -R g=u "$cloned"
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00019.html
 
 # Permissions seem to be okay...
-find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$cloned" -not -perm -g=w |sed -e'/objects\/pack/d'
 # ...but that's because FETCH_HEAD doesn't yet exist:
 ls -l ./"$cloned"/*HEAD
 
 # This succeeds when run by owner:
 git -C "$cloned" fetch
 
-find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$cloned" -not -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group write permissions:
 ls -l ./"$cloned"/*HEAD
 
diff --git a/gwc/share_git2.sh b/gwc/share_git2.sh
index aded7cf..b434678 100755
--- a/gwc/share_git2.sh
+++ b/gwc/share_git2.sh
@@ -44,7 +44,7 @@ chgrp -R audio "$inited"
 git -C "$inited" remote add origin https://github.com/wxWidgets/zlib.git
 git -C "$inited" fetch origin
 
-find ./"$inited" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$inited" -not -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group write permissions:
 ls -l ./"$inited"/.git/*HEAD
 
@@ -86,14 +86,14 @@ chmod -R g=u "$cloned"
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00019.html
 
 # Permissions seem to be okay...
-find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$cloned" -not -perm -g=w |sed -e'/objects\/pack/d'
 # ...but that's because FETCH_HEAD doesn't yet exist:
 ls -l ./"$cloned"/.git/*HEAD
 
 # This succeeds when run by owner:
 git -C "$cloned" fetch
 
-find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
+find ./"$cloned" -not -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group write permissions:
 ls -l ./"$cloned"/.git/*HEAD
 
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index ea5f561..ede6f00 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -217,7 +217,7 @@ $(libraries):
        -$(CHMOD) -R g=u $(exec_prefix)/lib
        -$(CHMOD) -R g=u $(prefix)/share/aclocal
        -$(CHMOD) -R g=u $(prefix)/share/man
-       find $(prefix) -perm -200 \! -perm -020
+       find $(prefix) -perm -200 -not -perm -020
 
 # Nonchalantly remove pkgconfig and cmake subdirectories, even though
 # other libraries might someday write files in them, because lmi never
diff --git a/install_msw.sh b/install_msw.sh
index 2277509..adca06f 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -290,9 +290,9 @@ do
 done
 
 # GID should be the same for all files.
-find /opt/lmi/ \! -group "$(id -gn "$(logname)")" -print
+find /opt/lmi/ -not -group "$(id -gn "$(logname)")" -print
 # User and group write permissions should be the same.
-find /opt/lmi -perm -200 \! -perm -020 -print0 | xargs --no-run-if-empty -0 ls 
-ld
+find /opt/lmi -perm -200 -not -perm -020 -print0 | xargs --no-run-if-empty -0 
ls -ld
 # Show all distinct file modes. Expect something like:
 #   00444 regular file
 #   00555 regular file
diff --git a/install_wx.sh b/install_wx.sh
index 9668af3..1afb9fc 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -161,6 +161,6 @@ chmod -R g=u "$exec_prefix"/lib/wx*
 chmod -R g=u "$exec_prefix"/lib/libwx*
 chmod -R g=u "$prefix"/share
 # This should find zero files:
-find "$prefix" -perm -200 \! -perm -020
+find "$prefix" -perm -200 -not -perm -020
 
 exit 0
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index 90416b6..5e12d23 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -126,6 +126,6 @@ chmod -R g=u "$prefix"/include/wx*
 chmod -R g=u "$exec_prefix"/bin
 chmod -R g=u "$exec_prefix"/lib
 # This should find zero files:
-find "$prefix" -perm -200 \! -perm -020
+find "$prefix" -perm -200 -not -perm -020
 
 exit 0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]