From 94ed99228df3b498a690a862deaff76e130d788d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Mon, 4 Jan 2016 22:44:44 +0100 Subject: [PATCH] Create archive serial --- config/debian-security/make-mirror.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/config/debian-security/make-mirror.sh b/config/debian-security/make-mirror.sh index ebbdec40..8293d711 100755 --- a/config/debian-security/make-mirror.sh +++ b/config/debian-security/make-mirror.sh @@ -2,13 +2,23 @@ set -e -LANG=C -LC_ALL=C +LANG=C.UTF-8 +LC_ALL=C.UTF-8 +TRACEFILE=/srv/security-master.debian.org/ftp/project/trace/security-master.debian.org echo "Regenerating \"public\" mirror/ hardlink fun" -date -u > /srv/security-master.debian.org/ftp/project/trace/security-master.debian.org -echo "Using dak v1" >> /srv/security-master.debian.org/ftp/project/trace/security-master.debian.org -echo "Running on host: $(hostname -f)" >> /srv/security-master.debian.org/ftp/project/trace/security-master.debian.org + +DATE_SERIAL=$(date +"%Y%m%d01") +FILESOAPLUS1=$(awk '/serial/ { print $3+1 }' ${TRACEFILE} || echo ${DATE_SERIAL} ) +if [[ ${DATE_SERIAL} -gt ${FILESOAPLUS1} ]]; then + SERIAL="${DATE_SERIAL}" +else + SERIAL="${FILESOAPLUS1}" +fi +date -u > ${TRACEFILE} +echo "Using dak v1" >> ${TRACEFILE} +echo "Running on host: $(hostname -f)" >> ${TRACEFILE} +echo "Archive serial: ${SERIAL}" >> ${TRACEFILE} cd /srv/security-master.debian.org/ftp/project/trace/ ln -sf security-master.debian.org master cd /srv/security.debian.org/archive/debian-security/ -- 2.39.5