[arch-projects] [mkinitcpio] [PATCH 2/3] mkinitcpio: Improve output when -T option is used.
Thomas Bächler
thomas at archlinux.org
Mon Nov 18 14:21:47 EST 2013
---
mkinitcpio | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/mkinitcpio b/mkinitcpio
index 489e199..16f1b98 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -444,19 +444,21 @@ if (( _optshowautomods )); then
cleanup 0
fi
-if [[ -z $_optgenimg ]]; then
+if [[ ( -z $_optgenimg && -z $_optsavetree ) ]]; then
msg "Starting dry run: %s" "$KERNELVERSION"
else
- # check for permissions. if the image doesn't already exist,
- # then check the directory
- if [[ ( -e $_optgenimg && ! -w $_optgenimg ) ||
- ( ! -d ${_optgenimg%/*} || ! -w ${_optgenimg%/*} ) ]]; then
- die 'Unable to write to %s' "$_optgenimg"
- fi
+ if [[ $_optgenimg ]]; then
+ # check for permissions. if the image doesn't already exist,
+ # then check the directory
+ if [[ ( -e $_optgenimg && ! -w $_optgenimg ) ||
+ ( ! -d ${_optgenimg%/*} || ! -w ${_optgenimg%/*} ) ]]; then
+ die 'Unable to write to %s' "$_optgenimg"
+ fi
- _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
- if ! type -P "$_optcompress" >/dev/null; then
- die "Unable to locate compression method: %s" "$_optcompress"
+ _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
+ if ! type -P "$_optcompress" >/dev/null; then
+ die "Unable to locate compression method: %s" "$_optcompress"
+ fi
fi
msg "Starting build: %s" "$KERNELVERSION"
@@ -498,6 +500,8 @@ ldconfig -r "$BUILDROOT" &>/dev/null
if [[ $_optgenimg ]]; then
build_image "$_optgenimg" "$_optcompress"
+elif [[ $_optsavetree ]]; then
+ msg "Build complete."
else
msg "Dry run complete, use -g IMAGE to generate a real image"
fi
--
1.8.4.2
More information about the arch-projects
mailing list