+# set $dist, used by functions below
+[ -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 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() {
+ 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
+autotag() {
+ local out
+ for a in "$@"; do
+ s=${a%.spec}.spec
+ out=$(cvs status -v $s | awk "/auto-$dist-/{if (!a++) print \$1}")
+ echo "$s:$out"
+ done
+}
+
+fi # no $dist set
+