X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fextract_changelogs;h=9a85a7dc51e8f41f6f28aead28fd549b1fa48381;hb=d6a4e32331ea9d326f0e5b5aea58fb35d37ede2f;hp=7d6f3e4769bafb894f7469b1b5c26443db6b2c80;hpb=336dcafd70ea7f5b9bf4e2f30b6c44faf973c855;p=deb%2Fpackages.git diff --git a/bin/extract_changelogs b/bin/extract_changelogs index 7d6f3e4..9a85a7d 100755 --- a/bin/extract_changelogs +++ b/bin/extract_changelogs @@ -40,13 +40,28 @@ for part in $parts; do done if [ "$successful" -eq 1 ]; then - find "${htmldir}/changelogs/" -name log -cmin +14440 \ + find -H "${htmldir}/changelogs/" -name log -cmin +14440 \ | while read logfile; do dir=$(dirname "$logfile") echo deleting $dir rm -r "$dir" rmdir --ignore-fail-on-non-empty $(dirname "$dir") done + cdir=$(pwd) + find -H "${htmldir}/changelogs/" -name current -not -xtype d \ + | while read link; do + dir=$(dirname "$link") + echo repairing current link $link + rm -v "$link" + target=$(ls -t1 "$dir" | tail -n1) + if [ -n "$target" ]; then + cd $dir && ln -sv $target current + cd $cdir + else + rmdir -v $dir + fi + done + else echo clean-up skipped because at least one of the extraction runs failed >&2 fi