Skip to content

Instantly share code, notes, and snippets.

@tcooper
Created June 4, 2019 21:22
Show Gist options
  • Save tcooper/73b12157569fc4acd1ce770c2bcc05e4 to your computer and use it in GitHub Desktop.
Save tcooper/73b12157569fc4acd1ce770c2bcc05e4 to your computer and use it in GitHub Desktop.
Display additional information about installed and enabled Rocks rolls
#!/bin/sh
ROLL_VERS="$(rocks list roll | awk '/ yes/{print $1,$2}' | sed 's/://g')"
printf " roll ; version ; release ; date\n"
while IFS= read
do
roll=$(echo $REPLY | awk '{print $1}')
vers=$(echo $REPLY | awk '{print $2}')
printf "%14s ; " $roll;
roll_info=$(grep release /export/rocks/install/rolls/$roll/$vers/x86_64/roll-$roll.xml | sed 's,\t<info ,,g;s,/>,,g;s,",,g;s,version=,,g;s,release=,,g;s,arch=,,g;s,os=,,g' | awk '{print $1" "$2}')
roll_date=$(awk -F= '/timestamp/ {print $3,$2,$4}' /export/rocks/install/rolls/$roll/$vers/x86_64/roll-$roll.xml | awk -F\" '{print $2,$4,$6}')
printf "%7s ; %14s ; %30s\n" $roll_info "$roll_date"
done <<< "$ROLL_VERS"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment