[libconfig-model-lcdproc-perl] 04/12: use {% ... %} to provide model snippet instead of { ... }
dod at debian.org
dod at debian.org
Sat May 31 13:26:15 UTC 2014
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to branch master
in repository libconfig-model-lcdproc-perl.
commit 6d725ee1aa40c57bca9801b03b922b7b56f76892
Author: Dominique Dumont <dod at debian.org>
Date: Fri May 30 20:52:21 2014 +0200
use {% ... %} to provide model snippet instead of { ... }
---
debian/patches/tweak-lcdd-conf | 83 +++++++++++++++++++++++++-----------------
1 file changed, 49 insertions(+), 34 deletions(-)
diff --git a/debian/patches/tweak-lcdd-conf b/debian/patches/tweak-lcdd-conf
index 548a35c..719c611 100644
--- a/debian/patches/tweak-lcdd-conf
+++ b/debian/patches/tweak-lcdd-conf
@@ -1,20 +1,60 @@
--- a/examples/lcdproc/LCDd.conf
+++ b/examples/lcdproc/LCDd.conf
-@@ -63,10 +63,11 @@
+@@ -34,6 +34,26 @@
+ # the driver modules and will thus not be able to
+ # function properly.
+ # NOTE: Always place a slash as last character !
++# {%
++# default~
++# value_type=uniline
++# compute
++# formula="my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
++# warn \"cannot run dpkg-architecture\" unless $triplet ;
++# chomp $triplet;
++# \"/usr/lib/$triplet/lcdproc/\";"
++# use_eval=1
++# allow_override=1 -
++# warn_unless:dir
++# code=" defined $_ ? -d : 1"
++# msg="missing DriverPath dir"
++# fix="my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
++# warn \"cannot run dpkg-architecture\" unless $triplet ;
++# chomp $triplet;
++# my $res = \"/usr/lib/$triplet/lcdproc/\";
++# $_ = $res;
++# "
++# - %}
+ DriverPath=server/drivers/
+
+ # Tells the server to load the given drivers. Multiple lines can be given.
+@@ -63,10 +83,11 @@
#ReportLevel=3
# Should we report to syslog instead of stderr? [default: no; legal: yes, no]
-+# { upstream_default~ default=yes }
++# {% upstream_default~ default=yes %}
#ReportToSyslog=yes
# User to run as. LCDd will drop its root privileges and run as this user
-# instead. [default: nobody]
-+# instead. { default~ }
++# instead. {% default~ %}
User=nobody
# The server will stay in the foreground if set to yes.
--- a/examples/lcdproc/lcdconf2model.pl
+++ b/examples/lcdproc/lcdconf2model.pl
+@@ -197,10 +197,10 @@
+ my $square_model = '';
+
+ my $square_rexp = '\[(\s*\w+\s*:[^\]]*)\]';
+- if ($$info_r =~ /$square_rexp/ ) {
++ if ($$info_r =~ /$square_rexp/s) {
+ my $info = $1 ;
+ say "class $ini_class element $ini_param info: '$info'" if $verbose;
+- $$info_r =~ s/$square_rexp//g; # remove all remaining square_rexp
++ $$info_r =~ s/$square_rexp//gs; # remove all remaining square_rexp
+ $square_model .= ' '. info_to_model($info,$value_type, $info_r) ;
+ }
+
@@ -208,22 +208,23 @@
# or use the value found in INI file as default
$ini_v =~ s/^"//g;
@@ -26,15 +66,18 @@
# get model information from comment (written between curly brackets)
my $curly_model = '';
- my $curly_rexp = '{(\s*\w+.*)}' ;
- while ($$info_r =~ /$curly_rexp/) {
+- my $curly_rexp = '{(\s*\w+.*)}' ;
+- while ($$info_r =~ /$curly_rexp/) {
- my $model_snippet = $1 ;
- say "class $ini_class element $ini_param model snippet: '$model_snippet'"
++ my $curly_rexp = '{%(\s*\w+.*?)%}' ;
++ while ($$info_r =~ /$curly_rexp/s) {
+ $curly_model = $1 ;
+ say "class $ini_class element $ini_param model snippet: '$curly_model'"
if $verbose;
- $$info_r =~ s/$curly_rexp//;
+- $$info_r =~ s/$curly_rexp//;
- $load .= ' '. $model_snippet ;
++ $$info_r =~ s/$curly_rexp//s;
}
# return a string containing model specifications
@@ -44,31 +87,3 @@
};
# Now let's take care of the special cases. This one deals with "Driver"
-@@ -241,7 +242,26 @@
-
- # Ensure that DriverPath will end with a slash
- $dispatch{"LCDd::server"}{DriverPath} = sub {
-- return $dispatch{_default_}->( @_ ) . q! match="/$"! ;
-+my $model_snippet = q!
-+ value_type=uniline
-+ compute
-+ formula="my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
-+warn \"cannot run dpkg-architecture\" unless $triplet ;
-+chomp $triplet;
-+\"/usr/lib/$triplet/lcdproc/\";"
-+ use_eval=1
-+ allow_override=1 -
-+ match=/$
-+ warn_unless:dir
-+ code=" defined $_ ? -d : 1"
-+ msg="missing DriverPath dir"
-+ fix="my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
-+warn \"cannot run dpkg-architecture\" unless $triplet ;
-+chomp $triplet;
-+my $res = \"/usr/lib/$triplet/lcdproc/\";
-+$_ = $res;
-+" - !;
-+ return $dispatch{_default_}->( @_ ) . $model_snippet ;
- };
-
- # like default but ensure that parameter is integer
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-lcdproc-perl.git
More information about the Pkg-perl-cvs-commits
mailing list