[dak/master] Various small fixups/style issues
---
config/debian/common | 18 ++++++++++--------
config/debian/cronscript | 4 ++--
config/debian/dinstall.functions | 16 +++++++++-------
config/debian/hourly.functions | 2 +-
4 files changed, 22 insertions(+), 18 deletions(-)
mode change 100644 => 100755 config/debian/common
mode change 100644 => 100755 config/debian/dinstall.functions
diff --git a/config/debian/common b/config/debian/common
old mode 100644
new mode 100755
index 6c3a5ba..21e0d48
--- a/config/debian/common
+++ b/config/debian/common
@@ -4,7 +4,7 @@
# Set $PROGRAM to a string to have it added to the output.
function log () {
local prefix=${PROGRAM:-}
- echo "$(date +"%b %d %H:%M:%S") ${HOSTNAME} ${prefix}[$$]: $@"
+ echo "$(date +"%b %d %H:%M:%S") ${HOSTNAME} ${prefix}[$$]: $*"
}
# log the message using log() but then also send a mail
@@ -12,7 +12,7 @@ function log () {
function log_error () {
log "$@"
if [[ -z ${MAILTO} ]]; then
- echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@${HOSTNAME}] ERROR [$$]" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ${MAILTO}
+ echo "$*" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@${HOSTNAME}] ERROR [$$]" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ${MAILTO}
fi
}
@@ -102,7 +102,7 @@ function make_buildd_dir () {
dak generate-releases -a build-queues >/dev/null
# Stick a last modified date in the page footer
- echo "<p>Last updated: `date -u`</p>" > ${incoming}/web/README.html
+ echo "<p>Last updated: $(date -u)</p>" > ${incoming}/web/README.html
# Tell the mirrors that we've updated
log "Pushing static for incoming.d.o"
@@ -165,9 +165,11 @@ function do_unchecked () {
if [[ ! -z ${changes} ]]; then
log "Processing files ${changes}"
- echo "${timestamp}: ${changes}" >> ${report}
- dak process-upload -a -d "$unchecked" >> ${report}
- dak process-commands -d "$unchecked" >> ${report}
+ {
+ echo "${timestamp}: ${changes}"
+ dak process-upload -a -d "$unchecked"
+ dak process-commands -d "$unchecked"
+ } >> ${report}
sync_debbugs
do_buildd
@@ -223,7 +225,7 @@ function reports() {
log "Sending information about crufty packages"
dak cruft-report -R > $webdir/cruft-report-daily.txt
dak cruft-report -R -s experimental >> $webdir/cruft-report-daily.txt
- cat $webdir/cruft-report-daily.txt | mail -a "X-Debian: DAK" -e -s "Debian archive cruft report for $(date +%D)" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ftpmaster@ftp-master.debian.org
+ mail -a "X-Debian: DAK" -e -s "Debian archive cruft report for $(date +%D)" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ftpmaster@ftp-master.debian.org < $webdir/cruft-report-daily.txt
}
function pg_timestamp() {
@@ -306,7 +308,7 @@ function stage() {
if [[ -f ${STAGEFILE} ]]; then
local stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}")
local unixtime=$(date +%s)
- local difference=$(( $unixtime - $stamptime ))
+ local difference=$(( unixtime - stamptime ))
if [[ ${difference} -ge 14400 ]]; then
log_error "Did already run ${FUNC}, stagefile exists, but that was ${difference} seconds ago. Please check."
else
diff --git a/config/debian/cronscript b/config/debian/cronscript
index 595c6b6..9a561ab 100755
--- a/config/debian/cronscript
+++ b/config/debian/cronscript
@@ -53,7 +53,7 @@ configdir=${configdir:-"/srv/ftp-master.debian.org/dak/config/debian"}
# import the general variable set. (This will overwrite configdir, but
# it is expected to have the same value)
export SCRIPTVARS=${configdir}/vars
-. $SCRIPTVARS
+. ${SCRIPTVARS}
# One arg please
declare -lr ARG=${1:-"meh"}
@@ -71,7 +71,7 @@ case ${ARG} in
${POSSIBLEARGS})
# Only one of me should ever run.
FLOCKER=${FLOCKER:-""}
- [ "${FLOCKER}" != "${configdir}/${PROGRAM}.tasks" ] && exec env FLOCKER="${configdir}/${PROGRAM}.tasks" flock -E 0 -en "${configdir}/${PROGRAM}.tasks" "$0" "$@" || :
+ [[ ${FLOCKER} != ${configdir}/${PROGRAM}.tasks ]] && exec env FLOCKER="${configdir}/${PROGRAM}.tasks" flock -E 0 -en "${configdir}/${PROGRAM}.tasks" "$0" "$@" || :
;;
*)
cat - <<EOF
diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions
old mode 100644
new mode 100755
index 6fc9f45..3bb5f09
--- a/config/debian/dinstall.functions
+++ b/config/debian/dinstall.functions
@@ -105,7 +105,7 @@ function i18n1() {
# Now check if we still know about the packages for which they created the files
# is the timestamp signed by us?
- if $(gpgv --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg timestamp.gpg timestamp); then
+ if gpgv --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg timestamp.gpg timestamp; then
# now read it. As its signed by us we are sure the content is what we expect, no need
# to do more here. And we only test -d a directory on it anyway.
TSTAMP=$(cat timestamp)
@@ -152,7 +152,7 @@ function dep11() {
for comp in main contrib non-free; do
mkdir -p ${ftpdir}/dists/${dir}/${comp}/dep11
cd ${dir}/${comp}
- rsync -aq --delete --delete-after --exclude *.tmp . ${ftpdir}/dists/${dir}/${comp}/dep11/.
+ rsync -aq --delete --delete-after --exclude ./*.tmp . ${ftpdir}/dists/${dir}/${comp}/dep11/.
cd ${dep11dir}
done
fi
@@ -479,10 +479,12 @@ function mirror() {
fi
RFC822DATE=$(LC_ALL=POSIX LANG=POSIX date -u -R)
date -u > ${TRACEFILE}
- echo "Using dak v1" >> ${TRACEFILE}
- echo "Running on host: $(hostname -f)" >> ${TRACEFILE}
- echo "Archive serial: ${SERIAL}" >> ${TRACEFILE}
- echo "Date: ${RFC822DATE}" >> ${TRACEFILE}
+ {
+ echo "Using dak v1"
+ echo "Running on host: $(hostname -f)"
+ echo "Archive serial: ${SERIAL}"
+ echo "Date: ${RFC822DATE}"
+ } >> ${TRACEFILE}
# Now make it accessible via one name, no matter on which host we run
cd ${archiveroot}/project/trace/
ln -sf ftp-master.debian.org master
@@ -651,7 +653,7 @@ function savetimestamp() {
}
function maillogfile() {
- cat "$LOGFILE" | mail -a "X-Debian: DAK" -s "Log for dinstall run of ${NOW}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" cron@ftp-master.debian.org
+ mail -a "X-Debian: DAK" -s "Log for dinstall run of ${NOW}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" cron@ftp-master.debian.org < "${LOGFILE}"
}
function testingsourcelist() {
diff --git a/config/debian/hourly.functions b/config/debian/hourly.functions
index ec713d8..dd13ba7 100644
--- a/config/debian/hourly.functions
+++ b/config/debian/hourly.functions
@@ -66,7 +66,7 @@ function builddautosigning() {
exec >>/dev/null 2>&1
DATE=$(date -Is)
- cat "${BUILDDFUN}" | mail -a "X-Debian: DAK" -e -s "[${HOSTNAME}] Buildd key changes ${DATE}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" buildd-keys@ftp-master.debian.org
+ mail -a "X-Debian: DAK" -e -s "[${HOSTNAME}] Buildd key changes ${DATE}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" buildd-keys@ftp-master.debian.org < "${BUILDDFUN}"
rm -f "${BUILDDFUN}"
}
--
2.1.4
Reply to: