From dd18882cdb0fc3c2c114585e7c0e753c4cd1ccbf Mon Sep 17 00:00:00 2001 From: dhowett Date: Wed, 30 Mar 2011 05:27:55 +0000 Subject: [PATCH] [install] Move the _THEOS_PACKAGE_LAST_VERSION check into the rule body itself. Checking the variable with a make conditional excludes the package install rules even if you 'make package install', making it report instead that you didn't build a package. Also add a 'does the last package we built even exist?' check. git-svn-id: http://svn.howett.net/svn/theos/trunk@412 4410221e-0ddf-4ce3-99c0-2db6c0dbc727 --- makefiles/targets/_common/install_deb_local.mk | 14 ++++++++------ makefiles/targets/_common/install_deb_remote.mk | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/makefiles/targets/_common/install_deb_local.mk b/makefiles/targets/_common/install_deb_local.mk index 329b54f238..e5c3d5c035 100644 --- a/makefiles/targets/_common/install_deb_local.mk +++ b/makefiles/targets/_common/install_deb_local.mk @@ -1,14 +1,16 @@ export TARGET_REMOTE := 0 ifeq ($(_THEOS_CAN_PACKAGE),1) -ifeq ($(_THEOS_PACKAGE_LAST_VERSION),none) -internal-install:: - $(info $(MAKE) install requires that you build a package before you try to install it.) - @exit 1 -else # _THEOS_PACKAGE_LAST_VERSION internal-install:: + @if [[ "$(_THEOS_PACKAGE_LAST_VERSION)" == "none" ]]; then \ + echo "$(MAKE) install requires that you build a package before you try to install it." >&2; \ + exit 1; \ + fi + @if [[ ! -f "$(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb" ]]; then \ + echo "Could not find \"$(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb\" to install. Aborting." >&2; \ + exit 1; \ + fi install.exec "dpkg -i $(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb" -endif # _THEOS_PACKAGE_LAST_VERSION else # _THEOS_CAN_PACKAGE internal-install:: stage install.mergeDir "$(THEOS_STAGING_DIR)" "/" diff --git a/makefiles/targets/_common/install_deb_remote.mk b/makefiles/targets/_common/install_deb_remote.mk index c58d88f249..eef48882e2 100644 --- a/makefiles/targets/_common/install_deb_remote.mk +++ b/makefiles/targets/_common/install_deb_remote.mk @@ -11,15 +11,17 @@ THEOS_DEVICE_PORT ?= 22 export THEOS_DEVICE_IP THEOS_DEVICE_PORT ifeq ($(_THEOS_CAN_PACKAGE),1) -ifeq ($(_THEOS_PACKAGE_LAST_VERSION),none) -internal-install:: - $(info $(MAKE) install requires that you build a package before you try to install it.) - @exit 1 -else # _THEOS_PACKAGE_LAST_VERSION internal-install:: + @if [[ "$(_THEOS_PACKAGE_LAST_VERSION)" == "none" ]]; then \ + echo "$(MAKE) install requires that you build a package before you try to install it." >&2; \ + exit 1; \ + fi + @if [[ ! -f "$(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb" ]]; then \ + echo "Could not find \"$(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb\" to install. Aborting." >&2; \ + exit 1; \ + fi install.copyFile "$(THEOS_PACKAGE_DIR)/$(THEOS_PACKAGE_FILENAME).deb" "$(THEOS_PACKAGE_FILENAME).deb" install.exec "dpkg -i $(THEOS_PACKAGE_FILENAME).deb" -endif # _THEOS_PACKAGE_LAST_VERSION else # _THEOS_CAN_PACKAGE == 0 internal-install:: stage install.mergeDir "$(THEOS_STAGING_DIR)" "/"