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