[PATCH] check vigorously for installed mkimage

Michael Shigorin mike на altlinux.org
Чт Янв 5 00:30:56 MSK 2012


It was briefly mentioned in QUICKSTART but somehow managed
to evade the commandlines provided.  And while at it, let's
make errors like this more explicit to avoid extra lookups.
Oh, and fix QUICKSTART so that readers miss the hassle. :)

Thanks Vladimir Karpinsky for pointing this problem out.
---
 QUICKSTART        |    2 +-
 image.in/Makefile |    6 +++++-
 lib/build.mk      |    8 ++++----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/QUICKSTART b/QUICKSTART
index ae03404..113c34d 100644
--- a/QUICKSTART
+++ b/QUICKSTART
@@ -15,7 +15,7 @@
 п╨п╬п╪п╟п╫п╢я▀
 ~~~~~~~
 - п╬я┌ п╦п╪п╣п╫п╦ root:
-# apt-get install hasher git-core
+# apt-get install mkimage hasher git-core
 # hasher-useradd USER
 
 - п╬я┌ п╦п╪п╣п╫п╦ п©п╬п╩я▄п╥п╬п╡п╟я┌п╣п╩я▐ (п©п╬я│п╩п╣ п©п╬п╡я┌п╬я─п╫п╬пЁп╬ п╡я┘п╬п╢п╟):
diff --git a/image.in/Makefile b/image.in/Makefile
index 7455585..a722c9a 100644
--- a/image.in/Makefile
+++ b/image.in/Makefile
@@ -10,8 +10,10 @@ MKI_VER_OPTIMAL = 0.2.0
 
 include distcfg.mk
 include functions.mk
-include $(MKIMAGE_PREFIX)/config.mk
 
+ifeq (,$(realpath $(MKIMAGE_PREFIX)/config.mk))
+$(error please apt-get install mkimage and have a look at QUICKSTART as well)
+endif
 ifeq (-,$(shell rpmvercmp $(MKI_VERSION) $(MKI_VER_MINIMAL) | tr -d [0-9]))
 $(info error: mkimage-$(MKI_VERSION) is too old, please upgrade)
 $(error mkimage is too old, $(MKI_VER_MINIMAL) is minimal supported version)
@@ -21,6 +23,8 @@ $(info warning: mkimage-$(MKI_VERSION) is suboptimal, consider upgrading)
 $(warning consider upgrading mkimage to $(MKI_VER_OPTIMAL) or better)
 endif
 
+include $(MKIMAGE_PREFIX)/config.mk
+
 # reconstruct instead of passing yet another variable
 IMAGE_LINK := $(IMAGE_NAME).$(IMAGE_TYPE)
 IMAGE_OUTFILE := $(IMAGE_NAME)-$(DATE)-$(ARCH).$(IMAGE_TYPE)
diff --git a/lib/build.mk b/lib/build.mk
index 839adb7..fa26a56 100644
--- a/lib/build.mk
+++ b/lib/build.mk
@@ -45,8 +45,8 @@ build-image: profile/populate
 	if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
 		echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \
 		tail -200 "$(BUILDLOG)" $(SHORTEN) \
-		| GREP_COLOR="$(ANSI_OK)" \
-		  grep --color=auto '^\*\* image: .*' ||:; \
+		| GREP_COLOR="$(ANSI_OK)" GREP_OPTIONS="--color=auto" \
+		  grep '^\*\* image: .*' ||:; \
 	else \
 		echo -n "$(TIME) failed, see log"; \
 		if [ -z "$(DEBUG)" ]; then \
@@ -56,8 +56,8 @@ build-image: profile/populate
 			echo " above"; \
 		fi; \
 		tail -200 "$(BUILDLOG)" \
-		| GREP_COLOR="$(ANSI_FAIL)" \
-		  egrep --color=auto "^(E:|[Ee]rror|[Ww]arning).*"; \
+		| GREP_COLOR="$(ANSI_FAIL)" GREP_OPTIONS="--color=auto" \
+		  egrep "^((E:|[Ee]rror|[Ww]arning).*)|(.* Stop\.)$$"; \
 		df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
 			{ print "NB: low space on "$$6" ("$$5" used)"}}'; \
 	fi; \
-- 
1.7.7.5


--7JfCtLOvnd9MIVvH--


Подробная информация о списке рассылки community