X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=.bashrc;h=e8f03db49a5dd5925a79db2422b11a28a5af6e28;hp=f95bb659e61b37d04567a60081973fa1d8ce3440;hb=974de7a4e2bdc84aeeaf0206919675821d5cde37;hpb=4a6fc2080ac8b1844f3b418d79351e25e1ee5343 diff --git a/.bashrc b/.bashrc index f95bb65..e8f03db 100644 --- a/.bashrc +++ b/.bashrc @@ -330,6 +330,33 @@ function gdbdevelcvscheckout {(set -ex function uri_escape { perl -MURI::Escape -le '$_=<>;chomp;print uri_escape $_;'; }; function uri_unescape { perl -MURI::Escape -le '$_=<>;chomp;print uri_unescape $_;'; }; function n { if [ "$1" = "-p" ];then renice +19 "$@";ionice -c3 "$@";else nice -n19 ionice -c3 "$@";fi }; +function rpmsrclist +{ + if [ -z "$*" ]; then + echo >&2 "rpmsrclist gcc-4.3.2-7 [4.4.0-0.25 [-|http://kojipkgs.fedoraproject.org/packages/gcc/4.4.0/0.25/]]" + else + rpm -q --qf '%{SOURCERPM} %{name}-%{version}-%{release}.%{arch}\n' -a \ + | grep "^$1.src.rpm " | sed 's/^[^ ]* //' \ + | \ + if [ -z "$2" ]; then \ + cat; \ + else \ + sed "s/-$(echo "$1"|sed 's/^.*-\([^-]*-[^-]*\)$/\1/')/-$2/" + fi \ + | \ + if [ -z "$3" ]; then \ + cat; \ + else \ + if [ "$3" != - ]; then + sed "s#.*#$3/&#"; \ + else \ + base="$(echo "$1"|sed 's/^\(.*\)-[^-]*-[^-]*$/\1/')"; \ + sed "s#^.*-\([^-]*\)-\([^-]*\)\.\([^.]*\)\$#http://kojipkgs.fedoraproject.org/packages/$base/\1/\2/\3/&#"; \ + fi; \ + fi \ + | sort -u + fi +} ulimit -S -c 0 set +H