Re: #200264 and xmessage
Hilmar Preusse <hille42@web.de> schrieb:
> On 26.04.04 Frank Küster (frank@debian.org) wrote:
>> Hilmar Preusse <hille42@web.de> schrieb:
>
> Hi all,
>
>> > The source is attached, builds and runs with libxaw6 and libxaw7.
>> > Further the patch for debian/rules.
>>
>> Thank you. Wouldn't it be better to give it on argument, and let it
>> write
>>
>> "Please install the package\n\"perl-tk\" to use $1."
>>
>> so that we can reuse it when there's an other program that depends on
>> perl-tk? Or even two arguments, the second being the package name?
>>
> I think we don't need 2 arguments. patch attached, to be applied to
> my first posted C file. Is now able to display multi line messages.
>
> example usage:
> ./texdoctk-warn "please install the package\n\"perl-tk\" to use texdoctk"
Thank you, I've tested it, works well. This is my suggestion for
texdoctk itself:
***************************************************
--- debian/tetex-bin/debian/patches/patch-texdoctk 2004/04/29 15:46:51 1.1.2.1
+++ debian/tetex-bin/debian/patches/patch-texdoctk 2004/04/30 13:21:14 1.1.2.2
@@ -1,5 +1,5 @@
---- tetex-bin-2.0.2-CVS/texk/tetex/texdoctk.orig Fri Apr 23 13:54:17 2004
-+++ tetex-bin-2.0.2-CVS/texk/tetex/texdoctk Fri Apr 23 13:55:18 2004
+--- tetex-bin-CVS/texk/tetex/texdoctk.orig Fri Apr 30 15:12:14 2004
++++ tetex-bin-CVS/texk/tetex/texdoctk Fri Apr 30 15:15:09 2004
@@ -1,6 +1,4 @@
-#!/usr/bin/env perl
-# We started with a hack provided by Thomas Esser. This expression replaces
@@ -28,9 +28,9 @@
+ $message = "$progname: problem loading the Tk module:\n $@\nHave you installed the perl-tk package?\n";
+ }
+
-+ if (! -t STDOUT and exists $ENV{DISPLAY}
-+ and system("command -v xmessage >/dev/null 2>&1")==0) {
-+ exec("xmessage", $message);
++ if (! -t STDOUT and exists $ENV{DISPLAY})
++ {
++ exec("texdoctk-warn", $message);
+ } else {
+ die $message;
+ }
***************************************************
Furthermore, Policy requires a manpage, I'd suggest
***************************************************
.TH "texdoctk-warn" "1" "April 2004" "teTeX" "teTeX"
.PP
.SH "NAME"
texdoctk-warn \- warn if a needed file is missing.
.PP
.SH "SYNOPSIS"
.PP
\fBtexdoctk-warn\fP "message"
.PP
.SH "DESCRIPTION"
.PP
\fBtexdoctk-warn\fP takes its single argument and displays it in an X
window, using only libxaw and the basic Xlibs. You don't even need to
rely on xmessage from the xbase-clients package to be installed.
.PP
.SH "BUGS"
.PP
None known\&.
.PP
.SH "AUTHOR"
.PP
Stefan Ulrich <stefan.ulrich@zen.co.uk> and Hilmar Preusse <hille42@web.de>\&.
.PP
This manual page was written by Frank Küster
<frank@kuesterei\&.ch>, for
the Debian GNU/Linux system\&. It may be used by other distributions
without contacting the author\&. Any mistakes or omissions in the
manual page are my fault; inquiries about or corrections to this
manual page should be directed to me (and not to the primary author)\&.
***************************************************
I'll check that in with the respective changes to debian/rules, if it's
o.k. for you.
Regards, Frank
--
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie
Reply to: