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

Bug#46671: marked as done (dpkg: /usr/share, and libdpkg issues)



Your message dated Sun, 5 Dec 1999 18:20:55 +0100
with message-id <19991205182055.C12336@mors.net>
and subject line Bug#46671: dpkg: /usr/share, and libdpkg issues
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 5 Oct 1999 09:22:45 +0000
Received: (qmail 3508 invoked from network); 5 Oct 1999 09:22:36 -0000
Received: from azure.humbug.org.au (mail@203.24.22.40)
  by master.debian.org with SMTP; 5 Oct 1999 09:22:36 -0000
Received: from aj by azure.humbug.org.au with local (Exim 3.03 #1 (Debian))
	id 11YQne-0005Hj-00; Tue, 05 Oct 1999 19:22:22 +1000
From:  <aj@azure.humbug.org.au>
Subject: dpkg: /usr/share, and libdpkg issues
To: submit@bugs.debian.org
X-Mailer: bug 3.2.2
Message-Id: <E11YQne-0005Hj-00@azure.humbug.org.au>
Date: Tue, 05 Oct 1999 19:22:22 +1000

Package: dpkg
Version: 1.4.1.6
Severity: normal

Hello world,

dpkg installs dpkg.h in /usr/share/include/dpkg/, which gcc doesn't search
by default. /usr/include would seem a more sensible place.

Also, since dpkg-dev and dpkg both use /usr/doc/dpkg, the /usr/doc/dpkg
symlink to /usr/share/doc/dpkg wasn't made.  apt-get install dpkg;
apt-get install dpkg-dev should be enough to duplicate this. I'd suggest
adding a Conflicts: line to make sure they're both upgraded concurrently.

#include <dpkg/dpkg.h> gives errors unless the following symbols are defined:
	#define NONRETURNING 
	#define NONRETURNPRINTFFORMAT(a,b)
	#define PRINTFFORMAT(a,b)

dpkg itself defines them in a meaningful way, these definitions should
probably be moved into dpkg.h itself.

Finally, and as more of a wishlist item, it'd be nice if the cmpversions()
function from main/enquiry.c was included in libdpkg itself. A possible
implementation might be:



#define NONRETURNING 
#define NONRETURNPRINTFFORMAT(a,b)
#define PRINTFFORMAT(a,b)

#include <dpkg/dpkg.h>
#include <dpkg/dpkg-db.h>

const char thisname[] = "main"; /* defined separately in each program */
const char printforhelp[] = "foo";

/* returns:
 *     0 if true
 *     1 if false
 *
 *    -1 for bad operand
 *    -2 for bad version
 *
 * eg,
 *    0 == cmpversions("2.0-1", "<<", "3.4-4");
 */

static int cmpversions(char *left, char *op, char *right) {
  struct relationinfo {
    const char *string;
    /* These values are exit status codes, so 0=true, 1=false */
    int if_lesser, if_equal, if_greater;
    int if_none_a, if_none_both, if_none_b;
  };

  static const struct relationinfo relationinfos[]= {
   /*              < = > !a!2!b  */
    { "le",        0,0,1, 0,0,1  },
    { "lt",        0,1,1, 0,1,1  },
    { "eq",        1,0,1, 1,0,1  },
    { "ne",        0,1,0, 0,1,0  },
    { "ge",        1,0,0, 1,0,0  },
    { "gt",        1,1,0, 1,1,0  },
    { "le-nl",     0,0,1, 1,0,0  }, /* Here none        */
    { "lt-nl",     0,1,1, 1,1,0  }, /* is counted       */
    { "ge-nl",     1,0,0, 0,0,1  }, /* than any version.*/
    { "gt-nl",     1,1,0, 0,1,1  }, /*                  */
    { "<",         0,0,1, 0,0,1  }, /* For compatibility*/
    { "<=",        0,0,1, 0,0,1  }, /* with dpkg        */
    { "<<",        0,1,1, 0,1,1  }, /* control file     */
    { "=",         1,0,1, 1,0,1  }, /* syntax           */
    { ">",         1,0,0, 1,0,0  }, /*                  */
    { ">=",        1,0,0, 1,0,0  },
    { ">>",        1,1,0, 1,1,0  },
    {  0                         }
  };

  const struct relationinfo *rip;
  const char *emsg;
  struct versionrevision a, b;
  int r;
  
  for (rip=relationinfos; rip->string && strcmp(rip->string,op); rip++);

  if (!rip->string) return -1; /* bad op */

  if (*left && strcmp(left,"<unknown>")) {
    emsg= parseversion(&a,left);
    if (emsg) {
      return -2;   /* bad version syntax */
    }
  } else {
    blankversion(&a);
  }
  if (*right && strcmp(right,"<unknown>")) {
    emsg= parseversion(&b,right);
    if (emsg) {
      return -2;   /* bad version syntax */
    }
  } else {
    blankversion(&b);
  }
  if (!informativeversion(&a)) {
    return(informativeversion(&b) ? rip->if_none_a : rip->if_none_both);
  } else if (!informativeversion(&b)) {
    return(rip->if_none_b);
  }
  r= versioncompare(&a,&b);
  if (r>0) return(rip->if_greater);
  else if (r<0) return(rip->if_lesser);
  else return(rip->if_equal);
}


Thanks in advance.

Cheers,
aj

-- System Information
Debian Release: potato
Kernel Version: Linux azure 2.0.33 #1 Fri May 15 19:45:40 EST 1998 i586 unknown

Versions of the packages dpkg depends on:
ii  libc6           2.1.2-0pre12   GNU C Library: Shared libraries and timezone
ii  libncurses4     4.2-3.2        Shared libraries for terminal handling
ii  libstdc++2.9-gl 2.91.66-2      The GNU stdc++ library (EGCS version)
---------------------------------------
Received: (at 46671-done) by bugs.debian.org; 5 Dec 1999 17:38:52 +0000
Received: (qmail 16979 invoked from network); 5 Dec 1999 17:38:51 -0000
Received: from janeway.cistron.net (root@195.64.65.23)
  by master.debian.org with SMTP; 5 Dec 1999 17:38:51 -0000
Received: from lightning.mors.net (root@wichert.cistron.nl [195.64.66.141])
	by janeway.cistron.net (8.9.3/8.9.3/Debian/GNU) with ESMTP id SAA17038;
	Sun, 5 Dec 1999 18:38:48 +0100
Received: (from wichert@localhost)
	by lightning.mors.net (8.9.3/8.9.3/Debian 8.9.3-6) id SAA12466;
	Sun, 5 Dec 1999 18:20:56 +0100
Date: Sun, 5 Dec 1999 18:20:55 +0100
From: Wichert Akkerman <wichert@cistron.nl>
To: aj@azure.humbug.org.au, 46671-done@bugs.debian.org
Subject: Re: Bug#46671: dpkg: /usr/share, and libdpkg issues
Message-ID: <19991205182055.C12336@mors.net>
References: <E11YQne-0005Hj-00@azure.humbug.org.au>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="FsscpQKzF/jJk6ya"
User-Agent: Mutt/1.0pre4i
In-Reply-To: <E11YQne-0005Hj-00@azure.humbug.org.au>; from aj@azure.humbug.org.au on Tue, Oct 05, 1999 at 07:22:22PM +1000


--FsscpQKzF/jJk6ya
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable


libdpkg and the accompanying includefiles are no longer shipped in the
package, so this bug can be closed.

Wichert.

--=20
   ________________________________________________________________
 / Generally uninteresting signature - ignore at your convenience  \
| wichert@liacs.nl                    http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

--FsscpQKzF/jJk6ya
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjhKnvcACgkQPLiSUC+jvC17JwCbB9N5EwpQCfJechqFXlN0XpLF
TW8An2VnmNRlEHCdxPt4HprAlPuy4cwa
=tofb
-----END PGP SIGNATURE-----

--FsscpQKzF/jJk6ya--


Reply to: