8
8
# ###############################################################
9
9
#
10
10
# Copyright (c) 1995-2014 SUSE Linux Products GmbH
11
+ # Copyright (c) 2022 Andreas Stieger <[email protected] >
11
12
#
12
13
# This program is free software; you can redistribute it and/or modify
13
14
# it under the terms of the GNU General Public License version 2 or 3 as
@@ -1682,9 +1683,9 @@ for RECIPEPATH in "${RECIPEFILES[@]}" ; do
1682
1683
test -n " $SUSE_VERSION " -a " ${SUSE_VERSION:- 0} " -le 1020 && BUILD_USER=root
1683
1684
fi
1684
1685
if test " $BUILD_USER " = abuild ; then
1685
- egrep ' ^#[[:blank:]]*needsrootforbuild[[:blank:]]*$' > /dev/null < $RECIPEPATH && BUILD_USER=root
1686
+ grep -E ' ^#[[:blank:]]*needsrootforbuild[[:blank:]]*$' > /dev/null < $RECIPEPATH && BUILD_USER=root
1686
1687
else
1687
- egrep ' ^#[[:blank:]]*norootforbuild[[:blank:]]*$' > /dev/null < $RECIPEPATH && BUILD_USER=abuild
1688
+ grep -E ' ^#[[:blank:]]*norootforbuild[[:blank:]]*$' > /dev/null < $RECIPEPATH && BUILD_USER=abuild
1688
1689
fi
1689
1690
test -n " $NOROOTFORBUILD " && BUILD_USER=abuild
1690
1691
@@ -1700,18 +1701,18 @@ for RECIPEPATH in "${RECIPEFILES[@]}" ; do
1700
1701
1701
1702
# fixup passwd/group
1702
1703
if test $BUILD_USER = abuild ; then
1703
- if ! egrep ' ^abuild:' > /dev/null < $BUILD_ROOT /etc/passwd ; then
1704
+ if ! grep -E ' ^abuild:' > /dev/null < $BUILD_ROOT /etc/passwd ; then
1704
1705
echo " abuild:x:${ABUILD_UID} :${ABUILD_GID} :Autobuild:/home/abuild:/bin/bash" >> $BUILD_ROOT /etc/passwd
1705
1706
echo ' abuild:*:::::::' >> $BUILD_ROOT /etc/shadow # This is needed on Mandriva 2009
1706
1707
echo ' abuild:*::' >> $BUILD_ROOT /etc/gshadow # This is needed on Ubuntu
1707
1708
echo " abuild:x:${ABUILD_GID} :" >> $BUILD_ROOT /etc/group
1708
1709
mkdir -p $BUILD_ROOT /home/abuild
1709
1710
chown " $ABUILD_UID :$ABUILD_GID " $BUILD_ROOT /home/abuild
1710
1711
else
1711
- if ! egrep " ^abuild:x?:${ABUILD_UID} :${ABUILD_GID} " > /dev/null < $BUILD_ROOT /etc/passwd ; then
1712
+ if ! grep -E " ^abuild:x?:${ABUILD_UID} :${ABUILD_GID} " > /dev/null < $BUILD_ROOT /etc/passwd ; then
1712
1713
echo " abuild user present in the buildroot ($BUILD_ROOT ) but uid:gid does not match"
1713
1714
echo " buildroot currently using:"
1714
- egrep " ^abuild:" < $BUILD_ROOT /etc/passwd
1715
+ grep -E " ^abuild:" < $BUILD_ROOT /etc/passwd
1715
1716
echo " build script attempting to use:"
1716
1717
echo " abuild::${ABUILD_UID} :${ABUILD_GID} :..."
1717
1718
echo " build aborting"
@@ -1729,7 +1730,7 @@ for RECIPEPATH in "${RECIPEFILES[@]}" ; do
1729
1730
# building as root
1730
1731
ABUILD_UID=0
1731
1732
ABUILD_GID=0
1732
- if egrep ' ^abuild:' > /dev/null < $BUILD_ROOT /etc/passwd ; then
1733
+ if grep -E ' ^abuild:' > /dev/null < $BUILD_ROOT /etc/passwd ; then
1733
1734
rm -rf " $BUILD_ROOT /home/abuild"
1734
1735
sed -i -e ' /^abuild:/d' $BUILD_ROOT /etc/passwd
1735
1736
sed -i -e ' /^abuild:/d' $BUILD_ROOT /etc/group
0 commit comments