maestrodev / puppet-android

A Puppet module to install the android SDK
22 stars 40 forks source link

Found a way to update packages to certain revision, pull request? #34

Open Hoodoo opened 9 years ago

Hoodoo commented 9 years ago

Hi!

I've been using your module for a while to support a dozen Linux build servers with Android SDK.

We have some legacy apps to support, so we need different versions of build tools, and the developers would often ask me to update this or that package (but not all of them).

To keep track on this, I've tweaked package.pp adding $revision parameter and an unless for exec:

unless  => "grep 'Pkg.Revision=${revision}' ${creates}/source.properties",

So my Android SDK definition looks a bit noisier:

  android::platform { 'android-13': revision => '1' }
  android::platform { 'android-12': revision => '3' }
  android::platform { 'android-11': revision => '2' }
  android::platform { 'android-10': revision => '2' }

  android::extra { 'extra-android-m2repository':              revision => '14.0.0' }
  android::extra { 'extra-android-support':                   revision => '22.1.1' }
  android::extra { 'extra-google-admob_ads_sdk':              revision => '11.0.0' }
  android::extra { 'extra-google-analytics_sdk_v2':           revision => '3.0.0' }
  android::extra { 'extra-google-gcm':                        revision => '3.0.0' }

It also requires some familiarity with command-line package manager, but it made the whole process A LOT easier for me as a sysadmin.

It adds one extra grep per package defined, but with around three dozens of these I'm having roughly the same agent run time as without them.

Should I create a pull request for that or does it make things unnecessarily complicated?

carlossg commented 9 years ago

I'm not using the module at this moment, so maybe someone else can chime in