diff options
author | Guillem Jover <guillem@debian.org> | 2016-08-15 21:07:44 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-10-30 04:43:34 +0100 |
commit | 26e44471eb8d53b7a468d5cf3eeb72a875246d8b (patch) | |
tree | f33bdb020814adf5914020b59bb2e9ee8904a492 /scripts/Dpkg | |
parent | 4570cd64ebdaf8d16a85e718cd700f6bfddbf305 (diff) | |
download | dpkg-26e44471eb8d53b7a468d5cf3eeb72a875246d8b.tar.gz |
Dpkg::Substavars: Make the parse method return the number of substvars parsed
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r-- | scripts/Dpkg/Substvars.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 65e14e125..4104d18e8 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -195,10 +195,13 @@ Add new substitutions read from $file. Add new substitutions read from the filehandle. $desc is used to identify the filehandle in error messages. +Returns the number of substitutions that have been parsed with success. + =cut sub parse { my ($self, $fh, $varlistfile) = @_; + my $count = 0; local $_; binmode($fh); @@ -210,7 +213,10 @@ sub parse { $varlistfile, $.); } $self->set($1, $2); + $count++; } + + return $count } =item $s->set_version_substvars($sourceversion, $binaryversion) @@ -399,6 +405,8 @@ sub output { Obsolete substvar: Emit an error on Source-Version substvar usage. +New return: $s->parse() now returns the number of parsed substvars. + =head2 Version 1.04 (dpkg 1.18.0) New method: $s->filter(). |