From d02b60987a9d04d3f7a58c04c1000797b8563b92 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 19 Jun 2006 19:49:57 -0300 Subject: Improved to accept also patches from akpm. From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index 16e566ea9..3f8b4b0ba 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -12,6 +12,7 @@ my $sub_ok=0; my $init=0; my $num=0; my $hgimport=0; +my $mmimport=0; my $maint_ok=0; my $noblank=1; my $maintainer_name=$ENV{CHANGE_LOG_NAME}; @@ -33,6 +34,10 @@ while ($line = ) { if ($line =~ m/^\-\-\- .*/) { last; } + if ($line =~ m/^\-\-\-\-.*/) { + $body=""; + next; + } if ($line =~ m/^\-\-\-.*/) { last; } @@ -62,7 +67,11 @@ while ($line = ) { $from= "From: $fromname\n"; next; } - print "Bad: author line have a wrong syntax\n"; + if ($line =~ m/^From:\sakpm\@osdl.org/) { + $mmimport=1; + next; + } + print "Bad: author line have a wrong syntax: $line\n"; die; } @@ -87,11 +96,11 @@ while ($line = ) { $signed="$signed$line"; next; } - if ($line =~ m/^\# HG changeset patch/) { + if ( ($line =~ m/^\# HG changeset patch/) || + ($line =~ m/^has been added to the -mm tree. Its filename is/) ) { $sub_ok=0; $init=0; $num=0; - $hgimport=0; $maint_ok=0; $noblank=1; $from=""; @@ -100,6 +109,7 @@ while ($line = ) { $hgimport=1; next; } + if ($line =~ m/^Acked-by:.*/) { $signed="$signed$line"; @@ -164,8 +174,8 @@ if (!$signed =~ m/$from/) { die; } -$body=~s/\n+$//; -$body=~s/^\n+$//; +$body=~s/[\n\s]+$//; +$body=~s/^[\n\s]+//; # First from is used by hg to recognize commiter name print "#Committer: $maintainer_name <$maintainer_email>\n"; -- cgit v1.2.3 From 5da0337a0500257e93259472d26bca4ca9a6be9a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 20 Jun 2006 00:24:50 -0300 Subject: Faster strip whitespace cleaning script From: Trent Piepho Faster script that doesn't use any temporary files. The old one would also miss cleaning four spaces in a row in places where it would clean one to eight spaces. Has two options: fast Only clean whitespace in files Hg thinks are modified or added. Used by make whitespace and much (about 100x) faster. manifest Clean all files controlled by Hg, using "hg manifest" The default with no options is the old behaviour, clean all files under the linux directory, except CVS files. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/strip-trailing-whitespaces.sh | 56 +++++++++++++------------------ 1 file changed, 23 insertions(+), 33 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh index 1a23e436d..5bd7784e4 100755 --- a/v4l/scripts/strip-trailing-whitespaces.sh +++ b/v4l/scripts/strip-trailing-whitespaces.sh @@ -1,37 +1,27 @@ #!/bin/sh +# Strips trailing whitespace. Leading spaces and spaces after tabs are +# converted to the equivalent sequence of tabs only. -# tmp dir for my files -WORK="${TMPDIR-/tmp}/${0##*/}-$$" -mkdir "$WORK" || exit 1 -trap 'rm -rf "$WORK"' EXIT +# Use the option "fast" to only check files Hg thinks are new or modified. +# The option "manifest" will use Hg's manifest command to check all files +# under Hg revision control. +# Otherwise, all files under the linux tree are checked, except files in CVS +# directories and .cvsignore files. This is the historical behavior. -for file in `find linux -type d | grep -v CVS | grep -v .cvsignore` ; do - mkdir -p "$WORK/${file}" -done -for file in `find linux -type f | grep -v CVS | grep -v .cvsignore` ; do - tmpfile="$WORK/${file}.$$" - perl -ne 's/[ \t]+$//; - s/^\ \ \ \ \ \ \ \ /\t/; - s/^\ \ \ \ \ \ \ \t/\t/; - s/^\ \ \ \ \ \ \t/\t/; - s/^\ \ \ \ \ \t/\t/; - s/^\ \ \ \t/\t/; - s/^\ \ \t/\t/; - s/^\ \t/\t/; - $m=1; - while ($m>0) { - $m=0; - $m= s/\t\ \ \ \ \ \ \ \ /\t\t/g; - $m=$m+s/\t\ \ \ \ \ \ \ \t/\t\t/g; - $m=$m+s/\t\ \ \ \ \ \ \t/\t\t/g; - $m=$m+s/\t\ \ \ \ \ \t/\t\t/g; - $m=$m+s/\t\ \ \ \t/\t\t/g; - $m=$m+s/\t\ \ \t/\t\t/g; - $m=$m+s/\t\ \t/\t\t/g; - } - print' < "${file}" > "${tmpfile}" - diff -u "${file}" "${tmpfile}" | sed \ - -e "s|^--- ${file}|--- ${file}.orig|" \ - -e "s|^+++ ${tmpfile}|+++ ${file}|" - rm -f "$tmpfile" + +if [ "x$1" = "xfast" ]; then + files="hg status -man" +elif [ "x$1" = "xmanifest" ]; then + files="hg manifest | cut '-d ' -f3" +else + files="find linux -name CVS -prune -o -type f -not -name .cvsignore -print" +fi + +for file in `eval $files`; do + perl -ne ' + s/[ \t]+$//; + s<^ {8}> <\t>; + s<^ {1,7}\t> <\t>; + while( s<\t {8}> <\t\t>g || s<\t {1,7}\t> <\t\t>g ) {}; + print' < "${file}" | diff -u "${file}" - done -- cgit v1.2.3 From ecddc353539730fcf011b1e9d60ba3acca577e04 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 20 Jun 2006 13:17:11 -0300 Subject: Makefile.media were rewritten even when not required. From: Mauro Carvalho Chehab make 3.81 were suffering some endless loop that might be caused by Makefile.media rewrites. After this patch, make_makefile will only write Makefile.media if needed. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 238c5082f..bcfb3764f 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -109,7 +109,7 @@ sub open_makefile($) { close $in; } -open OUT,">Makefile.media"; +open OUT,">Makefile.media.new"; open_makefile ("../linux/drivers/media/Makefile"); # Creating Install rule @@ -156,7 +156,29 @@ while ( my ($key, $value) = each(%depend) ) { } close OUT; -if (open OUT,".myconfig") { +if (open IN,"Makefile.media") { + close IN; + my $changed=0; + if (open IN,"diff Makefile.media Makefile.media.new|") { + while () { + if ($_ ne "") { + $changed=1; + } + } + close IN; + if ($changed) { + printf("One or more linux Makefiles had changed. Makefile.media rewrited.\n"); + system ("mv Makefile.media.new Makefile.media"); + } else { + system ("rm Makefile.media.new"); + } + } +} else { + printf("Creating Makefile.media.\n"); + system "mv Makefile.media.new Makefile.media"; +} + +if (open IN,".myconfig") { close IN; } else { system "make allmodconfig"; -- cgit v1.2.3 From 74e1ed0781b35cfd53baba71c84dfbf6c59c5403 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Jun 2006 10:04:08 -0300 Subject: Fixes circular dependencies at building system From: Mauro Carvalho Chehab There were a circular dependency at scripts/make_makefile.pl that were affecting mostly building with GNU make 3.81. Also, scripts/make_noconfig.pl is, in fact, building .myconfig file, so, better to name it as make_myconfig.pl. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 2 +- v4l/scripts/make_myconfig.pl | 58 ++++++++++++++++++++++++++++++++++++++++++++ v4l/scripts/make_noconfig.pl | 58 -------------------------------------------- 3 files changed, 59 insertions(+), 59 deletions(-) create mode 100755 v4l/scripts/make_myconfig.pl delete mode 100755 v4l/scripts/make_noconfig.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index bcfb3764f..f0d9aef7f 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -181,5 +181,5 @@ if (open IN,"Makefile.media") { if (open IN,".myconfig") { close IN; } else { - system "make allmodconfig"; + system "./scripts/make_kconfig.pl 1"; } diff --git a/v4l/scripts/make_myconfig.pl b/v4l/scripts/make_myconfig.pl new file mode 100755 index 000000000..7323f419c --- /dev/null +++ b/v4l/scripts/make_myconfig.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# The purpose of this script is to produce a file named '.myconfig', in +# the same style as the '.config' file. Except .myconfig has disabled +# options explicitly set to 'n' rather than just omitted. This is to +# make sure they override any corresponding options that may be turned on +# in the Kernel's config files. +# The .myconfig file is what will be included in the v4l-dvb Makefile +# to control which drivers are built. + +my %config = (); +my %allconfig = (); + +open IN,".config"; +while () { + if (m/\s*(\w+)=\s*(\S*)/) { +#printf "%s=%s\n",$1,$2; + $config { $1 } = $2; + } +} +close IN; + +# Build table of _all_ bool and tristate config variables +my $key = 0; +open IN,"Kconfig"; +while () { + if (/^config\s+(\w+)\s*$/) { + $key == 0 or die "Couldn't find type of config '$key'"; + $key = "CONFIG_$1"; + } elsif (/^\s+bool(ean)?\s/) { + $allconfig{$key} = 'bool'; + $key = 0; + } elsif (/^\s+tristate\s/) { + $allconfig{$key} = 'tristate'; + $key = 0; + } elsif (/^\s+(int|hex|string)\s/) { + $allconfig{$key} = 'data'; + $key = 0; + } +} +close IN; + +exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; + +# Produce output for including in a Makefile +# Explicitly set bool/tri options that didn't appear in .config to n +# 'data' options are only output if they appeared in .config +open OUT,">.myconfig"; +while ( my ($key, $value) = each(%allconfig) ) { + if ($value eq 'data') { + next unless (exists $config{$key}); + $value = $config{$key}; + } else { + $value = exists $config{$key} ? $config{$key} : 'n'; + } + printf OUT "%-44s := %s\n",$key,$value; +} +close OUT; diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl deleted file mode 100755 index 7323f419c..000000000 --- a/v4l/scripts/make_noconfig.pl +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/perl - -# The purpose of this script is to produce a file named '.myconfig', in -# the same style as the '.config' file. Except .myconfig has disabled -# options explicitly set to 'n' rather than just omitted. This is to -# make sure they override any corresponding options that may be turned on -# in the Kernel's config files. -# The .myconfig file is what will be included in the v4l-dvb Makefile -# to control which drivers are built. - -my %config = (); -my %allconfig = (); - -open IN,".config"; -while () { - if (m/\s*(\w+)=\s*(\S*)/) { -#printf "%s=%s\n",$1,$2; - $config { $1 } = $2; - } -} -close IN; - -# Build table of _all_ bool and tristate config variables -my $key = 0; -open IN,"Kconfig"; -while () { - if (/^config\s+(\w+)\s*$/) { - $key == 0 or die "Couldn't find type of config '$key'"; - $key = "CONFIG_$1"; - } elsif (/^\s+bool(ean)?\s/) { - $allconfig{$key} = 'bool'; - $key = 0; - } elsif (/^\s+tristate\s/) { - $allconfig{$key} = 'tristate'; - $key = 0; - } elsif (/^\s+(int|hex|string)\s/) { - $allconfig{$key} = 'data'; - $key = 0; - } -} -close IN; - -exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; - -# Produce output for including in a Makefile -# Explicitly set bool/tri options that didn't appear in .config to n -# 'data' options are only output if they appeared in .config -open OUT,">.myconfig"; -while ( my ($key, $value) = each(%allconfig) ) { - if ($value eq 'data') { - next unless (exists $config{$key}); - $value = $config{$key}; - } else { - $value = exists $config{$key} ? $config{$key} : 'n'; - } - printf OUT "%-44s := %s\n",$key,$value; -} -close OUT; -- cgit v1.2.3 From 6cfc8eeff6261fb1153a67e5bc3c71616f332044 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Jun 2006 12:23:13 -0300 Subject: Some improvements at the building system From: Mauro Carvalho Chehab Building system now looks kernel config.h and autoconf.h files, seeking for the compiled options at kernel. If something is missing, it will disable compilation for that driver, printing a warning message. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 152 +++++++++++++++++++++++++++++++++++++++---- v4l/scripts/make_makefile.pl | 3 +- 2 files changed, 141 insertions(+), 14 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index b499fefa1..33a53d772 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -7,10 +7,69 @@ my %config = (); my %intopt = (); my %hexopt = (); my %tristate = (); +my %kernopts = (); +my %depmods = (); my $version, $level, $sublevel; +my $kernel=shift; my $force_kconfig=shift; +#!/usr/bin/perl +use FileHandle; + +########################################################### +# Checks config.h and autoconf.h for current kernel defines +sub process_config ($) +{ + my $filename = shift; + my $in = new FileHandle; + + open $in,"$kernel/include/$filename" or die; + while (<$in>) { + if (m|\#include\s+\<(.*)\>|) { + process_config ($1); + next; + } + if (m/\#define\s+CONFIG_([^ ]*)_ON_SMP\s+(.*)\n/) { + my $key=$1; + my $value=$2; +# printf "defined $key as $value\n"; + if ( $value == 1 ) { + $value='y'; + } + $kernopts{$key}=$value; + next; + } + if (m/\#define\s+CONFIG_([^ ]*)_MODULE\s+(.*)\n/) { + my $key=$1; + my $value=$2; +# printf "defined $key as $value\n"; + if ( $value == 1 ) { + $value='m'; + } + $kernopts{$key}=$value; + next; + } + if (m/\#define\s+CONFIG_([^ ]*)\s+(.*)\n/) { + my $key=$1; + my $value=$2; +# printf "defined $key as $value\n"; + if ( $value == 1 ) { + $value='y'; + } + $kernopts{$key}=$value; + next; + } + if (m/\#undef\s+CONFIG_([^ ]*)\n/) { +# printf "undefined $1\n"; + $kernopts{$1}='n'; + next; + } + } + + close $in; +} + sub add_bool($) { my $arg=shift; @@ -18,6 +77,8 @@ sub add_bool($) exists $config{$arg} or die "Adding unknown boolean '$arg'"; $tristate{$arg}="bool"; # printf "Boolean:%s\n",$arg; + + $kernopts{$arg}='y'; } sub add_tristate($) @@ -26,7 +87,8 @@ sub add_tristate($) exists $config{$arg} or die "Adding unknown tristate '$arg'"; $tristate{$arg}="tristate"; -# printf "Tristate:%s\n",$arg; + + $kernopts{$arg}='m'; } sub add_int($) @@ -75,6 +137,7 @@ sub add_config($) } } +######################################## # Turn option off, iff it already exists sub disable_config($) { @@ -83,9 +146,14 @@ sub disable_config($) $config{$key} = 0 if (exists $config{$key}); } -sub check_deps($) +################################################################# +# Make a list of dependencies and the number of references for it +sub check_deps($$) { + my $key=shift; my $arg=shift; + + $depmods{$key}=$arg; $arg=$arg." "; while ($arg ne "") { @@ -96,6 +164,44 @@ sub check_deps($) } $arg =~ s/^[^ ]+ //; } + + return $ok; +} + +###################################################### +# Checks if all dependencies for the key are satisfied +sub deps_ok($) +{ + my $key=shift; + my $arg=$depmods{$key}; + my $ok=1; + + if ($arg eq "") { + return $ok; + } + + $arg=$arg." "; + + +# printf "$key: deps are '$arg'\n"; + + while ($arg ne "") { + if ($arg =~ m/^([A-Z0-9_]+) /) { + if ((! exists $kernopts {$1}) || ($kernopts {$1} eq 'n')) { + printf "$key: Required kernel opt '$1' is not present\n"; + $ok=0; + } + } + if ($arg =~ m/^\!([A-Z0-9_]+) /) { + if ($kernopts {$1} eq 'y') { + printf "$key: Driver is incompatible with '$1'\n"; + $ok=0; + } + } + $arg =~ s/^[^ ]+ //; + } + + return $ok; } sub open_kconfig($$) { @@ -105,7 +211,7 @@ sub open_kconfig($$) { my $key; #print "opening $file\n"; - open $in,"$file"; + open $in,"$file" or die; while (<$in>) { # if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { # next; @@ -124,10 +230,10 @@ sub open_kconfig($$) { next; } if (m|^\s+depends on\s+(.*)\n|) { - check_deps ($1); + check_deps ($key,$1); } if (m|^\s+select\s+(.*)\n|) { - check_deps ($1); + check_deps ($key,$1); } if (m|^\s+bool(ean)?\s|) { add_bool($key); @@ -155,7 +261,6 @@ sub open_kconfig($$) { $default_seen = 1; $_ = "\tdefault n\n"; } - # check for end of config definition for disabled drivers # we need to make sure we've disabled it, and add a bit # to the help text @@ -211,7 +316,7 @@ sub parse_versions () my $in = new FileHandle; my $ver; - open $in,"versions.txt"; + open $in,"versions.txt" or die; while (<$in>) { if (m/\[([\d.]*)\]/) { $ver=$1; @@ -226,9 +331,11 @@ sub parse_versions () close $in; } +process_config("linux/config.h"); + parse_versions; -open IN,".version"; +open IN,".version" or die; while () { if (m/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)\.(\d+)/) { $version=$1; @@ -240,7 +347,7 @@ close IN; printf "Preparing to compile for kernel version %d.%d.%d\n",$version,$level,$sublevel; -open OUT,">Kconfig"; +open OUT,">Kconfig" or die; print OUT <<"EOF"; mainmenu "V4L/DVB menu" @@ -273,14 +380,19 @@ while ( my ($key, $value) = each(%config) ) { delete $depend{$key}; } -open OUT,">Kconfig.kern"; +open OUT,">Kconfig.kern" or die; print OUT "config MODULES\n\tboolean\n\tdefault y\n\n"; add_config('MODULES'); add_bool('MODULES'); while ( my ($key, $value) = each(%depend) ) { - print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault m\n\n"; + if ($kernopts{$key}) { + print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault ". + $kernopts{$key}."\n\n"; + } else { + print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault n #not found\n\n"; + } } close OUT; @@ -290,10 +402,24 @@ disable_config('DVB_CINERGYT2_TUNING'); # Produce a .config file if it's forced or one doesn't already exist if (($force_kconfig eq 1) || !open IN,".config") { - open OUT,">.config"; + open OUT,">.config" or die; while ( my ($key,$value) = each(%tristate) ) { if (!$config{$key}) { - print OUT "CONFIG_$key=n\n"; + print OUT "# CONFIG_$key is not set\n"; + } elsif ($kernopts{$key}) { + my $ok=deps_ok($key); + + # If deps are not ok, mark default as n + if (!$ok) { +# print "$key disabled due to missing kernel required prereq\n"; + $kernopts{$key}='n'; + } + + if ($kernopts{$key} eq 'n') { + print OUT "# CONFIG_$key is not set\n"; + } else { + print OUT "CONFIG_$key=".$kernopts{$key}."\n"; + } } elsif ($value eq 'tristate') { print OUT "CONFIG_$key=m\n"; } else { # must be 'bool' diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index f0d9aef7f..e0a099e9b 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl use FileHandle; +my $kernel=shift; my $instdir = (); sub check_line($$$) @@ -181,5 +182,5 @@ if (open IN,"Makefile.media") { if (open IN,".myconfig") { close IN; } else { - system "./scripts/make_kconfig.pl 1"; + system "./scripts/make_kconfig.pl $kernel 1"; } -- cgit v1.2.3 From e7a1d090b86f3e99145a255967b4d49cbaf36087 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Jun 2006 16:30:43 -0300 Subject: Option disabling should be recursive. Fixing it. From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 33a53d772..5f8866220 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -400,6 +400,19 @@ close OUT; disable_config('DVB_AV7110_FIRMWARE'); disable_config('DVB_CINERGYT2_TUNING'); +my $i; +do { + $i=0; + while ( my ($key,$value) = each(%kernopts) ) { + if ($value ne 'n') { + if (!deps_ok($key)) { + $kernopts{$key}='n'; + } + $i=$i+1; + } + } +} until (!$disable); + # Produce a .config file if it's forced or one doesn't already exist if (($force_kconfig eq 1) || !open IN,".config") { open OUT,">.config" or die; @@ -407,14 +420,6 @@ if (($force_kconfig eq 1) || !open IN,".config") { if (!$config{$key}) { print OUT "# CONFIG_$key is not set\n"; } elsif ($kernopts{$key}) { - my $ok=deps_ok($key); - - # If deps are not ok, mark default as n - if (!$ok) { -# print "$key disabled due to missing kernel required prereq\n"; - $kernopts{$key}='n'; - } - if ($kernopts{$key} eq 'n') { print OUT "# CONFIG_$key is not set\n"; } else { -- cgit v1.2.3 From 6ed34e3a513dd73f39d804e9416524bf5eb54be6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Jun 2006 19:07:45 -0300 Subject: building system fix: miropcm20 depends on sound/oss/aci.h From: Mauro Carvalho Chehab Most V4L/DVB hg tree users are just compiling using kernel headers. This is bad, due to: 1) the lack of support for make *config 2) the kernel itself have unknown patches from the distros Anyway, it is useful to provide they some support. This patch provides a "hack" for such users, by checking if the sound/oss/aci.h file is present under kernel tree. If not, it will disable miropcm20 and print a warning about the usage of a kernel-headers only package. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 5f8866220..807fea2e6 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -400,6 +400,20 @@ close OUT; disable_config('DVB_AV7110_FIRMWARE'); disable_config('DVB_CINERGYT2_TUNING'); +# Hack for check sound/oss/aci.h header + +my $mirodep="$kernel/sound/oss/aci.h"; +if (!open IN, $mirodep) { + my $key="RADIO_MIROPCM20"; + printf "$key: $mirodep is missing.\n"; + printf "It seems that you are using a kernel-headers only package\n"; + printf "kernel-headers only won't provide you make menuconfig/xconfig/qconfig\n"; + + $kernopts{$key}='n'; +} +close IN; + +# Recursively check for broken dependencies my $i; do { $i=0; -- cgit v1.2.3 From 78d2d7a1fea8c058e3ffa9dae7b6f96c3491a7ac Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Jun 2006 11:47:13 -0300 Subject: Adjust filenames in the strip whitespace script output From: Trent Piepho Before: --- Makefile +++ - 2006-06-20 22:16:36.320564000 -0700 Now: --- Makefile +++ Makefile patch handles both correctly, but diffstat will use the "+++" filename rather than the "---" filename, making diffstat output rather useless. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/strip-trailing-whitespaces.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh index 5bd7784e4..a546a0b9f 100755 --- a/v4l/scripts/strip-trailing-whitespaces.sh +++ b/v4l/scripts/strip-trailing-whitespaces.sh @@ -23,5 +23,6 @@ for file in `eval $files`; do s<^ {8}> <\t>; s<^ {1,7}\t> <\t>; while( s<\t {8}> <\t\t>g || s<\t {1,7}\t> <\t\t>g ) {}; - print' < "${file}" | diff -u "${file}" - + print' < "${file}" | \ + diff -u --label="$file" "$file" --label="$file" - done -- cgit v1.2.3 From 9a9c8e49eea524960d5fbead3d5794a0bd936500 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Jun 2006 11:51:24 -0300 Subject: Have the commit auto-check code tell you when it does something From: Trent Piepho When the make commit checks for whitespace errors, it will save a copy of the changes it makes to $(TMP)/v4l_hg_whitespace. The prep_commit_msg.pl script will look for this file and include a note in the prepared commit message with diffstat output. The changes that scripts/cardlist might make are not included, but that can be added later. The prep_commit_msg.pl script is effectively totally re-written. This one will try some extra stuff to some up with the user's e-mail, such as looking in the ~/.hgrc file. The Makefile is changed so that temporary files created by make commit and make whitespace will honor the $TMP environment variable, if set. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/prep_commit_msg.pl | 73 ++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 24 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl index ac958667b..a4594c7f9 100755 --- a/v4l/scripts/prep_commit_msg.pl +++ b/v4l/scripts/prep_commit_msg.pl @@ -1,34 +1,59 @@ #!/usr/bin/perl -$f=shift; -open IN,"hg diff|diffstat -p1 |"; -my $n=2; -my $from=""; -my $first=""; -my $changed=""; -$out=""; -while () { - $changed="$changed#$_"; -} +my $autopatch = shift; +# Get Hg username from environment my $user = $ENV{HGUSER}; -if ( $user eq "" ) { +# Didn't work? Try the .hgrc file +if ($user eq "") { + open IN, "<$ENV{HOME}/.hgrc"; + while () { + if(/^\s*username\s*=\s*(\S.*)$/) { + $user = $1; + last; + } + } + close IN; +} + +# Still no luck? Try some other environment variables +if ($user eq "") { my $name = $ENV{CHANGE_LOG_NAME}; my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; + $user = "$name <$email>" if ($name ne "" || $email ne ""); +} + +# Last try to come up with something +if ($user eq "") { + $user = "$ENV{USER} <>"; +} - $user="$name <$email>"; +print "# Added/removed/changed files:\n"; +system "hg diff | diffstat -p1 -c"; +if (-s $autopatch) { + print "#\n# Note, a problem with your patch was detected! These changes were made\n"; + print "# automatically: $autopatch\n"; + system "diffstat -p0 -c $autopatch"; + print "#\n# Please review these changes and see if they belong in your patch or not.\n"; } +print <<"EOF"; +# +# For better log display, please keep a blank line after subject, after from, +# and before signed-off-by. +# First line should be the subject, without Subject: +# + + +# Now, patch author (just the main one), on a From: field +# Please change below if the committer is not the patch author. +# +From: $user + +# Then a detailed description: + -$first= "# Please change below if you are not patch author\n#\nFrom: $user"; -$out= "# At the end Signed-off-by: fields by patch author and committer, at least\n#\nSigned-off-by: $user"; -$from= "From: $user"; - -printf "#Added/removed/changed files:\n%s#\n" . - "# For better log display, please keep a blank line after subject, after from\n" . - "# and before signed-off-by\n" . - "# First line should be the subject, without Subject:\n#\n\n\n" . - "# Now, patch author (just the main one), on a From: field\n" . - "# Please change below if the committer is not the patch author\n#\n%s\n\n" . - "# Then a detailed description:\n\n\n%s", - $changed,$from,$out; +# At the end Signed-off-by: fields by patch author and committer, at least. +# +Signed-off-by: $user +EOF -- cgit v1.2.3 From b00987276ad2c4bef7891591a6ca2081a7d1e1d4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Jun 2006 18:52:04 -0300 Subject: Improved message when only kernel headers are found From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 807fea2e6..c58f5b028 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -405,10 +405,27 @@ disable_config('DVB_CINERGYT2_TUNING'); my $mirodep="$kernel/sound/oss/aci.h"; if (!open IN, $mirodep) { my $key="RADIO_MIROPCM20"; - printf "$key: $mirodep is missing.\n"; - printf "It seems that you are using a kernel-headers only package\n"; - printf "kernel-headers only won't provide you make menuconfig/xconfig/qconfig\n"; +print <<"EOF2"; +$key: $mirodep is missing. +***WARNING:*** You do not have the full kernel sources installed. +This does not prevent you from building the v4l-dvb tree if you have the +kernel headers, but the full kernel source is required in order to use +make menuconfig / xconfig / qconfig. + +If you are experiencing problems building the v4l-dvb tree, please try +building against a vanilla kernel before reporting a bug. + +Vanilla kernels are available at http://kernel.org. +On most distros, this will compile a newly downloaded kernel: + +cp /boot/config-`uname -r` /.config +cd +make all modules_install install + +Please see your distro's web site for instructions to build a new kernel. + +EOF2 $kernopts{$key}='n'; } close IN; -- cgit v1.2.3 From f36035a9e66e7645ee1ce15fdf1093493539be1e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 24 Jun 2006 08:18:58 -0300 Subject: Add blacklist capability to tuner.pl and remove TDA9887 from the cardlist From: Mauro Carvalho Chehab tda9887 is not really an independent tuner, but part of one. It shouldn't be ponted at a userlist. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/tuner.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/tuner.pl b/v4l/scripts/tuner.pl index fcfa22e26..104c16dae 100755 --- a/v4l/scripts/tuner.pl +++ b/v4l/scripts/tuner.pl @@ -8,12 +8,17 @@ my %data; my $H = shift; my $C = shift; +my %blacklist; open IN, "<$H"; while () { # defines in header file if (/#define\s+(TUNER_\w+)\s+(\d+)/) { - $data{$1}->{nr} = $2; + my $num=$2; + $data{$1}->{nr} = $num; + if (/#define\s+TUNER_TDA9887/) { + $blacklist{$num}=1; + } next; } } @@ -37,6 +42,10 @@ while () { } foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + if ($blacklist{$data{$item}->{nr}}) { + next; + } + printf("tuner=%d - %s", $data{$item}->{nr}, $data{$item}->{name}); print "\n"; } -- cgit v1.2.3