3 # Tarball to read, compressed with gzip
4 INPUT="${1:?"Usage: $0 filename"}"
6 # Regular expression used to validate tag lines
7 CHECKRE='^[a-z0-9A-Z.+-]+[[:space:]]+Task[[:space:]]+[a-z0-9:. ,{}+-]+$'
10 TARGET=/srv/ftp.debian.org/scripts/external-overrides/
12 # Read the main directory from the tarball
13 DIR="`tar ztf \"$INPUT\" | tac | tail -n 1`"
15 # Create temporary files where to store the validated data
17 OUTMAIN="`mktemp \"$TARGET\"task.new.XXXXXX`"
19 # If we fail somewhere, cleanup the temporary files
25 # Extract the data into the temporary files
26 tar -O -zxf "$INPUT" "$DIR"task | grep -E "$CHECKRE" > "$OUTMAIN"
28 # Move the data to the final location
29 mv "$OUTMAIN" "$TARGET"task
31 chmod 644 "$TARGET"task
33 (cd $TARGET && ./mk-extra-overrides.sh)