← Back to team overview

yellow team mailing list archive

[Merge] lp:~makyo/juju-gui/test-make into lp:juju-gui

 

Matthew Scott has proposed merging lp:~makyo/juju-gui/test-make into lp:juju-gui.

Requested reviews:
  Juju GUI Hackers (juju-gui)

For more details, see:
https://code.launchpad.net/~makyo/juju-gui/test-make/+merge/138833

Sanity check for PWD in makefile

After research, it appears PWD is not being set in certain environments, breaking new builds (sudo, in particular, does not have PWD on the whitelist of environment variables to keep).  This will ensure that PWD is not empty, resulting in root paths.  +1 from benji and gary_poster on IRC.
-- 
https://code.launchpad.net/~makyo/juju-gui/test-make/+merge/138833
Your team Juju GUI Hackers is requested to review the proposed merge of lp:~makyo/juju-gui/test-make into lp:juju-gui.
=== modified file 'Makefile'
--- Makefile	2012-12-07 19:20:15 +0000
+++ Makefile	2012-12-07 22:08:22 +0000
@@ -33,6 +33,13 @@
 DATE=$(shell date -u)
 APPCACHE=build/juju-ui/assets/manifest.appcache
 
+# Some environments, notably sudo, do not populate the PWD environment
+# variable, which is used to set $(PWD); however, getting the current
+# directory from `pwd` can get expensive, so we set it once here.
+ifeq ($(PWD),)
+	PWD=$(shell pwd)
+endif
+
 all: build-debug build-prod
 	@echo "\nDebug and production environments built."
 	@echo "Run 'make help' to list the main available targets."


Follow ups