]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blame - rpm-build.sh
- updated
[packages/rpm-pld-macros.git] / rpm-build.sh
CommitLineData
c8e059d2 1# shell aliases and functions for PLD Developer
2b7ced4e 2# $Id$
c8e059d2 3
c8e059d2
ER
4alias cv='cvs status -v'
5alias ac='poldek -q --sn ac --cmd'
6alias ac-requires='ac what-requires'
7alias ac-provides='ac what-provides'
2ccbef04 8alias ac-verify='poldek --sn ac --sn ac-ready -V'
c8e059d2 9alias ac-tag='./builder -cf -T AC-branch -r HEAD'
a5e372c8 10alias 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"
c8e059d2
ER
11alias pclean="sed -i~ -e '/^\(?\|=\+$\|unchanged:\|diff\|only\|Only\|Files\|Common\|Index:\|RCS file\|retrieving\)/d'"
12
13# merges two patches
14# requires: patchutils
15pmerge() {
16 combinediff -p1 $1 $2 > m.patch || return
17 pclean m.patch
18 dif $1 m.patch
19}
20
21# makes diff from PLD CVS urls
22urldiff() {
23 local url="$1"
24 if [ -z "$url" ]; then
25 echo >&2 "Reading STDIN"
26 read url
27 fi
28
29 echo >&2 "Process $url"
30 local file="$url"
31 file=${file#*SPECS/}
32 file=${file#*SOURCES/}
33 file=${file##*/}
34 local r1=${file#*r1=}
35 local r2=${r1#*r2=}
36 r2=${r2%&*}
37 r1=${r1%%&*}
38 file=${file%\?*}
39
40 echo >&2 "$file: $r1 -> $r2"
a5e372c8
ER
41
42 if [ -t 1 ]; then
43 pipe=' | tee m.patch | diffcol'
44 fi
45 cvs diff -u -r$r1 -r$r2 $file $pipe
c8e059d2
ER
46}
47
48# downloads sourceforge url from specific mirror
49sfget() {
50 local url="$1"
51 url="${url%?download}"
52 url="http://dl.${url#http://prdownloads.}"
53 # use mirror
54 local mirror="http://nchc.dl.sourceforge.net"
55 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
56 wget -c "$url"
57}
58
59# displays latest used tag for a specfile
60autotag() {
61 local out
62 for a in "$@"; do
63 out=$(cvs status -v $a | awk '/auto-ac-/{if (!a++) print $1}')
64 echo "$a:$out"
65 done
66}
aa560f74
ER
67
68dif() {
69 if [ -t 1 ]; then
70 diff -ur "$@" | diffcol | less -R
71 else
72 diff -ur "$@"
73 fi
74}
75
76diffcol() {
77sed -e '
78 s,\e,\e[44m^[\e[49m,g;
79 s,\a,\e[44m^G\e[49m,g;
80 s,^\(Index:\|diff\|---\|+++\) .*$,\e[32m&,;
81 s,^@@ ,\e[33m&,;
82 s,^-,\e[35m&,;
83 s,^+,\e[36m&,;
84 s,\r,\e[44m^M\e[49m,g;
85 s, , ,g;
86 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1\e[41m\2\e[49m,g;
87 s,$,\e[0m,
88' "$@"
89}
This page took 0.044926 seconds and 4 git commands to generate.