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 --sn $dist-updates --up
34 poldek --sn $dist --sn $dist-ready --sn $dist-updates --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="${url%?use_mirror=*}"
118 url="${url#http://downloads.}"
119 url="http://dl.${url#http://prdownloads.}"
121 local mirror="http://nchc.dl.sourceforge.net"
122 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
128 diff -ur "$@" | diffcol | less -R
136 s,
\e,
\e[44m^[
\e[49m,g;
137 s,
\a,
\e[44m^G
\e[49m,g;
138 s,^\(Index:\|diff\|---\|+++\) .*$,
\e[32m&,;
142 s,
\r,
\e[44m^M
\e[49m,g;
144 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1
\e[41m\2
\e[49m,g;
149 # chdir to file location and do 'cvs log'
153 [ "$d" = "$f" ] && d=.
154 (builtin cd $d && cvs log ${f##*/})
157 # does diff between FILE and FILE~
158 # the diff can be applied with patch -p1
162 if [[ "$file" = /* ]]; then
163 # full path -- no idea where to strip
167 # relative path -- keep one path component from current dir
169 diff=${PWD##*/}/${file}
172 (builtin cd "$dir"; dif $diff{~,})