XBuddy: latest-local image + fix xbuddy_list bug
Serve the latest-local image for a given board.
Symlinks the image directory to a corresponding directory in the devserver
/static folder, and deletes the symlinked file when past
XBUDDY_CAPACITY.
ALSO: fix lexicographic sorting of time stamps + pretty print
xbuddy_list
BUG=chromium:252941
BUG=chromium:252942
TEST=Manual
Either run ./build_image more than 5 times, or call
http://{your_ip}:8080/xbuddy?path=x86-generic/latest-local/test
on over 5 different boards.
WARNING: xBuddy's cache management is on, so this may delete some of
the images currently in your build/images directory.
Should correctly serve the test image every time, and delete the last
referenced image (and its corresponding timestamp file) from disk.
Locally built images and images downloaded from GS count equivalently.
i.e. There should never be more than 5 at any given time.
Change-Id: I2f5c4e2d67365f3523ddfdeec2ddedbd38009e32
Reviewed-on: https://gerrit.chromium.org/gerrit/60707
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/common_util.py b/common_util.py
index 20cbed0..29cb8f1 100644
--- a/common_util.py
+++ b/common_util.py
@@ -42,6 +42,9 @@
def GetLatestBuildVersion(static_dir, target, milestone=None):
"""Retrieves the latest build version for a given board.
+ Searches the static_dir for builds for target, and returns the highest
+ version number currently available locally.
+
Args:
static_dir: Directory where builds are served from.
target: The build target, typically a combination of the board and the