1 # shell aliases and functions for PLD Developer
4 # set $dist, used by functions below
5 [ -n "$dist" ] || dist=$(awk '/PLD Linux/ {print tolower($NF)}' /etc/pld-release 2>/dev/null | tr -d '()')
17 alias ipoldek-$dist="poldek -q --sn $dist --cmd"
18 alias $dist-requires="ipoldek-$dist what-requires"
19 alias $dist-provides="ipoldek-$dist what-provides"
20 alias $dist-tag="./builder -cf -T $(echo $dist | tr '[a-z]' '[A-Z]')-branch -r HEAD"
21 alias $dist-verify=dist-verify
24 # note: it will do it blindly, so any lang other than -pl is most likely broken
27 iconv -futf8 -tlatin2 "$spec" > m
28 sed -e 's/\.UTF-8//' m > "$spec"
33 poldek --sn $dist --sn $dist-ready --up
34 poldek --sn $dist --sn $dist-ready --noignore --verify=deps "$@"
37 # displays latest used tag for a specfile
42 out=$(cvs status -v $s | awk "/auto-$dist-/{if (!a++) print \$1}")
49 alias cv='cvs status -v'
50 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"
51 alias pclean="sed -i~ -e '/^\(?\|=\+$\|unchanged:\|diff\|only\|Only\|Files\|Common\|Index:\|RCS file\|retrieving\)/d'"
53 # makes diff from PLD CVS urls
57 if [ -z "$url" ]; then
58 echo >&2 "Reading STDIN"
62 echo >&2 "Process $url"
65 file=${file#*SOURCES/}
74 echo >&2 "$file: $r1 -> $r2"
77 cvs diff -u -r$r1 -r$r2 $file | tee m.patch | diffcol
79 cvs diff -u -r$r1 -r$r2 $file
83 # makes diff from kde svn path
87 # --- branches/KDE/3.5/kdepim/kpilot/conduits/vcalconduit/vcalRecord.cc #624744:624745
89 echo >&2 "Process $url"
94 # http://websvn.kde.org/branches/KDE/3.5/kdepim/kpilot/conduits/vcalconduit/vcalRecord.cc?rev=624745&r1=612579&r2=624745&makepatch=1&diff_format=u
95 url=http://websvn.kde.org/${url% *}
96 url="$url?r1=$r1&r2=$r2&makepatch=1&diff_format=u"
99 wget "$url" -O -| tee m.patch | diffcol
106 # requires: patchutils
108 combinediff -p1 $1 $2 > m.patch || return
113 # downloads sourceforge url from specific mirror
116 url="${url%?download}"
117 url="http://dl.${url#http://prdownloads.}"
119 local mirror="http://nchc.dl.sourceforge.net"
120 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
126 diff -ur "$@" | diffcol | less -R
134 s,
\e,
\e[44m^[
\e[49m,g;
135 s,
\a,
\e[44m^G
\e[49m,g;
136 s,^\(Index:\|diff\|---\|+++\) .*$,
\e[32m&,;
140 s,
\r,
\e[44m^M
\e[49m,g;
142 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1
\e[41m\2
\e[49m,g;
147 # chdir to file location and do 'cvs log'
151 [ "$d" = "$f" ] && d=.
152 (builtin cd $d && cvs log ${f##*/})
155 # does diff between FILE and FILE~
156 # the diff can be applied with patch -p1
160 if [[ "$file" = /* ]]; then
161 # full path -- no idea where to strip
165 # relative path -- keep one path component from current dir
167 diff=${PWD##*/}/${file}
170 (builtin cd "$dir"; dif $diff{~,})