OSDN Git Service

envsetup: repolastsync
authorMatt Mower <mowerm@gmail.com>
Sun, 29 Dec 2013 18:57:20 +0000 (12:57 -0600)
committerSteve Kondik <steve@cyngn.com>
Sun, 4 Sep 2016 04:47:36 +0000 (21:47 -0700)
Prints date and time of last repo sync. Example:
Last repo sync: 11 Jun 2015, 21:54:59 CDT / 12 Jun 2015, 02:54:59 UTC

Change-Id: I4280b500e58237479194ad2e230ed7466db87755

envsetup.sh

index 04d5c2c..96b9789 100644 (file)
@@ -29,8 +29,9 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
 - cafremote: Add git remote for matching CodeAurora repository.
 - cmrebase:  Rebase a Gerrit change and push it again
 - mka:       Builds using SCHED_BATCH on all processors
-- mkap:     Builds the module(s) using mka and pushes them to the device.
-- cmka:     Cleans and builds using mka.
+- mkap:      Builds the module(s) using mka and pushes them to the device.
+- cmka:      Cleans and builds using mka.
+- repolastsync: Prints date and time of last repo sync.
 - reposync:  Parallel repo sync using ionice and SCHED_BATCH
 - repopick:  Utility to fetch changes from Gerrit.
 - installboot: Installs a boot.img to the connected device.
@@ -2207,6 +2208,13 @@ function cmka() {
     fi
 }
 
+function repolastsync() {
+    RLSPATH="$ANDROID_BUILD_TOP/.repo/.repo_fetchtimes.json"
+    RLSLOCAL=$(date -d "$(stat -c %z $RLSPATH)" +"%e %b %Y, %T %Z")
+    RLSUTC=$(date -d "$(stat -c %z $RLSPATH)" -u +"%e %b %Y, %T %Z")
+    echo "Last repo sync: $RLSLOCAL / $RLSUTC"
+}
+
 function reposync() {
     case `uname -s` in
         Darwin)