1 # shell aliases and functions for PLD Developer
4 # set $dist, used by functions below
5 [ -n "$dist" ] || dist=$(awk '{print tolower($NF)}' /etc/pld-release 2>/dev/null | tr -d '()')
7 alias cv='cvs status -v'
8 alias adif="dif -x '*.m4' -x ltmain.sh -x install-sh -x depcomp -x 'Makefile.in' -x compile -x 'config.*' -x configure -x missing -x mkinstalldirs -x autom4te.cache"
9 alias pclean="sed -i~ -e '/^\(?\|=\+$\|unchanged:\|diff\|only\|Only\|Files\|Common\|Index:\|RCS file\|retrieving\)/d'"
11 alias $dist="poldek -q --sn $dist --cmd"
12 alias $dist-requires="$dist what-requires"
13 alias $dist-provides="$dist what-provides"
14 alias $dist-tag="./builder -cf -T $(echo $dist | tr '[a-z]' '[A-Z]')-branch -r HEAD"
15 alias $dist-verify=dist-verify
17 function dist-verify() {
18 poldek --sn $dist --sn $dist-ready --up
19 poldek --sn $dist --sn $dist-ready --verify=deps
23 # requires: patchutils
25 combinediff -p1 $1 $2 > m.patch || return
30 # makes diff from PLD CVS urls
33 if [ -z "$url" ]; then
34 echo >&2 "Reading STDIN"
38 echo >&2 "Process $url"
41 file=${file#*SOURCES/}
50 echo >&2 "$file: $r1 -> $r2"
53 cvs diff -u -r$r1 -r$r2 $file | tee m.patch | diffcol
55 cvs diff -u -r$r1 -r$r2 $file
59 # downloads sourceforge url from specific mirror
62 url="${url%?download}"
63 url="http://dl.${url#http://prdownloads.}"
65 local mirror="http://nchc.dl.sourceforge.net"
66 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
70 # displays latest used tag for a specfile
75 out=$(cvs status -v $s | awk "/auto-$distro-/{if (!a++) print \$1}")
82 diff -ur "$@" | diffcol | less -R
90 s,
\e,
\e[44m^[
\e[49m,g;
91 s,
\a,
\e[44m^G
\e[49m,g;
92 s,^\(Index:\|diff\|---\|+++\) .*$,
\e[32m&,;
96 s,
\r,
\e[44m^M
\e[49m,g;
98 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1
\e[41m\2
\e[49m,g;
103 # chdir to file location and do 'cvs log'
107 [ "$d" = "$f" ] && d=.
108 (builtin cd $d && cvs log ${f##*/})