]> git.pld-linux.org Git - packages/rpm-build-tools.git/blame - rpm-build.sh
- update urldiff for urls like http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES...
[packages/rpm-build-tools.git] / rpm-build.sh
CommitLineData
7e37b984 1# shell aliases and functions for PLD Developer
6657c577 2# $Id$
7e37b984 3
7e37b984
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'
0e5f659a 8alias ac-verify='poldek --sn ac --sn ac-ready --verify=deps'
7e37b984 9alias ac-tag='./builder -cf -T AC-branch -r HEAD'
79aa1413 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"
7e37b984
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=}
7765da19
ER
36 r2=${r2%[&;]*}
37 r1=${r1%%[&;]*}
7e37b984 38 file=${file%\?*}
7765da19 39 file=${file%.diff}
7e37b984
ER
40
41 echo >&2 "$file: $r1 -> $r2"
79aa1413
ER
42
43 if [ -t 1 ]; then
44 pipe=' | tee m.patch | diffcol'
45 fi
46 cvs diff -u -r$r1 -r$r2 $file $pipe
7e37b984
ER
47}
48
49# downloads sourceforge url from specific mirror
50sfget() {
51 local url="$1"
52 url="${url%?download}"
53 url="http://dl.${url#http://prdownloads.}"
54 # use mirror
55 local mirror="http://nchc.dl.sourceforge.net"
56 url="$mirror/sourceforge/${url#http://dl.sourceforge.net/}"
57 wget -c "$url"
58}
59
60# displays latest used tag for a specfile
61autotag() {
62 local out
63 for a in "$@"; do
64 out=$(cvs status -v $a | awk '/auto-ac-/{if (!a++) print $1}')
65 echo "$a:$out"
66 done
67}
88e7bbe5
ER
68
69dif() {
70 if [ -t 1 ]; then
71 diff -ur "$@" | diffcol | less -R
72 else
73 diff -ur "$@"
74 fi
75}
76
77diffcol() {
78sed -e '
79 s,\e,\e[44m^[\e[49m,g;
80 s,\a,\e[44m^G\e[49m,g;
81 s,^\(Index:\|diff\|---\|+++\) .*$,\e[32m&,;
82 s,^@@ ,\e[33m&,;
83 s,^-,\e[35m&,;
84 s,^+,\e[36m&,;
85 s,\r,\e[44m^M\e[49m,g;
86 s, , ,g;
87 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1\e[41m\2\e[49m,g;
88 s,$,\e[0m,
89' "$@"
90}
6ef19b16
ER
91
92# chdir to file location and do 'cvs log'
93cvslog() {
94 local f="$1"
0db4548a
ER
95 local d="${f%/*}"
96 [ "$d" = "$f" ] && d=.
97 (builtin cd $d && cvs log ${f##*/})
6ef19b16 98}
This page took 0.06278 seconds and 4 git commands to generate.