Debian::Rules(3pm) | User Contributed Perl Documentation | Debian::Rules(3pm) |
Debian::Rules - handy manipulation of debian/rules
my $r = Debian::Rules->new('debian/rules'); my $r = Debian::Rules->new( { filename => 'debian/rules' } ); $r->is_dhtiny && print "Using the latest and greatest\n"; $r->is_quiltified && print "quilt rules the rules\n"; # file contents changed externally $r->parse; $r->add_quilt; $r->drop_quilt; $r->write; # or undef($r);
Some times, one needs to know whether debian/rules uses the dh(1) tiny variant, or whether it is integrated with quilt(1). Debian::Rules provides facilities to check this, as well as adding/removing quilt integration.
Modified contents are written to file either vie the "write" method, or when the object reference goes out of scope (via DESTROY).
"new" is the standard Class::Accessor constructor, with the exception that if only one, non-reference argument is provided, it is treated as a value for the filename field.
If a file name is given, the constructor calls "read" to read the file contents into memory.
One of filename or lines is mandatory.
%: dh $@
(any options on the "dh" command line ignored).
If "lines" points to an empty array, the file is removed.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2023-02-21 | perl v5.36.0 |