On 20/02/14 21:38, Guillem Jover wrote:
Hi!
On Thu, 2014-02-20 at 18:23:59 +0100, Eugen Dedu wrote:
Package: dpkg
Version: 1.17.6
Severity: normal
I need to use dir_to_symlink and see in 'man dpkg-maintscript-helper':
"[...] we can call the program only if we know that the required
command is supported by the currently installed dpkg:
if dpkg-maintscript-helper supports command; then
dpkg-maintscript-helper command ...
fi
"
On my computer dpkg-maintscript-helper supports always returns 1:
snoopy:~$ dpkg-maintscript-helper supports dir_to_symlink; echo $?
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_NAME
missing
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_PACKAGE
missing
1
snoopy:~$ dpkg-maintscript-helper supports fasdfa; echo $?
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_NAME
missing
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_PACKAGE
missing
1
snoopy:~$ dpkg-maintscript-helper supports xyz; echo $?
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_NAME
missing
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_PACKAGE
missing
1
Tha's because the mentioned variables are not defined in the
environment, as dpkg does. Check this instead:
$ env DPKG_MAINTSCRIPT_NAME=postinst DPKG_MAINTSCRIPT_PACKAGE=pkg \
dpkg-maintscript-helper supports dir_to_symlink
$ echo $?
0
I'm thus closing this bug report.
May I suggest to add this information on the man page? I think it is
not evident to see that the program might give different results
depending on the environment variables. (By the way, I myself do not
see why it gives different results.)
--
Eugen
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org