#!/bin/bash # # grab and compare slackware tag file changes # enable as a weekly cron job # # breaks somewhere in between the diff release loop (probably when there's no diff at all) #set -e mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/ [[ -n $2 ]] && date=$2 || date=`date +%Y-%m-%d` echo current is $date base=/data/www/lab.nethence.com/tagfiles release=150 releasepath=$base/$release [[ ! -d $base/ ]] && echo $base/ not found && exit 1 echo echo checking tag file changes between $release and current echo if [[ -n $1 ]]; then last=$1 lastpath=$base/$last else lastpath=`find $base/ -maxdepth 1 -type d | \ grep -E '[[:digit:]]+-[[:digit:]]+-[[:digit:]]+' | \ sort | tail -1` # w/ timestamp # find . -type d -maxdepth 1 -printf '%T@ %p\n' #last=$base/2021-03-01 last=${lastpath##*/} fi echo last is $last # BUG date vs. path #[[ $date = $last ]] && echo try next week && exit 1 if [[ ! -d $base/$release/ ]]; then mkdir $base/$release/ cd $base/$release/ for set in a ap d e f k kde l n t tcl x xap xfce y; do wget -q -O - $mirror/slackware64-15.0/slackware64/$set/tagfile > tagfile-$set done; unset set cd ../ fi if [[ -d $base/$date/ ]]; then echo $base/$date/ already else mkdir $base/$date/ cd $base/$date/ for set in a ap d e f k kde l n t tcl x xap xfce y; do wget -q -O - $mirror/slackware64-current/slackware64/$set/tagfile > tagfile-$set done; unset set cd ../ fi # since last release for set in a ap d e f k kde l n t tcl x xap xfce y; do diff -bu $releasepath/tagfile-$set $date/tagfile-$set done > $date-since-$release.txt; unset set # since last week for set in a ap d e f k kde l n t tcl x xap xfce y; do diff -bu $lastpath/tagfile-$set $date/tagfile-$set done > $date-since-$last.txt; unset set cat <