Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   Debconf syntax error message that I don't understand (http://www.linux-archive.org/debian-development/551649-debconf-syntax-error-message-i-dont-understand.html)

Frank Küster 07-11-2011 10:17 PM

Debconf syntax error message that I don't understand
 
Hi,

I am at a loss with shell script that uses debconf. The script itself
is in /etc/libpaper/, but since it is often called from maintainer
scripts, it uses debconf.

The problem is that debconf says it didn't get the right number of
arguments, but I think it did. This is the relevant line of code:

db_subst texlive-base/texconfig_ignorant binary "$binary"

and this is what debconf says:

+ db_subst texlive-base/texconfig_ignorant binary dvipdfmx
+ _db_cmd SUBST texlive-base/texconfig_ignorant binary dvipdfmx
+ IFS= printf %s
SUBST texlive-base/texconfig_ignorant,binary,dvipdfmx
+ IFS=
read -r _db_internal_line
debconf (developer): <-- SUBST texlive-base/texconfig_ignorant,binary,dvipdfmx
debconf (developer): --> 20 Incorrect number of arguments
+ RET=20 Incorrect number of arguments
+ return 20

The check in ConfModule looks like this:

sub command_subst {
my $this = shift;
return $codes{syntaxerror}, "Incorrect number of arguments" if @_ < 2;

So why does it think it has less than two arguments when what it gets is

texlive-base/texconfig_ignorant,binary,dvipdfmx

I even tried to feed it an additional "foo" at the end, but that doesn't
change anything. Probably I'm missing something trivial...

Regards, Frank

P.S. Script at
http://anonscm.debian.org/viewvc/debian-tex/texlive2009/trunk/texlive-base/debian/texlive-base.libpaper?view=log

--
Frank Küster
Sprecher B90/Grüne OV Miltenberg und Umgebung
VCD Miltenberg, ADFC Aschaffenburg-Miltenberg
Debian Developer (TeXLive)


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87pqlgv4wt.fsf@alhambra.kuesterei.ch">http://lists.debian.org/87pqlgv4wt.fsf@alhambra.kuesterei.ch

Joey Hess 07-12-2011 07:09 PM

Debconf syntax error message that I don't understand
 
Frank Küster wrote:
> Hi,
>
> I am at a loss with shell script that uses debconf. The script itself
> is in /etc/libpaper/, but since it is often called from maintainer
> scripts, it uses debconf.
>
> The problem is that debconf says it didn't get the right number of
> arguments, but I think it did. This is the relevant line of code:
>
> db_subst texlive-base/texconfig_ignorant binary "$binary"
>
> and this is what debconf says:
>
> + db_subst texlive-base/texconfig_ignorant binary dvipdfmx
> + _db_cmd SUBST texlive-base/texconfig_ignorant binary dvipdfmx
> + IFS= printf %s
SUBST texlive-base/texconfig_ignorant,binary,dvipdfmx

Your script is setting IFS=","

This was supposed to be dealt with in #381619, but the change was broken.
I've committed the right change to debconf for version 1.5.41.

All you need to do to fix it in your script though is to restore IFS
before you start talking to debconf.

--
see shy jo


All times are GMT. The time now is 05:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.