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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build_image ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # Prints the path to the most recently built image to stdout. 7 # Prints the path to the most recently built image to stdout.
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
(...skipping 12 matching lines...) Expand all
23 if [ -z "$FLAGS_board" ] ; then 23 if [ -z "$FLAGS_board" ] ; then
24 echo "Error: --board required." 24 echo "Error: --board required."
25 exit 1 25 exit 1
26 fi 26 fi
27 27
28 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" 28 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}"
29 29
30 # If there are no images, return nothing 30 # If there are no images, return nothing
31 [ -d $IMAGES_DIR ] || exit 0 31 [ -d $IMAGES_DIR ] || exit 0
32 32
33 # Default to the most recent image 33 # Use latest link if it exists, otherwise most recently changed dir
34 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" 34 if [ -L ${IMAGES_DIR}/latest ] ; then
35 » DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`"
davidjames 2010/08/05 03:59:26 Please remove tabs
36 else
37 » DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
38 fi
35 39
36 echo $DEFAULT_FROM 40 echo $DEFAULT_FROM
OLDNEW
« 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