aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 20:52:22 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 20:58:30 (GMT)
commit3070ed36b456939f9cfb414b1e7a6eab5019d9a0 (patch)
tree8f3af3f993b24d6c52df840dd24789dfbb161273
parentdabc1f61e5cfe31bc571708200a1e8cec40d6367 (diff)
Verify if everything needed to compile is there
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rwxr-xr-xbuild.sh6
-rwxr-xr-xcheck_needs.pl28
2 files changed, 33 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index f67c31f..60d0c26 100755
--- a/build.sh
+++ b/build.sh
@@ -8,6 +8,11 @@ run ()
fi
}
+echo "Checking if the needed tools are present"
+run ./check_needs.pl
+echo "Checking for Digest::SHA1 (package perl-Digest-SHA1)"
+run perl -MDigest::SHA1 -e 1
+echo
echo "************************************************************"
echo "* This script will download the latest tarball and build it*"
echo "* Assuming that your kernel is compatible with the latest *"
@@ -17,7 +22,6 @@ echo "* It will also update this tree to be sure that all compat *"
echo "* bits are there, to avoid compilation failures *"
echo "************************************************************"
echo
-echo "Note: requires git/perl/make/gcc/patch/perl-Digest-SHA1/patchutils packages to work"
sleep 5
run git pull git://linuxtv.org/media_build.git master
diff --git a/check_needs.pl b/check_needs.pl
new file mode 100755
index 0000000..b40d4b6
--- /dev/null
+++ b/check_needs.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+sub findprog($)
+{
+ foreach(split(/:/, $ENV{PATH})) {
+ return "$_/$_[0]" if(-x "$_/$_[0]");
+ }
+ die "Can't find needed utility '$_[0]'";
+}
+
+sub need_program
+{
+ my $prog = shift;
+ my $pkgname = shift;
+
+ return if findprog($prog);
+ print "please install \"$prog\", otherwise, build won't work.";
+ print " This program is generally found at \"$pkgname\" package." if ($pkgname);
+ print "\n";
+
+ die "need $prog";
+}
+
+need_program "git";
+need_program "make";
+need_program "gcc";
+need_program "patch";
+need_program "lsdiff", "patchutils";

Privacy Policy