8 echo "Usage: $0 filename version arch changes_file"
12 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
15 INPUT="$1" # Tarball to read, compressed with gzip
18 CHANGES="$4" # Changes file for the upload
25 # Get the target suite from the Changes file
26 # NOTE: it may be better to pass this to the script as a parameter!
27 SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')"
30 error "Error: unable to determine suite from Changes file"
33 : # OK for automated byband processing
36 error "Reject: task overrides can only be processed automatically for uploads to unstable"
41 # Regular expression used to validate tag lines
42 CHECKRE='^[a-z0-9A-Z.+-]+[[:space:]]+Task[[:space:]]+[a-z0-9:. ,{}+-]+$'
44 # This must end with /
45 TARGET=/srv/ftp-master.debian.org/scripts/external-overrides/
47 # Read the main directory from the tarball
48 DIR="`tar ztf \"$INPUT\" | tac | tail -n 1`"
50 # Create temporary files where to store the validated data
52 OUTMAIN="`mktemp \"$TARGET\"task.new.XXXXXX`"
54 # If we fail somewhere, cleanup the temporary files
60 # Extract the data into the temporary files
61 tar -O -zxf "$INPUT" "$DIR"task | grep -E "$CHECKRE" > "$OUTMAIN"
63 # Move the data to the final location
64 mv "$OUTMAIN" "$TARGET"task
66 chmod 644 "$TARGET"task
68 dak external-overrides import unstable main Task <"$TARGET"task
69 dak external-overrides copy unstable testing