summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-27 20:10:09 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-27 20:10:09 +0200
commit58e5b1026c3abf39bf8fd721b1043c6692f8c327 (patch)
treeb382ba0ef217c995f2a0a3ff5c11f5961b990873
parentba5c6a3350252f9498e93d7883a36c167e3ef763 (diff)
bin/pkg: check whether sed works properly
-rwxr-xr-xbin/pkg11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index d884794..b081f76 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -11,7 +11,7 @@ VCS_UPDATE="pull"
VCS_UPDATE_OPTIONS="--update"
CL_OPTIONS="-q"
info=$'\e[0;36m'
-error=$'\e[1;31m'
+error=$'\e[0;31m'
reset=$'\e[0m'
info () {
@@ -27,6 +27,13 @@ die () {
exit 100
}
+check_sed () {
+ QUUX=$(echo foox | sed -r 's/^fo{2}(.)$/quu\1/')
+ if ([ ! $QUUX = 'quux' ]) {
+ warn "sed is not working properly. This may produce unexpected behaviour.\n"
+ }
+}
+
if ([ -f $HOME/.pkg.conf ]) {
. $HOME/.pkg.conf
}
@@ -164,6 +171,8 @@ pkg_status_wrapper () {
}
}
+check_sed
+
case "$1" in
add) pkg_add "$2" ;;
changeroot) pkg_changesrc "$2" ;;