aboutsummaryrefslogtreecommitdiff
blob: d5912043e70432c1c7a6eea1b16a1ba96fd93be4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

UPDATESDIR="/var/db/repos/gentoo/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