Not found locally for Dpkg::Substvars. Try Google search
Dpkg::Substvars β handle variable substitution in strings
| Use Case | Command | Description |
|---|---|---|
| π§ Create object | $s = Dpkg::Substvars->new($file) |
New substvars object, optionally loading from file |
| β Set substitution | $s->set($key, $value) |
Add or replace a variable |
| π¦ Set version vars | $s->set_version_substvars($srcver, $binver) |
Define ${binary:Version}, ${source:Version}, etc. |
| π Perform substitution | $newstring = $s->substvars($string) |
Replace variables in string |
| π Filter substvars | $s->filter(remove => $func) or $s->filter(keep => $func) |
Remove or keep variables matching callback |
| πΎ Save to file | $s->save($file) |
Write all nonβautomatic substvars to file |
It provides a class which is able to substitute variables in strings.
$s = Dpkg::Substvars->new($file) β Create a new object that can do substitutions. By default it contains generic substitutions like ${Newline}, ${Space}, ${Tab}, ${dpkg:Version} and ${dpkg:Upstream-Version}. Additional substitutions will be read from the $file passed as parameter. It keeps track of which substitutions were actually used (only counting substvars(), not get()), and warns about unused substvars when asked to. The substitutions that are always present are not included in these warnings.$s->set($key, $value) β Add/replace a substitution.$s->set_as_used($key, $value) β Add/replace a substitution and mark it as used (no warnings will be produced even if unused).$s->set_as_auto($key, $value) β Add/replace a substitution and mark it as used and automatic (no warnings will be produced even if unused).$s->get($key) β Get the value of a given substitution.$s->delete($key) β Remove a given substitution.$s->mark_as_used($key) β Prevents warnings about an unused substitution, for example if it is provided by default.$s->parse($fh, $desc) β 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.$s->load($file) β Add new substitutions read from $file.$s->set_version_substvars($sourceversion, $binaryversion) β Defines ${binary:Version}, ${source:Version} and ${source:Upstream-Version} based on the given version strings. These will never be warned about when unused.$s->set_arch_substvars() β Defines architecture variables: ${Arch}. This will never be warned about when unused.$s->set_vendor_substvars() β Defines vendor variables: ${vendor:Name} and ${vendor:Id}. These will never be warned about when unused.$s->set_desc_substvars() β Defines source description variables: ${source:Synopsis} and ${source:Extended-Description}. These will never be warned about when unused.$s->set_field_substvars($ctrl, $prefix) β Defines field variables from a Dpkg::Control object, with each variable having the form ${$prefix:$field}. They will never be warned about when unused.$newstring = $s->substvars($string) β Substitutes variables in $string and return the result in $newstring.$s->warn_about_unused() β Issues warning about any variables that were set, but not used.$s->set_msg_prefix($prefix) β Define a prefix displayed before all warnings/error messages output by the module.$s->filter(remove => $rmfunc)$s->filter(keep => $keepfun) β Filter the substitution variables, either removing or keeping all those that return true when $rmfunc->($key) or $keepfunc->($key) is called."$s" β Return a string representation of all substitutions variables except the automatic ones.$str = $s->output([$fh]) β Return all substitutions variables except the automatic ones. If $fh is passed print them into the filehandle.$s->save($file) β Store all substitutions variables except the automatic ones in the indicated file.$s->no_warn().$s->set_vendor_substvars().$s->set_desc_substvars().Source-Version substvar usage.$s->parse() now returns the number of parsed substvars.$s->set_field_substvars().$s->filter().$s->set_as_auto().$binaryversion in $s->set_version_substvars(), passing a single argument is still supported.$s->mark_as_used().$s->no_warn(), use $s->mark_as_used() instead.$s->set_as_used().Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
2026-09-09 12:22 @2600:1f28:365:80b0:60b0:dfa5:fbc9:9f8f
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)