OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-re Date: 20-Jan-2004 13:56:01
Branch: HEAD Handle: 2004012012560100
Modified files:
openpkg-re openpkg-dev
Log:
use an appropriate egrep
Summary:
Revision Changes Path
1.150 +35 -28 openpkg-re/openpkg-dev
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-re/openpkg-dev
============================================================================
$ cvs diff -u -r1.149 -r1.150 openpkg-dev
--- openpkg-re/openpkg-dev 16 Jan 2004 13:20:56 -0000 1.149
+++ openpkg-re/openpkg-dev 20 Jan 2004 12:56:01 -0000 1.150
@@ -53,7 +53,14 @@
OPENPKG_CTAG="${OPENPKG_CTAG}"; B="${B}" # B (cvs tag, branch)
OPENPKG_EXEC="${OPENPKG_EXEC}"; E="${E}" # E (exec, instance)
export OPENPKG_SPEC P OPENPKG_CTAG B OPENPKG_EXEC E
-#
+
+# use an appropriate egrep
+if [ -x /usr/xpg4/bin/${EGREP} ]; then
+ EGREP="/usr/xpg4/bin/egrep"
+else
+ EGREP="egrep"
+fi
+
# a note about CVS HEAD
# CVS calls the latest version of a file "head". It also supports two
# hardcoded pseudotags, "BASE" and "HEAD". It is a strange and often
@@ -438,7 +445,7 @@
command=""
mode="clear"
else
- echo "$1" | egrep "^/" >/dev/null 2>&1
+ echo "$1" | ${EGREP} "^/" >/dev/null 2>&1
if [ $? -eq 0 ]; then
# leading slash enters setup mode
execute="${1}"
@@ -499,8 +506,8 @@
[ ".${RV}" = . ] && return
# check for HEAD (branch) aka CURRENT (name)
- echo "CURRENT" | egrep "^${RV}" >/dev/null 2>&1 && RV="HEAD"
- echo "HEAD" | egrep "^${RV}" >/dev/null 2>&1 && RV="HEAD"
+ echo "CURRENT" | ${EGREP} "^${RV}" >/dev/null 2>&1 && RV="HEAD"
+ echo "HEAD" | ${EGREP} "^${RV}" >/dev/null 2>&1 && RV="HEAD"
if [ .${RV} != ".HEAD" ]; then
@@ -532,7 +539,7 @@
INSTANCE="$1"
if [ ".$mode" = .exact ]; then
- echo "${INSTANCE}" | egrep "^/" >/dev/null #PATH
+ echo "${INSTANCE}" | ${EGREP} "^/" >/dev/null #PATH
if [ $? -eq 0 -a -x "${INSTANCE}/bin/rpm" ]; then
RV="${INSTANCE}"
unset INSTANCE
@@ -546,18 +553,18 @@
INSTANCE=`echo "$1" | sed -e 's;^OPENPKG_;;' -e 's;_STABLE$;;' -e 's;_SOLID$;;'
-e 's;^HEAD$;;' -e 's;_;.;g'`
RE=""
- echo "${INSTANCE}" | egrep -i "^head$" >/dev/null &&
RE="^[0-9]{8}$" #HEAD (any)
- echo "${INSTANCE}" | egrep "^[0-9]{8}$" >/dev/null &&
RE="^${INSTANCE}$" #HEAD
- echo "${INSTANCE}" | egrep "^[0-9]{1,7}$" >/dev/null &&
RE="^${INSTANCE}\." #STABLE
- echo "${INSTANCE}" | egrep "^[0-9]+\.[0-9]{8}$" >/dev/null &&
RE="^${INSTANCE}$" #SNAPSHOT
- echo "${INSTANCE}" | egrep "^[0-9]+\.[0-9]{1,7}$" >/dev/null &&
RE="^${INSTANCE}" #SOLID (any UPD)
- echo "${INSTANCE}" | egrep "^[0-9]+\.[0-9]{1,7}\.[0-9]+$" >/dev/null &&
RE="^${INSTANCE}$" #SOLID
+ echo "${INSTANCE}" | ${EGREP} -i "^head$" >/dev/null &&
RE="^[0-9]{8}$" #HEAD (any)
+ echo "${INSTANCE}" | ${EGREP} "^[0-9]{8}$" >/dev/null &&
RE="^${INSTANCE}$" #HEAD
+ echo "${INSTANCE}" | ${EGREP} "^[0-9]{1,7}$" >/dev/null &&
RE="^${INSTANCE}\." #STABLE
+ echo "${INSTANCE}" | ${EGREP} "^[0-9]+\.[0-9]{8}$" >/dev/null &&
RE="^${INSTANCE}$" #SNAPSHOT
+ echo "${INSTANCE}" | ${EGREP} "^[0-9]+\.[0-9]{1,7}$" >/dev/null &&
RE="^${INSTANCE}" #SOLID (any UPD)
+ echo "${INSTANCE}" | ${EGREP} "^[0-9]+\.[0-9]{1,7}\.[0-9]+$" >/dev/null &&
RE="^${INSTANCE}$" #SOLID
RE="`echo ${RE} | sed -e 's;\.;\\.;g'`"
for INSTANCE in ${OPENPKG_INST}; do
if [ -x "${INSTANCE}/bin/rpm" ]; then
VERSION=`${INSTANCE}/bin/rpm -q --qf "%{VERSION}" openpkg`
- echo ${VERSION} | egrep "$RE" >/dev/null
+ echo ${VERSION} | ${EGREP} "$RE" >/dev/null
if [ $? -eq 0 ]; then
RV="${INSTANCE}"
unset INSTANCE
@@ -924,8 +931,8 @@
locationid=`HOME=${OPENPKG_WORK} $E/bin/rpm --eval %{_rpmfilename} | sed -e
's;^.*}-;;' -e 's;\.rpm$;;'`
for name in $all; do
name=`echo $name | sed -e 's;\.src\.rpm$;;' -e 's;\.nosrc\.rpm$;;'` #
convenience
- ls -l ${OPENPKG_WORK}/pkg/src/$name* | egrep
"/$name[^-]*-[^-]+-[^-]+\.(no)?src.rpm$"
- ls -l ${OPENPKG_WORK}/pkg/bin/$name* | egrep
"/$name[^-]*-[^-]+-[^-]+\.[^-]+-[^-]+-${locationid}.rpm$"
+ ls -l ${OPENPKG_WORK}/pkg/src/$name* | ${EGREP}
"/$name[^-]*-[^-]+-[^-]+\.(no)?src.rpm$"
+ ls -l ${OPENPKG_WORK}/pkg/bin/$name* | ${EGREP}
"/$name[^-]*-[^-]+-[^-]+\.[^-]+-[^-]+-${locationid}.rpm$"
done
}
@@ -1057,7 +1064,7 @@
if [ ".${OPENPKG_MODE}" = .developer ]; then
# compatiblity FIXME
- echo "${OPENPKG_DIST}" | egrep "/current/SRC/?$" >/dev/null 2>&1
+ echo "${OPENPKG_DIST}" | ${EGREP} "/current/SRC/?$" >/dev/null 2>&1
if [ $? -eq 0 ]; then
warn "deprecated suffix /current/src in
OPENPKG_DIST=${OPENPKG_DIST}."
warn "This might come from your ~/.openpkg-dev.rc file. Please fix."
@@ -1592,10 +1599,10 @@
case ".$1" in
.-D ) shift
opt="$1"
- pkg=""; echo "${opt}" | egrep '::' >/dev/null 2>&1 && pkg="`echo
${opt} | sed -e 's;::.*$;;'`"
+ pkg=""; echo "${opt}" | ${EGREP} '::' >/dev/null 2>&1 &&
pkg="`echo ${opt} | sed -e 's;::.*$;;'`"
opt="`echo ${opt} | sed -e 's;^.*::;;'`"
- echo "${opt}" | egrep '^with_' >/dev/null 2>&1 ||
opt="with_${opt}"
- echo "${opt}" | egrep '=' >/dev/null 2>&1 || opt="${opt}=yes"
+ echo "${opt}" | ${EGREP} '^with_' >/dev/null 2>&1 ||
opt="with_${opt}"
+ echo "${opt}" | ${EGREP} '=' >/dev/null 2>&1 ||
opt="${opt}=yes"
if [ ".${pkg}" = . ]; then
defall="${defall} ${opt}"
else
@@ -1619,7 +1626,7 @@
die "$E/bin/rpm not executable. \$E might not be set properly."
fi
for name in $all; do
- opt="`echo ${defpkg} | tr ' ' '\n' | egrep ^$name:: | sed 's;^.*::;;' | tr
'\n' ' '`"
+ opt="`echo ${defpkg} | tr ' ' '\n' | ${EGREP} ^$name:: | sed 's;^.*::;;' |
tr '\n' ' '`"
opt="`echo ${opt} $defall`"
echo "++ building ${name} ${opt}"
if [ ! -f "${OPENPKG_WORK}/src/${name}/${name}.spec" ]; then
@@ -1634,7 +1641,7 @@
rpmdir=`HOME=${OPENPKG_WORK} $E/bin/rpm --eval '%{_rpmdir}'`
if [ ! -f "$rpmdir/$rpmfile" -o $force -ne 0 ]; then
echo "++ building $package ($rpmfile)"
- opt="`echo ${opt} | tr ' ' '\n' | egrep . | sed -e 's;^;--define \";'
-e 's;=; ;' -e 's;$;\";' | tr '\n' ' '`"
+ opt="`echo ${opt} | tr ' ' '\n' | ${EGREP} . | sed -e 's;^;--define
\";' -e 's;=; ;' -e 's;$;\";' | tr '\n' ' '`"
(cd ${OPENPKG_WORK}/src/${name} && HOME=${OPENPKG_WORK} $E/bin/rpm
--fetch ${name}.spec)
(cd ${OPENPKG_WORK}/src/${name} && eval "HOME=${OPENPKG_WORK}
$E/bin/rpm -ba ${opt} ${name}.spec")
if [ ! -f "$rpmdir/$rpmfile" ]; then
@@ -1713,9 +1720,9 @@
all="${packages}"
fi
for name in $all; do
- echo "$name" | egrep "^[./]+" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "^[./]+" >/dev/null 2>&1
if [ $? -ne 0 ]; then
- echo "$name" | egrep "/" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "/" >/dev/null 2>&1
if [ $? -eq 0 ]; then
name="${OPENPKG_WORK}/src/$name"
else
@@ -1844,9 +1851,9 @@
fi
for name in $all; do
- echo "$name" | egrep "^[./]+" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "^[./]+" >/dev/null 2>&1
if [ $? -ne 0 ]; then
- echo "$name" | egrep "/" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "/" >/dev/null 2>&1
if [ $? -eq 0 ]; then
name="${OPENPKG_WORK}/src/$name"
else
@@ -1911,9 +1918,9 @@
fi
for name in $all; do
- echo "$name" | egrep "^[./]+" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "^[./]+" >/dev/null 2>&1
if [ $? -ne 0 ]; then
- echo "$name" | egrep "/" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "/" >/dev/null 2>&1
if [ $? -eq 0 ]; then
name="${OPENPKG_WORK}/src/$name"
else
@@ -1975,9 +1982,9 @@
fi
for name in $all; do
- echo "$name" | egrep "^[./]+" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "^[./]+" >/dev/null 2>&1
if [ $? -ne 0 ]; then
- echo "$name" | egrep "/" >/dev/null 2>&1
+ echo "$name" | ${EGREP} "/" >/dev/null 2>&1
if [ $? -eq 0 ]; then
name="${OPENPKG_WORK}/src/$name"
else
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]