From 58e5b1026c3abf39bf8fd721b1043c6692f8c327 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 27 May 2008 20:10:09 +0200 Subject: bin/pkg: check whether sed works properly --- bin/pkg | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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" ;; -- cgit v1.2.3