diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/Makefile | 4 | ||||
-rwxr-xr-x | v4l/scripts/prep_commit_msg.pl | 27 |
2 files changed, 23 insertions, 8 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index abc53110c..ad499751d 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -231,8 +231,8 @@ endif links:: @echo creating symbolic links... - @find ../linux/drivers/media -name '*.[ch]' -type f -exec ln -sf '{}' . \; - @find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \; + @find ../linux/drivers/media -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. + @find ../linux/sound -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=. # This link is so code with #include "oss/*.h" will find its header files oss: diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl index a4594c7f9..f4047c6ba 100755 --- a/v4l/scripts/prep_commit_msg.pl +++ b/v4l/scripts/prep_commit_msg.pl @@ -5,16 +5,31 @@ my $autopatch = shift; # Get Hg username from environment my $user = $ENV{HGUSER}; -# Didn't work? Try the .hgrc file -if ($user eq "") { - open IN, "<$ENV{HOME}/.hgrc"; +sub hgrcuser($) +{ + my $file = shift; + my $ui = 0; + open IN, '<', $file; while (<IN>) { - if(/^\s*username\s*=\s*(\S.*)$/) { - $user = $1; - last; + $ui = 1 if (/^\s*\[ui\]/); + if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { + close IN; + return($1); } } close IN; + return(""); +} + +# Didn't work? Try the repo's .hgrc file +if ($user eq "") { + my $hgroot = `hg root`; + chomp($hgroot); + $user = hgrcuser("$hgroot/.hg/hgrc"); +} +# Ok, try ~/.hgrc next +if ($user eq "") { + $user = hgrcuser("$ENV{HOME}/.hgrc"); } # Still no luck? Try some other environment variables |