diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-07-03 18:35:31 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-07-04 22:11:55 +0200 |
commit | ff1b729f956889973994dcc24eb208c7e99a014f (patch) | |
tree | 505d8279cda37fa69b560664d87e366d2a2b2758 /mkinitcpio | |
parent | ab9e920b52ca2d178e174b04d89b3eec875deed7 (diff) | |
download | mkinitcpio-ff1b729f956889973994dcc24eb208c7e99a014f.tar.gz mkinitcpio-ff1b729f956889973994dcc24eb208c7e99a014f.tar.xz |
unify error messaging, both in grammar and output
This also removes a superfluous check on MODULEDIR, which is already
covered by get_kernver.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'mkinitcpio')
-rwxr-xr-x | mkinitcpio | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -163,7 +163,7 @@ readonly NC BOLD BLUE GREEN RED YELLOW if [[ $BASEDIR ]]; then # resolve the path. it might be a relative path and/or contain symlinks if ! pushd "$BASEDIR" &>/dev/null; then - die "base directory '$BASEDIR' does not exist or is not a directory" + die "base directory does not exist or is not a directory: \`%s'" "$BASEDIR" fi BASEDIR=$(pwd -P) BASEDIR=${BASEDIR%/} @@ -172,13 +172,14 @@ fi if [[ $optkver ]]; then if ! KERNELVERSION=$(get_kernver "$optkver"); then - die "'$optkver' is an invalid kernel specifier" + [[ ${optkver:0:1} == / ]] && optkver=$BASEDIR$optkver + die "invalid kernel specifier: \`%s'" "$optkver" fi fi if [[ $TMPDIR ]]; then if [[ ! -d $TMPDIR ]]; then - error "'$TMPDIR' does not exist or is not a directory" + error "Temporary directory does not exist or is not a directory: \`%s'" "$TMPDIR" unset TMPDIR cleanup 1 fi @@ -207,7 +208,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_kver:-$ALL_kver} ]]; then preset_cmd+=(-k "${!preset_kver:-$ALL_kver}") else - warning "No kernel version specified. Skipping image '%s'" "$p" + warning "No kernel version specified. Skipping image \`%s'" "$p" continue fi @@ -215,7 +216,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_config:-$ALL_config} ]]; then preset_cmd+=(-c "$BASEDIR${!preset_config:-$ALL_config}") else - warning "No configuration file specified. Skipping image '%s'" "$p" + warning "No configuration file specified. Skipping image \`%s'" "$p" continue fi @@ -223,7 +224,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_image} ]]; then preset_cmd+=(-g "$BASEDIR${!preset_image}") else - warning "No image file specified. Skipping image '%s'" "$p" + warning "No image file specified. Skipping image \`%s'" "$p" continue fi @@ -237,19 +238,19 @@ if [[ $PRESET ]]; then done cleanup 0 else - die "Preset $PRESET does not exist. Exiting." + die "Preset not found: \`%s'" "$PRESET" fi fi if [[ $GENIMG ]]; then IMGPATH=$(readlink -f "$GENIMG") if [[ -z $IMGPATH || ! -w ${IMGPATH%/*} ]]; then - die "error: unable to write to path: '$GENIMG'" + die "error: unable to write to path: \`%s'" "$GENIMG" fi fi if [[ ! -f "$CONFIG" ]]; then - die "config file '$CONFIG' cannot be found, aborting..." + die "Config file does not exist: \`%s'" " $CONFIG" fi . "$CONFIG" |