Re: Bad error output from gnome-config



WTF, I sent two messages, and only the second one seems to have gone
through. Here is the full text of the first and second messages
together, without which it all get's confusing.

On 26 Jul 2001 13:51:14 -0700, Loban Rahman wrote:
> In Gnome 1.2, one can use gnome-config to find out the version of
> modules installed, for example:
> 
>     gnome-config --modversion applets
>         (RESULT = applets-1.4.0.4)
>     gnome-config --modversion gnomemm
>         (RESULT = gnomemm-1.2.0)
> 
> And to get the version of gnome-libs itself, one uses
> 
>     gnome-config --version
>         (RESULT = gnome-libs-1.2.13)
> 
> This is all well and good. The output has a consistent format. So, in my
> configure.in for several projects I have, I parse the output of the
> above commands to check for library dependencies.
> 
> Now, here's my beef:
> If suppose I do
> 
>     gnome-config --modversion somemodule
> 
> and somemodule does not exist, I get a RESULT =
> 
>     Unknown library `somemodule'
>     gnome-libs-1.2.13
> 
> Which is very inconsistent output. The command is requesting the version
> of a module, and it is getting the version of gnome-libs. Granted, it is
> printing an error message, but the extra info after that is completely
> useless, and makes parsing the output difficult.
> 
> In addition, it exits with exit status 0 instead of 1 to indicate an
> error.
> 
> I propose that gnome-config, in the above situation, just print the
> error message and exit. I've attached a patch for gnome-config.in (I
> used "cvs diff -u", is that correct?)
> 
>     = Loban
>

Arg, another inconsistency. The RESULT shown above is incorrect,
instead, the command outputs RESULT =

    gnome-libs 1.2.13

Even though all other *-config scripts outputs _just_ the version,
gnome-config thought it wise to output the package name first, a space,
and then the version. Here is an updated patch which fixes everything
I've mentioned. I don't have cvs write access, so could someone attach
this patch or provide me access?

    = Loban


Index: gnome-config.in
===================================================================
RCS file: /cvs/gnome/gnome-libs/gnome-config.in,v
retrieving revision 1.29
diff -u -r1.29 gnome-config.in
--- gnome-config.in	2000/11/12 14:39:25	1.29
+++ gnome-config.in	2001/07/26 20:58:36
@@ -18,7 +18,7 @@
 pkgdatadir=${datadir}/@PACKAGE@
 pkglibdir=${libdir}/@PACKAGE@
 pkgincludedir=${includedir}/@PACKAGE@
-MODULE_VERSION= PACKAGE@- VERSION@
+MODULE_VERSION=""
 
 interface_version_installed() {
     error=true
@@ -182,7 +182,7 @@
 
     case $1 in
     --version)
-	echo @PACKAGE@ @VERSION@
+	echo @VERSION@
 	exit 0
 	;;
     --exec-prefix)
@@ -371,6 +371,10 @@
 fi
 
 if $modversion; then
+    if test -n "$MODULE_VERSION"; then
+	exit 1
+    fi
+
     echo $MODULE_VERSION
     exit 0
 fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]