Skip to content

Commit

Permalink
[install] Move the _THEOS_PACKAGE_LAST_VERSION check into the rule bo…
Browse files Browse the repository at this point in the history
…dy 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
  • Loading branch information
dhowett committed Mar 30, 2011
1 parent 5cbf992 commit dd18882
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions 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)" "/"
Expand Down
14 changes: 8 additions & 6 deletions makefiles/targets/_common/install_deb_remote.mk
Expand Up @@ -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)" "/"
Expand Down

0 comments on commit dd18882

Please sign in to comment.