Bug#760168: dh-systemd: support for -X option

2014-09-02 Thread Michael Stapelberg
Did you try whether it actually works already?

In dh_compress and dh_fixperms I see -X is documented but I don’t see
special code to support it. Given that dh_systemd_* also use the same
Debhelper library functions that those other two examples use, I think
it should already just work…?

On Mon, Sep 1, 2014 at 4:32 PM, Simon McVittie s...@debian.org wrote:
 Package: dh-systemd
 Version: 1.21
 Severity: wishlist

 debhelper(7) says:

 COMMON DEBHELPER OPTIONS
The following command line options are supported by some debhelper
programs [...]
-Xitem, --exclude=item
Exclude an item from processing. This option may be used multiple
times, to exclude more than one thing.

 It would be nice if dh_systemd_start and dh_systemd_enable supported the
 -X option, so that maintainers of a package with some normal services
 and a smaller number of special-purpose services that should not normally
 be enabled (similar to systemd's own debug-shell.service) could just
 list the exceptions:

 override_dh_systemd_enable:
 dh_systemd_enable -Xdebug-thing.service

 override_dh_systemd_start:
 dh_systemd_start -Xdebug-thing.service

 Regards,
 S

 ___
 Pkg-systemd-maintainers mailing list
 pkg-systemd-maintain...@lists.alioth.debian.org
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers



-- 
Best regards,
Michael


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760168: dh-systemd: support for -X option

2014-09-02 Thread Simon McVittie
On 02/09/14 08:34, Michael Stapelberg wrote:
 Did you try whether it actually works already?

Yes I did, and no it doesn't.

 In dh_compress and dh_fixperms I see -X is documented but I don’t see
 special code to support it.

Library code in Debian::Debhelper parses -X options and
$DH_ALWAYS_EXCLUDE and puts them in $dh{EXCLUDE}, then converts them
into find(1) syntax and puts that in $dh{EXCLUDE_FIND}, but it's up to
individual dh_* utilities to make use of one or the other of those.

In dh_compress:

if (@files  defined($dh{EXCLUDE})  $dh{EXCLUDE}) {
my @new=();
foreach (@files) {
my $ok=1;
foreach my $x (@{$dh{EXCLUDE}}) {
if (/\Q$x\E/) {
$ok='';
last;
}
}
push @new,$_ if $ok;
}
@files=@new;
}

and in dh_fixperms:

my $find_options='';
if (defined($dh{EXCLUDE_FIND})  $dh{EXCLUDE_FIND} ne '') {
$find_options=! \\( $dh{EXCLUDE_FIND} \\);
}

Regards,
S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760168: dh-systemd: support for -X option

2014-09-02 Thread Michael Stapelberg
On Tue, Sep 2, 2014 at 9:42 AM, Simon McVittie s...@debian.org wrote:
 On 02/09/14 08:34, Michael Stapelberg wrote:
 Did you try whether it actually works already?

 Yes I did, and no it doesn't.

 In dh_compress and dh_fixperms I see -X is documented but I don’t see
 special code to support it.

 Library code in Debian::Debhelper parses -X options and
 $DH_ALWAYS_EXCLUDE and puts them in $dh{EXCLUDE}, then converts them
 into find(1) syntax and puts that in $dh{EXCLUDE_FIND}, but it's up to
 individual dh_* utilities to make use of one or the other of those.
Thanks for clarifying.

Could you please come up with a patch for supporting this? I’m very
constrained on time these days, so it’s unlikely I’d address the issue
anytime soon.


 In dh_compress:

 if (@files  defined($dh{EXCLUDE})  $dh{EXCLUDE}) {
 my @new=();
 foreach (@files) {
 my $ok=1;
 foreach my $x (@{$dh{EXCLUDE}}) {
 if (/\Q$x\E/) {
 $ok='';
 last;
 }
 }
 push @new,$_ if $ok;
 }
 @files=@new;
 }

 and in dh_fixperms:

 my $find_options='';
 if (defined($dh{EXCLUDE_FIND})  $dh{EXCLUDE_FIND} ne '') {
 $find_options=! \\( $dh{EXCLUDE_FIND} \\);
 }

 Regards,
 S




-- 
Best regards,
Michael


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760168: dh-systemd: support for -X option

2014-09-01 Thread Simon McVittie
Package: dh-systemd
Version: 1.21
Severity: wishlist

debhelper(7) says:

COMMON DEBHELPER OPTIONS
   The following command line options are supported by some debhelper
   programs [...]
   -Xitem, --exclude=item
   Exclude an item from processing. This option may be used multiple
   times, to exclude more than one thing.

It would be nice if dh_systemd_start and dh_systemd_enable supported the
-X option, so that maintainers of a package with some normal services
and a smaller number of special-purpose services that should not normally
be enabled (similar to systemd's own debug-shell.service) could just
list the exceptions:

override_dh_systemd_enable:
dh_systemd_enable -Xdebug-thing.service

override_dh_systemd_start:
dh_systemd_start -Xdebug-thing.service

Regards,
S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org