Skip to content

Commit

Permalink
Adjust how overall pkg version is calculated so that the last portion…
Browse files Browse the repository at this point in the history
… is never higher than any component version's last section
  • Loading branch information
gregneagle committed Mar 17, 2016
1 parent 20cf3bd commit 6bfa71d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions code/tools/make_munki_mpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,34 +120,39 @@ cd "$MUNKIROOT"
GITREV=`git log -n1 --format="%H" -- code/client`
GITREVINDEX=`git rev-list --count $GITREV`
SVNREV=$(($GITREVINDEX + $MAGICNUMBER))
MPKGSVNREV=$SVNREV
VERSION=$MUNKIVERS.$SVNREV

# get a psuedo-svn revision number for the apps pkg
APPSGITREV=`git log -n1 --format="%H" -- code/apps`
GITREVINDEX=`git rev-list --count $APPSGITREV`
APPSSVNREV=$(($GITREVINDEX + $MAGICNUMBER))
if [ $APPSSVNREV -gt $MPKGSVNREV ] ; then
MPKGSVNREV=$APPSSVNREV
fi
# get base apps version from MSC.app
APPSVERSION=`defaults read "$MUNKIROOT/code/apps/Managed Software Center/Managed Software Center/Managed Software Center-Info" CFBundleShortVersionString`
# append the APPSSVNREV
APPSVERSION=$APPSVERSION.$APPSSVNREV

# get a psuedo-svn revision number for the metapackage
MPKGGITREV=`git log -n1 --format="%H"`
GITREVINDEX=`git rev-list --count $MPKGGITREV`
MPKGSVNREV=$(($GITREVINDEX + $MAGICNUMBER))
MPKGVERSION=$MUNKIVERS.$MPKGSVNREV

# get a pseudo-svn revision number for the launchd pkg
LAUNCHDGITREV=`git log -n1 --format="%H" -- launchd`
GITREVINDEX=`git rev-list --count $LAUNCHDGITREV`
LAUNCHDSVNREV=$(($GITREVINDEX + $MAGICNUMBER))
if [ $LAUNCHDSVNREV -gt $MPKGSVNREV ] ; then
MPKGSVNREV=$LAUNCHDSVNREV
fi
# Get launchd version if different
LAUNCHDVERSION=$MUNKIVERS
if [ -e "$MUNKIROOT/launchd/version.plist" ]; then
LAUNCHDVERSION=`defaults read "$MUNKIROOT/launchd/version" CFBundleShortVersionString`
fi
LAUNCHDVERSION=$LAUNCHDVERSION.$LAUNCHDSVNREV

# get a psuedo-svn revision number for the metapackage
MPKGVERSION=$MUNKIVERS.$MPKGSVNREV


MPKG="$OUTPUTDIR/munkitools-$MPKGVERSION.pkg"

if [ $(id -u) -ne 0 ]; then
Expand Down

1 comment on commit 6bfa71d

@homebysix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.