The following commit has been merged in the master branch:
commit 92838b1a97e20b70c3a450578d2b4271143fd561
Author: Guillem Jover <[email protected]>
Date:   Fri Jul 16 14:19:15 2010 +0200

    Move pkg-show module to libdpkg

diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am
index d41c104..7d4b26a 100644
--- a/lib/dpkg/Makefile.am
+++ b/lib/dpkg/Makefile.am
@@ -49,6 +49,7 @@ libdpkg_a_SOURCES = \
        pkg-format.c \
        pkg-list.c \
        pkg-queue.c \
+       pkg-show.c \
        progress.c \
        string.c \
        subproc.c \
@@ -78,6 +79,7 @@ pkginclude_HEADERS = \
        pkg-format.h \
        pkg-list.h \
        pkg-queue.h \
+       pkg-show.h \
        progress.h \
        string.h \
        subproc.h \
diff --git a/src/pkg-show.c b/lib/dpkg/pkg-show.c
similarity index 93%
rename from src/pkg-show.c
rename to lib/dpkg/pkg-show.c
index 853278e..d36d9bf 100644
--- a/src/pkg-show.c
+++ b/lib/dpkg/pkg-show.c
@@ -3,6 +3,7 @@
  * pkg-show.c - primitives for pkg information display
  *
  * Copyright © 1995,1996 Ian Jackson <[email protected]>
+ * Copyright © 2008-2010 Guillem Jover <[email protected]>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,10 +26,8 @@
 
 #include <dpkg/macros.h>
 #include <dpkg/i18n.h>
-#include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
-
-#include "main.h"
+#include <dpkg/pkg-show.h>
 
 void
 pkg_summary(struct pkginfo *pkg, const char **pdesc_r, int *len_ret)
diff --git a/lib/dpkg/pkg.h b/lib/dpkg/pkg-show.h
similarity index 72%
copy from lib/dpkg/pkg.h
copy to lib/dpkg/pkg-show.h
index 9195134..120df80 100644
--- a/lib/dpkg/pkg.h
+++ b/lib/dpkg/pkg-show.h
@@ -1,8 +1,8 @@
 /*
  * dpkg - main program for package management
- * pkg.h - primitives for pkg handling
+ * pkg-show.h - primitives for pkg information display
  *
- * Copyright © 2009 Guillem Jover <[email protected]>
+ * Copyright © 2010 Guillem Jover <[email protected]>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,17 +18,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBDPKG_PKG_H
-#define LIBDPKG_PKG_H
+#ifndef DPKG_PKG_SHOW_H
+#define DPKG_PKG_SHOW_H
 
 #include <dpkg/macros.h>
+#include <dpkg/dpkg-db.h>
 
 DPKG_BEGIN_DECLS
 
-typedef int pkg_sorter_func(const void *a, const void *b);
-
-int pkg_sorter_by_name(const void *a, const void *b);
+void pkg_summary(struct pkginfo *pkg, const char **pdesc_ret, int *len_ret);
 
 DPKG_END_DECLS
 
-#endif /* LIBDPKG_PKG_H */
+#endif /* DPKG_PKG_SHOW_H */
diff --git a/src/Makefile.am b/src/Makefile.am
index 7c6b054..d1e432f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,7 +33,6 @@ dpkg_SOURCES = \
        help.c \
        main.c main.h \
        packages.c \
-       pkg-show.c \
        processarc.c \
        remove.c \
        select.c \
@@ -60,7 +59,6 @@ dpkg_divert_LDADD = \
 dpkg_query_SOURCES = \
        filesdb.c filesdb.h \
        divertdb.c \
-       pkg-show.c \
        query.c
 
 dpkg_query_LDADD = \
diff --git a/src/enquiry.c b/src/enquiry.c
index 69e702d..a30b3eb 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -38,6 +38,7 @@
 #include <dpkg/i18n.h>
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
+#include <dpkg/pkg-show.h>
 #include <dpkg/myopt.h>
 
 #include "filesdb.h"
diff --git a/src/main.h b/src/main.h
index b17810b..6337191 100644
--- a/src/main.h
+++ b/src/main.h
@@ -171,8 +171,6 @@ void printarch(const char *const *argv);
 void printinstarch(const char *const *argv);
 void cmpversions(const char *const *argv) DPKG_ATTR_NORET;
 
-void pkg_summary(struct pkginfo *pkg, const char **pdesc_ret, int *len_ret);
-
 /* from select.c */
 
 void getselections(const char *const *argv);
diff --git a/src/query.c b/src/query.c
index 9783847..2ccdf1e 100644
--- a/src/query.c
+++ b/src/query.c
@@ -44,6 +44,7 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/pkg-array.h>
 #include <dpkg/pkg-format.h>
+#include <dpkg/pkg-show.h>
 #include <dpkg/path.h>
 #include <dpkg/myopt.h>
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to