--- Begin Message ---
Source: deets
Source-Version: 0.0.7-1
Severity: serious
Tags: patch
Hi!
deets FTBFS due to the new libdpkg API changes, here's a set of
patches I cooked some time ago while implementing those changes,
fixing that and some other smallish issues.
For the dpkg db dir, I've just let it by whatever the default is, if
you want to explicitly set it you can use dpkg_db_set_dir() before
opening the db. I coul resend the patch if you'd want that.
BTW it seems 0.0.7 didn't get pushed to the git repo? The patches are
against master, though. There's no tags either. :)
regards,
guillem
>From 6c411908684f36368dc2eb201df1dfc4be27017f Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Fri, 26 Nov 2010 08:15:13 +0100
Subject: [PATCH 1/5] Add missing patterns to .gitignore
---
.gitignore | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 5761abc..feccf6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,10 @@
*.o
+.deps/
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache/
+config.*
+config-aux/
+configure
+luau
--
1.7.4.1
>From 32165c3f963a36dc17cf8bd39d91b09d568ecab4 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Fri, 26 Nov 2010 08:16:08 +0100
Subject: [PATCH 2/5] Add missing <string.h> for memset()
---
luau.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/luau.c b/luau.c
index f6757cd..b2993ae 100644
--- a/luau.c
+++ b/luau.c
@@ -20,6 +20,7 @@
#include <setjmp.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <pwd.h>
--
1.7.4.1
>From dc5a7f1057d841529f4b541d9e6ba9c30e9b38e9 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Fri, 26 Nov 2010 08:17:10 +0100
Subject: [PATCH 3/5] Fix compilation warnings from char arrays usage
The functions expect a pointer to char, which a char array fullfills w/o
need to dereference the variable. This also avoids the need for the
casts.
---
luau.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/luau.c b/luau.c
index b2993ae..b086004 100644
--- a/luau.c
+++ b/luau.c
@@ -241,7 +241,7 @@ deets_tempstat (lua_State * L)
else
lua_pushstring (L, "other");
- snprintf (&m, 24, "%0o", s.st_mode & 007777);
+ snprintf (m, 24, "%0o", s.st_mode & 007777);
lua_pushstring (L, m);
lua_pushnumber (L, s.st_uid);
lua_pushnumber (L, s.st_gid);
@@ -277,38 +277,38 @@ populate_systeminfo (lua_State * L)
lua_getfield (L, LUA_GLOBALSINDEX, "deets");
lua_newtable (L);
- i = gethostname ((char *) &buf, 63);
+ i = gethostname (buf, 63);
lua_pushstring (L, "hostname");
if (i)
lua_pushnil (L);
else
{
buf[63] = '\0';
- lua_pushstring (L, (const char *) &buf);
+ lua_pushstring (L, buf);
memset (&hints, 0, sizeof (struct addrinfo));
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_CANONNAME;
- if (getaddrinfo (&buf, NULL, &hints, &carne_de))
+ if (getaddrinfo (buf, NULL, &hints, &carne_de))
carne_de = NULL;
}
lua_rawset (L, -3);
lua_pushstring (L, "fqdn");
if (carne_de && carne_de->ai_canonname)
- lua_pushstring (L, (const char *) carne_de->ai_canonname);
+ lua_pushstring (L, carne_de->ai_canonname);
else
lua_pushnil (L);
lua_rawset (L, -3);
- i = getdomainname ((char *) &buf, 63);
+ i = getdomainname (buf, 63);
lua_pushstring (L, "nis_domainname");
if (i)
lua_pushnil (L);
else
{
buf[63] = '\0';
- lua_pushstring (L, (const char *) &buf);
+ lua_pushstring (L, buf);
}
lua_rawset (L, -3);
--
1.7.4.1
>From 84d0fe25287ae0aaa9a1b9ff19b2ce61afbb173e Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Fri, 26 Nov 2010 08:19:20 +0100
Subject: [PATCH 4/5] Switch to new libdpkg 1.16.0 API
---
luau.c | 23 +++++------------------
1 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/luau.c b/luau.c
index b086004..b384026 100644
--- a/luau.c
+++ b/luau.c
@@ -18,7 +18,6 @@
#include <stdio.h>
-#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
@@ -69,7 +68,7 @@ dpkg_status (lua_State * L)
lua_error (L);
}
- p = findpackage (lua_tostring (L, i));
+ p = pkg_db_find (lua_tostring (L, i));
switch (p->status)
{
case stat_notinstalled:
@@ -113,7 +112,7 @@ dpkg_pkglist (lua_State * L)
lua_newtable (L);
- for (iter = iterpkgstart (); (pkg = iterpkgnext (iter));)
+ for (iter = pkg_db_iter_new (); (pkg = pkg_db_iter_next (iter));)
{
lua_pushnumber (L, ++i);
lua_pushstring (L, pkg->name);
@@ -137,7 +136,7 @@ dpkg_conffilelist (lua_State * L)
lua_error (L);
}
- p = findpackage (lua_tostring (L, 1));
+ p = pkg_db_find (lua_tostring (L, 1));
if (!(c = p->installed.conffiles))
{
lua_pushnil (L);
@@ -359,8 +358,6 @@ main (int argc, char **argv)
int c;
int digit_optind = 0;
- jmp_buf ejbuf;
-
int status;
char *tempdir;
@@ -372,19 +369,9 @@ main (int argc, char **argv)
fprintf (stderr, "This is free software, and you are welcome to redistribute it\n");
fprintf (stderr, "under certain conditions.\n");
- do
- {
- if (setjmp (ejbuf))
- {
- error_unwind (ehflag_bombout);
- exit (2);
- }
- push_error_handler (&ejbuf, print_error_fatal, NULL);
- }
- while (0);
-
+ push_error_context ();
- modstatdb_init ("/var/lib/dpkg", msdbrw_readonly | msdbrw_noavail);
+ modstatdb_open (msdbrw_readonly); /* Use default dpkg db directory. */
while (1)
{
--
1.7.4.1
>From b755f1faa1376eb2ba5be4c233e11ff24fec2615 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Fri, 26 Nov 2010 08:19:48 +0100
Subject: [PATCH 5/5] Release dpkg resources when finished
---
luau.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/luau.c b/luau.c
index b384026..5e62f5d 100644
--- a/luau.c
+++ b/luau.c
@@ -118,6 +118,7 @@ dpkg_pkglist (lua_State * L)
lua_pushstring (L, pkg->name);
lua_rawset (L, -3);
}
+ pkg_db_iter_free (iter);
return 1;
}
@@ -485,5 +486,7 @@ main (int argc, char **argv)
lua_close (l);
+ pop_error_context (ehflag_normaltidy);
+
return 0;
}
--
1.7.4.1
--- End Message ---