From: Frans Pop Date: Wed, 28 May 2008 16:32:00 +0000 (+0200) Subject: Add autobyhand support for task overrides (from tasksel) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cbeb10a6ba37c3ac530eb7b9302e89d8c575a44;p=dak Add autobyhand support for task overrides (from tasksel) --- diff --git a/ChangeLog b/ChangeLog index 05da1a9e..24b4f45b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-28 Frans Pop + + * add autobyhand support for task overrides (from tasksel) + 2008-05-27 Joerg Jaspert * config/debian/pseudo-packages.maintainers: Change ftp.debian.org diff --git a/config/debian/dak.conf b/config/debian/dak.conf index 4181fb01..2d17db46 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -692,6 +692,13 @@ AutomaticByHandPackages { Extension "tar.gz"; Script "/srv/ftp.debian.org/dak/scripts/debian/byhand-tag"; }; + + "task-overrides" { + Source "tasksel"; + Section "byhand"; + Extension "tar.gz"; + Script "/srv/ftp.debian.org/dak/scripts/debian/byhand-task"; + }; }; Dir diff --git a/scripts/debian/byhand-task b/scripts/debian/byhand-task new file mode 100755 index 00000000..b7f4f7a8 --- /dev/null +++ b/scripts/debian/byhand-task @@ -0,0 +1,37 @@ +#!/bin/sh -ue + +# Tarball to read, compressed with gzip +INPUT="${1:?"Usage: $0 filename"}" + +# Regular expression used to validate tag lines +CHECKRE='^[a-z0-9A-Z.+-]+[[:space:]]+Task[[:space:]]+[a-z0-9:. ,{}+-]+$' + +# This must end with / +TARGET=/srv/ftp.debian.org/scripts/external-overrides/ + +# Read the main directory from the tarball +DIR="`tar ztf \"$INPUT\" | tac | tail -n 1`" + +# Create temporary files where to store the validated data +umask 002 +OUTMAIN="`mktemp \"$TARGET\"task.new.XXXXXX`" + +# If we fail somewhere, cleanup the temporary files +cleanup() { + rm -f "$OUTMAIN" +} +trap cleanup EXIT + +# Extract the data into the temporary files +tar -O -zxf "$INPUT" "$DIR"task | grep -E "$CHECKRE" > "$OUTMAIN" + +# Move the data to the final location +mv "$OUTMAIN" "$TARGET"task + +chmod 644 "$TARGET"task + +(cd $TARGET && ./mk-extra-overrides.sh) + +trap - EXIT + +exit 0