#!/bin/bash set -e if [ $# -eq 0 ] then $0 $( ls /usr/ports/distfiles | \ grep '^wurzel-' | \ sed 's|-[0-9.]\+\.tar\.bz2$||' | \ sort -u ) > \ "$(dirname "$0")/dateien" exit $? elif [ $# -gt 1 ] then for pkg in "$@" do echo "${pkg}" done | \ parallel "$0" exit $? fi . "/usr/ports/deepthought/$1/Pkgfile" beenden() { if [ -n "${tmpDir}" ] then rm -rf "${tmpDir}" fi exit $1 } tmpDir="$(mktemp -d)" cd "${tmpDir}" tar -xjf "/usr/ports/distfiles/${source##*/}" dateien="$( find . -type f -exec basename {} \; | \ sort )" if [ -n "$(echo "${dateien}" | uniq -d)" ] then >&2 echo "Im Paket ${name} gibt es manche Dateinamen doppelt - soetwas kann ich nicht! Ich beende." beenden 1 fi summen="$( find . -type f -exec sha512sum {} \; | \ sed 's|^\(\S\+ \).*\(/[^/]*\)$|\\(^\1.*\2$\\)\\|' | \ tr '\n' '|' | \ sed 's@\\|$@@' )" matchExpr="$( echo "${dateien}" | \ sed 's|^|-name |; s|$| -o|' | \ tr '\n' ' ' | \ sed 's| -o $||' )" ssh wurzel ' find /usr/bin texmf M/texmf -xdev -type f -exec sha512sum {} \; 2> /dev/null find / . -xdev -type f \( '"${matchExpr}"' \) -exec sha512sum {} \; 2> /dev/null ' | \ grep "${summen}" | \ sort -u | \ sed ' /texmf\|bin/{ s|^\(\S\+\)\s\+|\1 0 |; be; } /digital-server/{ s|^\(\S\+\)\s\+|\1 1 |; be; } /[sS]tyles/{ s|^\(\S\+\)\s\+|\1 2 |; be; } s|^\(\S\+\)\s\+|\1 3 |; :e ' | \ sort | \ uniq -m1 | \ cut -d' ' -f3 | \ sed 's|^\./||; s|^|'"${name}"':|' | \ sort beenden 0