1 # shell aliases and functions for PLD Developer
3 # set $dist, used by functions below
4 [ -n "$dist" ] || dist=$(lsb_release -sc 2>/dev/null | tr 'A-Z' 'a-z')
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-provides="ipoldek-$dist what-provides"
19 alias $dist-verify=dist-verify
20 alias $dist-requires=dist-requires
22 # move AC-branch tag to current checkout
23 # if AC-branch as branch exists, it is first removed
25 # see if remote has branch present
26 local branch=AC-branch
27 if git show-ref -q refs/remotes/origin/$branch; then
29 if [ -z "$(git tag --points-at origin/$branch 2>/dev/null)" ]; then
30 echo >&2 "There's no tag pointing to current $branch; refusing to delete branch"
33 # delete local branch if exists
34 git show-ref -q refs/heads/$branch && git branch -d $branch
37 git push --delete origin $branch
41 git push -f origin $branch
44 alias q='rpm -q --qf "%{N}-%|E?{%{E}:}|%{V}-%{R}.%{ARCH}\n"'
47 # note: it will do it blindly, so any lang other than -pl is most likely broken
50 iconv -futf8 -tlatin2 "$spec" > m
51 sed -e 's/\.UTF-8//' m > "$spec"
57 while [ $# -gt 0 ]; do
75 opts="$opts --sn=$dist-updates"
79 poldek -q -Q --sn $dist $opts --cmd what-requires $deps
88 sn="$sn --sn $dist-updates"
92 ignore="$ignore kdenetwork-kopete-tool-conectionstatus"
94 ignore="$ignore gimp-plugin-swfdec wine-drv-arts ntp-ntptrace"
95 # quake2@MAIN is now quake2forge, original quake2 restored to quake2
96 ignore="$ignore quake2-3dfx quake2-sdl quake2-sgl quake2-snd-alsa quake2-snd-ao quake2-snd-oss quake2-snd-sdl quake2-static"
98 ignore="$ignore mozilla-firefox-lang-en apache1-mod_perl-devel libyasm-static"
99 # renamed (courier-authlib.spec, r1.54)
100 ignore="$ignore courier-authlib-userdb courier-authlib-pipe"
101 # obsoleted, squid 2.6
102 ignore="$ignore squid-winbind_acl squid-winbind_auth"
103 # obsoleted with 1.0.4
104 ignore="$ignore python-numpy-FFT python-numpy-MA python-numpy-RNG"
106 ignore="$ignore apache1-doc apache1-index"
107 # obsoleted by kadu-module-mediaplayer-amarok
108 ignore="$ignore kadu-module-amarok"
109 # obsoleted by kadu-module-mediaplayer-xmms
110 ignore="$ignore kadu-module-xmms"
111 # obsoleted by kadu 0.6.0
112 ignore="$ignore kadu-theme-icons-crystal16 kadu-theme-icons-crystal22 kadu-theme-icons-nuvola16 kadu-theme-icons-nuvola22 kadu-module-iwait4u"
113 # obsoleted pear test packages
114 ignore="$ignore php-*-tests"
116 ignore="$ignore nmap-X11"
117 # mksd dependency not distributale
118 ignore="$ignore samba-vfs-vscan-mks"
119 # ibbackup is not distributale
120 ignore="$ignore innobackup"
122 ignore="$ignore ntp-client ntp"
123 # php4 only(php-pecl-tidy), for php<5.2(php-pecl-filter)
124 ignore="$ignore php-pecl-tidy php-pecl-filter"
126 # renamed to vim-syntax-txt2tags
127 ignore="$ignore txt2tags-vim"
130 args="$args --ignore=$a"
135 poldek $sn --up --upa -q "$@"
136 poldek $sn --uniq --noignore --verify=deps $args "$@"
139 # displays latest used tag for a specfile
145 # ensure package ends with .spec
148 out=$(git for-each-ref --count=1 --sort=-authordate refs/tags/auto/$dist \
149 --format='%(refname:short)')
157 echo >&2 "Usage: get-buildlog PACKAGE"
159 echo >&2 "Grabs buildlogs from pld builder for all arch."
166 archlist='i686 i586 i386 athlon alpha sparc amd64 ppc'
169 archlist='x86_64 i486 i686'
172 echo >&2 "get-buildlog: $dist buildlogs are /dev/null"
176 local url arch path ftp=ftp://buildlogs.pld-linux.org
177 for arch in $archlist; do
178 [ "$arch" ] || continue
180 echo -n "Checking $p.$arch... "
181 url=$(lftp -c "debug 0;open $ftp; cls --sort=date -r /$dist/$arch/OK/$p,*.bz2 /$dist/$arch/FAIL/$p,*.bz2 | tail -n1")
185 if wget -q $url -O .$p~; then
187 mv -f .$p~ $p.$arch.bz2
197 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"
198 alias pclean="sed -i~ -e '/^\(?\|=\+$\|unchanged:\|diff\|only\|Only\|Tylko\|Binary files\|Files\|Common\|index \|Index:\|RCS file\|retrieving\)/d'"
201 # requires: patchutils
203 combinediff -p1 $1 $2 > m.patch || return
208 # downloads sourceforge url from specific mirror
211 url="${url%?download}"
212 url="${url%?use_mirror=*}"
213 url="${url#http://downloads.}"
214 url="http://dl.${url#http://prdownloads.}"
216 local mirror="http://nchc.dl.sourceforge.net"
217 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
223 diff -ur -x .svn -x .git -x .bzr -x CVS "$@" | diffcol | less -R
225 diff -ur -x .svn -x .git -x .bzr -x CVS "$@"
231 s,
\e,
\e[44m^[
\e[49m,g;
232 s,
\a,
\e[44m^G
\e[49m,g;
233 s,^\(Index:\|diff\|---\|+++\) .*$,
\e[32m&,;
237 s,\r,
\e[44m^M
\e[49m,g;
239 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1
\e[41m\2
\e[49m,g;
244 # does diff between FILE~ and FILE
245 # the diff can be applied with patch -p1
249 if [[ "$file" = /* ]]; then
250 # full path -- no idea where to strip
254 # relative path -- keep one path component from current dir
256 diff=${PWD##*/}/${file}
259 (builtin cd "$dir"; dif $diff{~,} "$@")
264 sed -re 's,^(.+)-[^-]+-[^-]+$,\1.spec,'