7 echo "Usage: $0 filename version arch changes_file"
11 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
14 INPUT="$1" # Tarball to read, compressed with gzip
17 CHANGES="$4" # Changes file for the upload
24 # Get the target suite from the Changes file
25 # NOTE: it may be better to pass this to the script as a parameter!
26 SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')"
29 error "Error: unable to determine suite from Changes file"
32 : # OK for automated byband processing
35 error "Reject: task overrides can only be processed automatically for uploads to unstable"
40 # Regular expression used to validate tag lines
41 CHECKRE='^[a-z0-9A-Z.+-]+[[:space:]]+Task[[:space:]]+[a-z0-9:. ,{}+-]+$'
43 # This must end with /
44 TARGET=/srv/ftp-master.debian.org/scripts/external-overrides/
46 # Read the main directory from the tarball
47 DIR="`tar ztf \"$INPUT\" | tac | tail -n 1`"
49 # Create temporary files where to store the validated data
51 OUTMAIN="`mktemp \"$TARGET\"task.new.XXXXXX`"
53 # If we fail somewhere, cleanup the temporary files
59 # Extract the data into the temporary files
60 tar -O -zxf "$INPUT" "$DIR"task | grep -E "$CHECKRE" > "$OUTMAIN"
62 # Move the data to the final location
63 mv "$OUTMAIN" "$TARGET"task
65 chmod 644 "$TARGET"task
67 (cd $TARGET && $scriptsdir/mk-extra-overrides.sh)