Просмотр исходного кода

Move pkg-show module to libdpkg

Guillem Jover лет назад: 16
Родитель
Сommit
92838b1a97
7 измененных файлов с 39 добавлено и 7 удалено
  1. 2 0
      lib/dpkg/Makefile.am
  2. 2 3
      src/pkg-show.c
  3. 33 0
      lib/dpkg/pkg-show.h
  4. 0 2
      src/Makefile.am
  5. 1 0
      src/enquiry.c
  6. 0 2
      src/main.h
  7. 1 0
      src/query.c

+ 2 - 0
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 \

+ 2 - 3
src/pkg-show.c

@@ -3,6 +3,7 @@
  * pkg-show.c - primitives for pkg information display
  *
  * Copyright © 1995,1996 Ian Jackson <ian@chiark.greenend.org.uk>
+ * Copyright © 2008-2010 Guillem Jover <guillem@debian.org>
  *
  * 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)

+ 33 - 0
lib/dpkg/pkg-show.h

@@ -0,0 +1,33 @@
+/*
+ * dpkg - main program for package management
+ * pkg-show.h - primitives for pkg information display
+ *
+ * Copyright © 2010 Guillem Jover <guillem@debian.org>
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DPKG_PKG_SHOW_H
+#define DPKG_PKG_SHOW_H
+
+#include <dpkg/macros.h>
+#include <dpkg/dpkg-db.h>
+
+DPKG_BEGIN_DECLS
+
+void pkg_summary(struct pkginfo *pkg, const char **pdesc_ret, int *len_ret);
+
+DPKG_END_DECLS
+
+#endif /* DPKG_PKG_SHOW_H */

+ 0 - 2
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 = \

+ 1 - 0
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"

+ 0 - 2
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);

+ 1 - 0
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>