1 # shell aliases and functions for PLD Developer
3 # set $dist, used by functions below
4 [ -n "$dist" ] || dist=$(awk '/PLD Linux/ {print tolower($NF)}' /etc/pld-release 2>/dev/null | tr -d '()')
16 alias ipoldek-$dist="poldek -q --sn $dist --cmd"
17 alias $dist-provides="ipoldek-$dist what-provides"
18 alias $dist-verify=dist-verify
19 alias $dist-requires=dist-requires
21 # move AC-branch tag to current checkout
22 # if AC-branch as branch exists, it is first removed
24 # see if remote has branch present
25 local branch=AC-branch
26 if git show-ref -q refs/remotes/origin/$branch; then
28 if [ -z "$(git tag --points-at origin/$branch 2>/dev/null)" ]; then
29 echo >&2 "There's no tag pointing to current $branch; refusing to delete branch"
32 # delete local branch if exists
33 git show-ref -q refs/heads/$branch && git branch -d $branch
36 git push --delete origin $branch
40 git push origin $branch
44 # note: it will do it blindly, so any lang other than -pl is most likely broken
47 iconv -futf8 -tlatin2 "$spec" > m
48 sed -e 's/\.UTF-8//' m > "$spec"
54 while [ $# -gt 0 ]; do
72 opts="$opts --sn=$dist-updates"
76 poldek -q -Q --sn $dist $opts --cmd what-requires $deps
85 sn="$sn --sn $dist-updates"
89 ignore="$ignore kdenetwork-kopete-tool-conectionstatus"
91 ignore="$ignore gimp-plugin-swfdec wine-drv-arts ntp-ntptrace"
92 # quake2@MAIN is now quake2forge, original quake2 restored to quake2
93 ignore="$ignore quake2-3dfx quake2-sdl quake2-sgl quake2-snd-alsa quake2-snd-ao quake2-snd-oss quake2-snd-sdl quake2-static"
95 ignore="$ignore mozilla-firefox-lang-en apache1-mod_perl-devel libyasm-static"
96 # renamed (courier-authlib.spec, r1.54)
97 ignore="$ignore courier-authlib-userdb courier-authlib-pipe"
98 # obsoleted, squid 2.6
99 ignore="$ignore squid-winbind_acl squid-winbind_auth"
100 # obsoleted with 1.0.4
101 ignore="$ignore python-numpy-FFT python-numpy-MA python-numpy-RNG"
103 ignore="$ignore apache1-doc apache1-index"
104 # obsoleted by kadu-module-mediaplayer-amarok
105 ignore="$ignore kadu-module-amarok"
106 # obsoleted by kadu-module-mediaplayer-xmms
107 ignore="$ignore kadu-module-xmms"
108 # obsoleted by kadu 0.6.0
109 ignore="$ignore kadu-theme-icons-crystal16 kadu-theme-icons-crystal22 kadu-theme-icons-nuvola16 kadu-theme-icons-nuvola22 kadu-module-iwait4u"
110 # obsoleted pear test packages
111 ignore="$ignore php-*-tests"
113 ignore="$ignore nmap-X11"
114 # mksd dependency not distributale
115 ignore="$ignore samba-vfs-vscan-mks"
116 # ibbackup is not distributale
117 ignore="$ignore innobackup"
119 ignore="$ignore ntp-client ntp"
120 # php4 only(php-pecl-tidy), for php<5.2(php-pecl-filter)
121 ignore="$ignore php-pecl-tidy php-pecl-filter"
123 # renamed to vim-syntax-txt2tags
124 ignore="$ignore txt2tags-vim"
127 args="$args --ignore=$a"
132 poldek $sn --up --upa -q "$@"
133 poldek $sn --uniq --noignore --verify=deps $args "$@"
136 # displays latest used tag for a specfile
142 # ensure package ends with .spec
145 out=$(git for-each-ref --count=1 --sort=-authordate refs/tags/auto/$dist \
146 --format='%(refname:short)')
154 echo >&2 "Usage: get-buildlog PACKAGE"
156 echo >&2 "Grabs buildlogs from pld builder for all arch."
163 archlist='i686 i586 i386 athlon alpha sparc amd64 ppc'
166 archlist='x86_64 i486 i686'
169 echo >&2 "get-buildlog: $dist buildlogs are /dev/null"
173 local url arch path ftp=ftp://buildlogs.pld-linux.org
174 for arch in $archlist; do
175 [ "$arch" ] || continue
177 echo -n "Checking $p.$arch... "
178 url=$(lftp -c "debug 0;open $ftp; cls --sort=date -r /$dist/$arch/OK/$p,*.bz2 /$dist/$arch/FAIL/$p,*.bz2 | tail -n1")
182 if wget -q $url -O .$p~; then
184 mv -f .$p~ $p.$arch.bz2
194 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"
195 alias pclean="sed -i~ -e '/^\(?\|=\+$\|unchanged:\|diff\|only\|Only\|Tylko\|Files\|Common\|Index:\|RCS file\|retrieving\)/d'"
197 # makes diff from PLD CVS urls
201 if [ -z "$url" ]; then
202 echo >&2 "Reading STDIN"
206 echo >&2 "Process $url"
209 file=${file#*SOURCES/}
211 local r1=${file#*r1=}
218 echo >&2 "$file: $r1 -> $r2"
221 cvs diff -u -r$r1 -r$r2 $file | tee m.patch | diffcol
223 cvs diff -u -r$r1 -r$r2 $file
227 # makes diff from kde svn path
228 # requires: wget, tee
231 # --- branches/KDE/3.5/kdepim/kpilot/conduits/vcalconduit/vcalRecord.cc #624744:624745
233 echo >&2 "Process $url"
238 # 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
239 # http://websvn.kde.org/branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/aim/aimcontact.cpp?r1=609808&r2=673027&view=patch
240 url=http://websvn.kde.org/${url% *}
241 url="$url?r1=$r1&r2=$r2&view=patch"
244 wget "$url" -O -| tee m.patch | diffcol
251 # requires: patchutils
253 combinediff -p1 $1 $2 > m.patch || return
258 # downloads sourceforge url from specific mirror
261 url="${url%?download}"
262 url="${url%?use_mirror=*}"
263 url="${url#http://downloads.}"
264 url="http://dl.${url#http://prdownloads.}"
266 local mirror="http://nchc.dl.sourceforge.net"
267 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
273 diff -ur -x .svn -x .git -x .bzr -x CVS "$@" | diffcol | less -R
275 diff -ur -x .svn -x .git -x .bzr -x CVS "$@"
281 s,
\e,
\e[44m^[
\e[49m,g;
282 s,
\a,
\e[44m^G
\e[49m,g;
283 s,^\(Index:\|diff\|---\|+++\) .*$,
\e[32m&,;
287 s,\r,
\e[44m^M
\e[49m,g;
289 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1
\e[41m\2
\e[49m,g;
294 # does diff between FILE~ and FILE
295 # the diff can be applied with patch -p1
299 if [[ "$file" = /* ]]; then
300 # full path -- no idea where to strip
304 # relative path -- keep one path component from current dir
306 diff=${PWD##*/}/${file}
309 (builtin cd "$dir"; dif $diff{~,})
314 sed -re 's,^(.+)-[^-]+-[^-]+$,\1.spec,'
318 local SPEC SPECDIR arg
325 SPECDIR=$(dirname "$(pwd)/${SPEC:-.}")
326 command rpmbuild --define "_specdir $SPECDIR" --define "_sourcedir $SPECDIR" "$@"