| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 | ## Debian stuff## specific aliasesalias lintian="lintian --color=auto -IEm --pedantic"# building environementscow-dist () {    if [ $# -lt 2 ]; then        echo "Error args."        return    fi    DIST=$1    shift    OPTS=    if [ "$1" = "--update" ]; then        OPTS="--no-cowdancer-update"    elif [ "$1" = "--build" -a -z "$2" ]; then        if [ -f debian/changelog ]; then            dsc=$(egrep -v "^([[:space:]]+|$)" debian/changelog| \                sed 's/\([^ ]*\) (\([^)]*\)).*/..\/\1_\2.dsc/'|head -1)            if [ -f "$dsc" ]; then                OPTS="$dsc"            fi        fi    fi    sudo DIST=$DIST cowbuilder $@ $OPTS    return $?}alias cow-sid32="cow-dist sid32"alias cow-stable32="cow-dist stable32"alias cow-sid64="cow-dist sid64"alias cow-stable64="cow-dist stable64"alias cow-stable-bpo="cow-dist stable-bpo"# toolsapt-rbdepends () {    grep-dctrl -F Build-Depends "$1" -s Package /var/lib/apt/lists/*_Sources}pdebdiff() {    if [ ! -r debian/changelog ]; then        echo "ERR: can't read debian/changelog"        exit    fi     egrep -v "^([[:space:]]+|$)" debian/changelog | \        sed 's/[^ ]* (\([^)]*\)).*/\1/' | \        head -n2|tr '\n' $IFS | \        read v1 v2   if [ -z "$v1" -o -z "$v2" ]; then        echo "ERR: can't find version \$n and \$n-1 of the package";        exit    fi    if [ ! -r debian/control ]; then        echo "ERR: can't read debian/control"        exit    fi    egrep '^(Package|Architecture): ' debian/control | \        while read line ; do            pkg=$(echo $line|sed 's/Package: //')            read line            arch=$(echo $line|sed 's/Architecture: //')            if [ $arch = 'any' ]; then                arch=$(dpkg-architecture -qDEB_HOST_ARCH)            fi            (                echo "*** DIFF ${pkg}_${v2} -> ${pkg}_${v1} ***"                echo                debdiff ../${pkg}_${v2}_${arch}.deb ../${pkg}_${v1}_${arch}.deb            )|$PAGER    done}pdeblint() {    if [ ! -r debian/changelog ]; then        echo "ERR: can't read debian/changelog"        exit    fi    v=$(egrep -v "^([[:space:]]+|$)" debian/changelog | \        sed 's/[^ ]* (\([^)]*\)).*/\1/' | \        head -n1)    if [ ! -r debian/control ]; then        echo "ERR: can't read debian/control"        exit    fi    pkg=$(grep '^Source: ' debian/control | sed 's/Source: //')    arch=$(dpkg-architecture -qDEB_HOST_ARCH)    changes="../${pkg}_${v}_${arch}.changes"    if [ ! -r "$changes" ]; then        echo "ERR: can't read changes file : ${changes}"        exit    fi    lintian --color=auto -IEm --pedantic $changes $@}
 |