]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - rpm-build.sh
- no -ready verify by default in dist-verify()
[packages/rpm-build-tools.git] / rpm-build.sh
index 6f3b66695e81dd1e35a8aada9fc7dc30ec0c89c3..22f6d7bbbea8e76f0bc5433b05087ff513262813 100644 (file)
@@ -2,19 +2,42 @@
 # $Id$
 
 # set $dist, used by functions below
-[ -n "$dist" ] || dist=$(awk '{print tolower($NF)}' /etc/pld-release 2>/dev/null | tr -d '()')
+[ -n "$dist" ] || dist=$(awk '/PLD Linux/ {print tolower($NF)}' /etc/pld-release 2>/dev/null | tr -d '()')
+
+case "$dist" in
+ac|th)
+       ;;
+*)
+       # invalid one ;)
+       dist=
+esac
 
 if [ "$dist" ]; then
 
-alias $dist="poldek -q --sn $dist --cmd"
-alias $dist-requires="$dist what-requires"
-alias $dist-provides="$dist what-provides"
+alias ipoldek-$dist="poldek -q --sn $dist --cmd"
+alias $dist-requires="ipoldek-$dist what-requires"
+alias $dist-provides="ipoldek-$dist what-provides"
 alias $dist-tag="./builder -cf -T $(echo $dist | tr '[a-z]' '[A-Z]')-branch -r HEAD"
 alias $dist-verify=dist-verify
 
+# undo spec utf8
+# note: it will do it blindly, so any lang other than -pl is most likely broken
+specutfundo() {
+       local spec="$1"
+       iconv -futf8 -tlatin2 "$spec" > m
+       sed -e 's/\.UTF-8//' m > "$spec"
+       rm -f m
+}
+
 dist-verify() {
-       poldek --sn $dist --sn $dist-ready --up
-       poldek --sn $dist --sn $dist-ready --verify=deps "$@"
+       case "$dist" in
+       ac)
+               args='--ignore=kdenetwork-kopete-tool-conectionstatus --ignore=gimp-plugin-swfdec --ignore=wine-drv-arts'
+               ;;
+       esac
+
+       poldek --sn $dist --sn $dist-updates --up
+       poldek --sn $dist --sn $dist-updates --noignore --verify=deps $args "$@"
 }
 
 # displays latest used tag for a specfile
@@ -49,7 +72,7 @@ urldiff() {
        file=${file##*/}
        local r1=${file#*r1=}
        local r2=${r1#*r2=}
-       r2=${r2%[&;]*}
+       r2=${r2%%[&;]*}
        r1=${r1%%[&;]*}
        file=${file%\?*}
        file=${file%.diff}
@@ -97,6 +120,8 @@ pmerge() {
 sfget() {
        local url="$1"
        url="${url%?download}"
+       url="${url%?use_mirror=*}"
+       url="${url#http://downloads.}"
        url="http://dl.${url#http://prdownloads.}"
        # use mirror
        local mirror="http://nchc.dl.sourceforge.net"
@@ -134,3 +159,21 @@ cvslog() {
        [ "$d" = "$f" ] && d=.
        (builtin cd $d && cvs log ${f##*/})
 }
+
+# does diff between FILE and FILE~
+# the diff can be applied with patch -p1
+d() {
+       local file="$1"
+       local dir
+       if [[ "$file" = /* ]]; then
+               # full path -- no idea where to strip
+               dir=.
+               diff=$file
+       else
+               # relative path -- keep one path component from current dir
+               dir=..
+               diff=${PWD##*/}/${file}
+       fi
+
+       (builtin cd "$dir"; dif $diff{~,})
+}
This page took 0.06931 seconds and 4 git commands to generate.