]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Do not use deprecated egrep/fgrep
authorVille Skyttä <ville.skytta@iki.fi>
Mon, 28 Mar 2016 08:38:34 +0000 (11:38 +0300)
committerVille Skyttä <ville.skytta@iki.fi>
Mon, 28 Mar 2016 08:38:34 +0000 (11:38 +0300)
dracut-init.sh
install/dracut-install.c
modules.d/00systemd/module-setup.sh
modules.d/02systemd-networkd/module-setup.sh
modules.d/95debug/module-setup.sh
modules.d/95nfs/module-setup.sh
modules.d/95udev-rules/module-setup.sh
modules.d/99base/module-setup.sh
test/TEST-04-FULL-SYSTEMD/test.sh

index fc35d7b4383799bb6b08477d098a679d83864bbf..a67aca2676c84dddb6f5df177b78c3cc809937d8 100644 (file)
@@ -328,15 +328,15 @@ inst_rule_group_owner() {
 
     if grep -qE 'OWNER=?"[^ "]+' "$1"; then
         for i in $(grep -E 'OWNER=?"[^ "]+' "$1" | sed -r 's/.*OWNER=?"([^ "]+).*/\1/'); do
-            if ! egrep -q "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
-                egrep "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+            if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
+                grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
             fi
         done
     fi
     if grep -qE 'GROUP=?"[^ "]+' "$1"; then
         for i in $(grep -E 'GROUP=?"[^ "]+' "$1" | sed -r 's/.*GROUP=?"([^ "]+).*/\1/'); do
-            if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
-                egrep "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
+            if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
+                grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
             fi
         done
     fi
index 8f65d8d1336aa7b9bfc85c7efb56b9363c7dee67..3b48ba89606b92597da0dc2621babec6fb57d8be 100644 (file)
@@ -287,7 +287,7 @@ static int library_install(const char *src, const char *lib)
 
         /* Also try to install the same library from one directory above.
            This fixes the case, where only the HWCAP lib would be installed
-           # ldconfig -p|fgrep libc.so
+           # ldconfig -p|grep -F libc.so
            libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
            libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
            libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
index ed59beb7d059000caab79be8fa5de61753ade7e7..deb5e06c023ae5bbfe4a5752f20faf3581f514ce 100755 (executable)
@@ -179,11 +179,11 @@ install() {
 
     # install adm user/group for journald
     inst_multiple nologin
-    egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
-    egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
-    egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
-    egrep '^wheel:' /etc/group >> "$initdir/etc/group"
-    egrep '^adm:' /etc/group >> "$initdir/etc/group"
+    grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+    grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+    grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
+    grep '^wheel:' /etc/group >> "$initdir/etc/group"
+    grep '^adm:' /etc/group >> "$initdir/etc/group"
 
     ln_r $systemdutildir/systemd "/init"
     ln_r $systemdutildir/systemd "/sbin/init"
index 58842c08248e06a347b2b439d07b42daa257f175..b86751eaa1d6db1b5ac2db7f087bcf1406b12298 100755 (executable)
@@ -48,10 +48,10 @@ install() {
 
     # inst_dir /var/lib/systemd/clock
 
-    egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
-    egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
-    # egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
-    # egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
+    grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+    grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
+    # grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+    # grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
 
     _arch=$(uname -m)
     inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
index ce5e8e850706f1a71ea8b9c8ac824a9843e5a3ac..97b2a30deb435ceb24a2f03d7c4df1a432b8b503 100755 (executable)
@@ -18,6 +18,6 @@ install() {
                   tcpdump cp less hostname mkdir \
                   fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
 
-    egrep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+    grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
 }
 
index 9b5b8c8f022a6dfe62cc0a2ad525c754df1b06c9..aefbc2a380ba8004d9fc17eca09a378ba02606a8 100755 (executable)
@@ -105,14 +105,14 @@ install() {
 
     # Rather than copy the passwd file in, just set a user for rpcbind
     # We'll save the state and restart the daemon from the root anyway
-    egrep '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
-    egrep '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
+    grep -E '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
+    grep -E '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
 
     # rpc user needs to be able to write to this directory to save the warmstart
     # file
     chmod 770 "$initdir/var/lib/rpcbind"
-    egrep -q '^rpc:' /etc/passwd \
-        && egrep -q '^rpc:' /etc/group \
+    grep -q '^rpc:' /etc/passwd \
+        && grep -q '^rpc:' /etc/group \
         && chown rpc.rpc "$initdir/var/lib/rpcbind"
     dracut_need_initqueue
 }
index 6a0625aa2f911ff9e2c0d9fd3a58a3976845b388..a59eca2a1cf2e26304a9f21841ddb05f48dd970d 100755 (executable)
@@ -63,8 +63,8 @@ install() {
 
     {
         for i in cdrom tape dialout floppy; do
-            if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
-                if ! egrep "^$i:" /etc/group 2>/dev/null; then
+            if ! grep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
+                if ! grep "^$i:" /etc/group 2>/dev/null; then
                         case $i in
                             cdrom)   echo "$i:x:11:";;
                             dialout) echo "$i:x:18:";;
index cc94d00552a35059462107d0bf833d1bcfef6a46..5fbf6f7d4bb83c51842f48b044c2138f6138fe4e 100755 (executable)
@@ -27,8 +27,8 @@ install() {
     fi
 
     #add common users in /etc/passwd, it will be used by nfs/ssh currently
-    egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo  'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
-    egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
+    grep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo  'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
+    grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
 
     # install our scripts and hooks
     inst_script "$moddir/init.sh" "/init"
index f5a9d48c31c9af8beb20fc6f35bda1c0d11985a2..c7e08bfb06786e60bd49c9818b41f1a07c8d5b43 100755 (executable)
@@ -197,7 +197,7 @@ EOF
         ln -fs /proc/self/mounts $initdir/etc/mtab
 
         # install any Execs from the service files
-        egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
+        grep -Eho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
             | while read i || [ -n "$i" ]; do
             i=${i##Exec*=}; i=${i##-}
             inst_multiple -o $i