#!/bin/bash finalPortsDirs=(/usr/src/ports/{cpan2crux,manual}Ports) d=$( find "${finalPortsDirs[@]}" -mindepth 2 "(" -name ".*" -type d -prune -false ")" -o -type d -not -name ".*" ) if [ -n "$d" ] then echo "dirs:" echo "$d" exit -1 fi l=$( find "${finalPortsDirs[@]}" -type l ) if [ -n "$l" ] then echo "links:" echo "$l" exit -1 fi if [ -d /usr/src/ports/.work ]; then rm -f /usr/src/ports/.work/{REPO,index.html} ls -1 /usr/src/ports/.work | \ while read -r s; do if [ ! -h "/usr/src/ports/.work/${s}" ]; then echo "/usr/src/ports/.work/${s} ist kein Symlink!" exit -1 fi rm /usr/src/ports/.work/$s done rmdir /usr/src/ports/.work fi mkdir /usr/src/ports/.work for dir in $(find "${finalPortsDirs[@]}" -mindepth 1 -maxdepth 1 -type d) do for file in Pkgfile .md5sum .footprint .signature do if [ ! -f $dir/$file ] then echo "$dir/$file gibt es nicht, sollte es aber!" exit -1 fi done if [ ! $(grep -c "^\s*name=" $dir/Pkgfile) -eq 1 ] then echo "$dir/Pkgfile hat \"name=..\" nicht genau ein Mal!" exit -1 fi if [ ! "$(grep "^\s*name=" $dir/Pkgfile | cut -d = -f 2)" == "$(basename "$dir")" ] then echo "$dir/Pkgfile behauptet zu $(grep "^\s*name=" $dir/Pkgfile | cut -d = -f 2) zu gehören!" exit -1 fi if [ ! $(grep -c "^\s*#\s*Maintainer:\s\+Erich Eckner, crux at eckner dot net\s*\$" $dir/Pkgfile) -eq 1 ] then echo "$dir/Pkgfile behauptet nicht von Erich gepflegt zu werden!" exit -1 fi if [ ! $(grep -c "\susr/man/" $dir/.footprint) -eq 0 ] then echo "$dir erzeugt Manpages in /usr/man statt /usr/share/man!" exit -1 fi ergs="$(prtverify $dir)" if [ -n "$ergs" ] then echo "prtverify meckert $dir an:" echo "$ergs" exit -1 fi signErr="$( cd $dir if ! signify -C -x .signature &> /dev/null then sudo -u pkgmk fakeroot pkgmk -cs 2>&1 | \ grep -v '^=======> Signature ok\.$' fi )" if [ -n "${signErr}" ] then >&2 echo "signify meckert $dir an:" echo "${signErr}" exit -1 fi ln -s ${dir} /usr/src/ports/.work/${dir##*/} done for file in deepthought.pub deepthought.httpup; do ln -s /usr/src/ports/{,.work/}${file} done for dir in "${finalPortsDirs[@]}"; do httpup-repgen ${dir} done for dir in "${finalPortsDirs[@]}"; do cat ${dir}/REPO done | \ sort > \ /usr/src/ports/.work/REPO git -C /usr/src/ports commit -m 'new ports uploaded' -- '*/REPO' portspage --title="Erich Eckner's CRUX Ports" --header="/usr/src/ports/head" /usr/src/ports/.work | \ grep -v ">\." | \ sed 's|/usr/src/ports/\.work/\([^/]*\)/|/\1/Pkgfile|' | \ sed 's|\(