From 317d53bd6b4ec4df8111471dcbae7ed20b5a461a Mon Sep 17 00:00:00 2001 From: pawelk Date: Wed, 2 Apr 2008 10:55:48 +0000 Subject: [PATCH] Dodalem skrypty, zwiazane z obsluga zaleznosci w tarballu. git-svn-id: svn://atos.wmid.amu.edu.pl/utt@22 e293616e-ec6a-49c2-aa92-f4a8b91c5d16 --- app/dist/common/check_dependenties.pl | 15 ++++++++++++++ app/dist/common/find_perl_deps.pl | 29 +++++++++++++++++++++++++++ app/dist/common/find_rpm_deps.sh | 16 +++++++++++++++ app/dist/common/make_deps.sh | 3 +++ 4 files changed, 63 insertions(+) create mode 100644 app/dist/common/check_dependenties.pl create mode 100644 app/dist/common/find_perl_deps.pl create mode 100755 app/dist/common/find_rpm_deps.sh create mode 100755 app/dist/common/make_deps.sh diff --git a/app/dist/common/check_dependenties.pl b/app/dist/common/check_dependenties.pl new file mode 100644 index 0000000..ef08c92 --- /dev/null +++ b/app/dist/common/check_dependenties.pl @@ -0,0 +1,15 @@ + +while() { + chomp; + $app = $_; + $path = `which $app 2>/dev/null`; + $err = $?; + print $app.": "; + if($err != 0) { + print "failed ($err)\n"; + } + else { + print $path; + } +} + diff --git a/app/dist/common/find_perl_deps.pl b/app/dist/common/find_perl_deps.pl new file mode 100644 index 0000000..deb79c8 --- /dev/null +++ b/app/dist/common/find_perl_deps.pl @@ -0,0 +1,29 @@ + + +while() { + chomp; + # najpierw nazwa pliku zrodlowego out + if($_ =~ /^[^:]*\:\s*(.*)$/) { + my $line = $1; +# print "TEXT: $line\n"; + # teraz tylko samo polecenie + if($line =~ /\`\s*(.+)\s*\`/) { + my $cmd = $1; +# print "CMD: $cmd\n"; + # teraz splitujemy potoki + my @progs = split(/\s*\|\s*/, $cmd); + foreach (@progs) { +# print "$_\n"; + # ucinamy agrumenty programu + # oraz linie, zawierajace nie-programy (--replace, $tmpfile_x, /g, \\, itp.) + if($_ =~ /^([^\$\\\/\s\']+)(\s.*)?$/) { + my $app = $1; +# print "APP: $app\n"; +# my $res = `which $app`; +# print "WYNIK: $res\n"; + print "$app\n"; + } + } # foreach + } + } +} diff --git a/app/dist/common/find_rpm_deps.sh b/app/dist/common/find_rpm_deps.sh new file mode 100755 index 0000000..d870429 --- /dev/null +++ b/app/dist/common/find_rpm_deps.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# sprawdzamy czy podano argument +if test $# -lt 1; then echo RPM file name expected!; exit -1; fi + +# sprawdzamy czy to plik, potem, czy rpm +if test -f $1; \ +then + if test "rpm" = `ls $1 | tail -c 4`; \ + then + rpm -q -R -p $1; \ + else echo "It's not a RPM file!"; \ + fi +else echo RPM file not found!; \ +fi + diff --git a/app/dist/common/make_deps.sh b/app/dist/common/make_deps.sh new file mode 100755 index 0000000..6bf55c7 --- /dev/null +++ b/app/dist/common/make_deps.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +grep -r -e "\`" ../../src | grep -v -e "\.svn\/" | perl find_perl_deps.pl | sort | uniq > dep_list.txt