]> git.decadent.org.uk Git - dak.git/commitdiff
byhand-tag: do not rely on a entry for the directory in the tarball
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 12 Feb 2012 15:07:02 +0000 (15:07 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 12 Feb 2012 15:07:02 +0000 (15:07 +0000)
scripts/debian/byhand-tag

index 8dfa17a6a7eff6fed905eb328118524e24530336..3e21f02501fa0bc5a0e28a3d81a4d46322b4f386 100755 (executable)
@@ -16,7 +16,7 @@ CHECKRE='^[a-z0-9A-Z.+-]+[[:space:]]+Tag[[:space:]]+[a-z0-9:. ,{}+-]+$'
 TARGET=/srv/ftp-master.debian.org/scripts/external-overrides/
 
 # Read the main directory from the tarball
-DIR="`tar ztf \"$INPUT\" | tac | tail -n 1`"
+DIR="`tar ztf \"$INPUT\" | tail -n 1 | cut -d/ -f1`"
 
 # Create temporary files where to store the validated data
 umask 002
@@ -33,9 +33,9 @@ cleanup() {
 trap cleanup EXIT
 
 # Extract the data into the temporary files
-tar -O -zxf "$INPUT" "$DIR"tag | grep -E "$CHECKRE" > "$OUTMAIN"
-tar -O -zxf "$INPUT" "$DIR"tag.contrib | grep -E "$CHECKRE" > "$OUTCONTRIB"
-tar -O -zxf "$INPUT" "$DIR"tag.non-free | grep -E "$CHECKRE" > "$OUTNONFREE"
+tar -O -zxf "$INPUT" "$DIR"/tag | grep -E "$CHECKRE" > "$OUTMAIN"
+tar -O -zxf "$INPUT" "$DIR"/tag.contrib | grep -E "$CHECKRE" > "$OUTCONTRIB"
+tar -O -zxf "$INPUT" "$DIR"/tag.non-free | grep -E "$CHECKRE" > "$OUTNONFREE"
 
 # Move the data to the final location
 mv "$OUTMAIN"           "$TARGET"tag