diff options
author | 2009-04-11 18:59:22 +0000 | |
---|---|---|
committer | 2009-04-11 18:59:22 +0000 | |
commit | 40c14825fa074a4b9660371d64b78a6cae1e97e3 (patch) | |
tree | c37a948b1779309d4badd6970b789cf757006155 /bin | |
parent | MITRE sync (diff) | |
download | security-40c14825fa074a4b9660371d64b78a6cae1e97e3.tar.gz security-40c14825fa074a4b9660371d64b78a6cae1e97e3.tar.bz2 security-40c14825fa074a4b9660371d64b78a6cae1e97e3.zip |
Add script to apply pkgmoves to glsas
svn path=/; revision=1264
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkgmove-glsa.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/pkgmove-glsa.sh b/bin/pkgmove-glsa.sh new file mode 100755 index 0000000..da7dbac --- /dev/null +++ b/bin/pkgmove-glsa.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +UPDATESDIR="/usr/portage/profiles/updates" +GLSADIR="/dev/shm/glsa" + +THISYEAR="`date +%Y`" + +year=2004 + +while [ $year -le $THISYEAR ] ; do + + for file in "$UPDATESDIR"/[1-4]Q-"$year" ; do + [ ! -e "$file" ] && continue + echo `basename "$file"` + + replace="" + + while read LINE ; do + FROM=`echo $LINE | cut -d " " -f 2` + TO=`echo $LINE | cut -d " " -f 3` + replace="$replace -e s:$FROM\(\"\|&\|-[0-9]\):$TO\1:g" + done < <(grep "^move " "$file") + sed -i $replace "$GLSADIR"/glsa-*xml + done + + let year=year+1 +done + |