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