Skip to content

Instantly share code, notes, and snippets.

@busches
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save busches/af4975a9eefbbb8e3ca7 to your computer and use it in GitHub Desktop.
Save busches/af4975a9eefbbb8e3ca7 to your computer and use it in GitHub Desktop.
Change log of nightlies
export WORKSPACE=/home/scott/Dropbox/CM
export CHANGESPATH=$WORKSPACE/CHANGES-$(date -u +%Y%m%d).txt
rm $CHANGESPATH 2>/dev/null
# export CM_NIGHTLY
# get the name of the file we just built
lastBuild=$(ls -lt $WORKSPACE/cm*.zip | sed -e "s/ / /" | cut -d ' ' -f9 | head -1)
echo $lastBuild
# get the name of the file we built prior to that
prevBuild=$(ls -lt $WORKSPACE/cm*.zip | sed -e "s/ / /" | cut -d ' ' -f9 | sed -n -e '2{p;q}')
echo $prevBuild
# get timestamps of files
ts=$(stat $lastBuild | grep 'Change: ' | cut -d ' ' -f2,3,4)
if [ -z "$prevBuild" ]; then
prevts=
else
prevts=$(stat $prevBuild | grep 'Change: ' | cut -d ' ' -f2,3,4)
fi
if [[ "$prevts" == "$ts" ]]; then
prevts=
fi
# we must navigate to where the repo is
cd $ANDROID_BUILD_TOP
export ts
export prevts
(echo "==================================="
echo -n "Since ";date -d "$ts"
echo "==================================="
if [ -z "$prevts" ]; then
echo "This is the first CyanogenMod build of this type for device $CM_BUILD" >> $CHANGESPATH
else
repo forall -c 'L=$(git log --oneline --since "$prevts" --until "$ts" -n 1); if [ "n$L" != "n" ]; then echo; echo " * $REPO_PATH"; git log --oneline --since "$prevts" --until "$ts"; fi';
# repo forall -c 'echo git log --oneline --since "$prevts" --until "$ts" -n 1';
fi
echo) >> $CHANGESPATH
echo "All done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment