Skip to content

Instantly share code, notes, and snippets.

@brokenthumbs
Created February 13, 2014 17:20
Show Gist options
  • Save brokenthumbs/8979569 to your computer and use it in GitHub Desktop.
Save brokenthumbs/8979569 to your computer and use it in GitHub Desktop.
def service = "your-service"
def proc = "yum --showduplicates list $service".execute()
def results = proc.in.text
stringList = results.split()
list = []
for ( int i = 0; i < stringList.size() ; i++ ) {
if ( stringList[i][0].isNumber() ) {
list << service + "-" + stringList[i] + ".noarch"
}
}
return list.reverse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment