Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: get_latest_image.sh

Issue 3014051: Create a latest link to point at newest image (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build_image ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: get_latest_image.sh
diff --git a/get_latest_image.sh b/get_latest_image.sh
index 020cadf9dca0335bedf7af4c5370bc5100977b3f..c77b44a9a5d565673268267145ae1e3568e5f50b 100755
--- a/get_latest_image.sh
+++ b/get_latest_image.sh
@@ -30,7 +30,11 @@ IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}"
# If there are no images, return nothing
[ -d $IMAGES_DIR ] || exit 0
-# Default to the most recent image
-DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
+# Use latest link if it exists, otherwise most recently changed dir
+if [ -L ${IMAGES_DIR}/latest ] ; then
+ DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`"
davidjames 2010/08/05 03:59:26 Please remove tabs
+else
+ DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
+fi
echo $DEFAULT_FROM
« no previous file with comments | « build_image ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698