Check for both new and old shflags during stateful update

BUG=chromium-os:21966
TEST=perform an update from an old build that doesn't have dev-util/shflags
installed to a current tot build

Change-Id: I999e49f658b99302b591450bf3c3788181408a91
Reviewed-on: http://gerrit.chromium.org/gerrit/10533
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
diff --git a/stateful_update b/stateful_update
index 02727ad..fc83b61 100755
--- a/stateful_update
+++ b/stateful_update
@@ -7,7 +7,16 @@
 # This scripts performs update of stateful partition directories useful for
 # dev_mode.
 
-. /usr/share/misc/shflags
+# in order to support developers going from older images with the old shflags
+# we'll check for both new shflags and old shflags
+if [ -f /usr/share/misc/shflags ] ; then
+  . /usr/share/misc/shflags
+elif [ -f /usr/lib/shflags ] ; then
+  . /usr/lib/shflags
+else
+  echo >&2 "$0 Unable to source shflags"
+  exit 1
+fi
 
 # Constants for states.
 CLEAN_STATE="clean"