浏览代码

libdpkg: Move versionsatisfied() into a new depcon module

Guillem Jover 15 年之前
父节点
当前提交
b31617401d
共有 4 个文件被更改,包括 37 次插入7 次删除
  1. 1 0
      lib/dpkg/Makefile.am
  2. 32 0
      lib/dpkg/depcon.c
  3. 4 1
      lib/dpkg/dpkg-db.h
  4. 0 6
      lib/dpkg/vercmp.c

+ 1 - 0
lib/dpkg/Makefile.am

@@ -33,6 +33,7 @@ libdpkg_a_SOURCES = \
 	dbdir.c \
 	dbmodify.c \
 	debug.c \
+	depcon.c \
 	dir.c \
 	dump.c \
 	ehandle.c \

+ 32 - 0
lib/dpkg/depcon.c

@@ -0,0 +1,32 @@
+/*
+ * libdpkg - Debian packaging suite library routines
+ * depcon.c - dependency and conflict checking
+ *
+ * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
+ *
+ * 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/>.
+ */
+
+#include <config.h>
+#include <compat.h>
+
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+
+bool
+versionsatisfied(struct pkgbin *it, struct deppossi *against)
+{
+	return versionsatisfied3(&it->version, &against->version,
+	                         against->verrel);
+}

+ 4 - 1
lib/dpkg/dpkg-db.h

@@ -344,7 +344,6 @@ void varbufdependency(struct varbuf *vb, struct dependency *dep);
 
 /*** from vercmp.c ***/
 
-bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
 bool versionsatisfied3(const struct versionrevision *it,
                        const struct versionrevision *ref,
                        enum depverrel verrel);
@@ -353,6 +352,10 @@ int versioncompare(const struct versionrevision *version,
 bool epochsdiffer(const struct versionrevision *a,
                   const struct versionrevision *b);
 
+/*** from depcon.c ***/
+
+bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
+
 /*** from nfmalloc.c ***/
 void *nfmalloc(size_t);
 char *nfstrsave(const char*);

+ 0 - 6
lib/dpkg/vercmp.c

@@ -109,9 +109,3 @@ versionsatisfied3(const struct versionrevision *it,
   }
   return false;
 }
-
-bool
-versionsatisfied(struct pkgbin *it, struct deppossi *against)
-{
-  return versionsatisfied3(&it->version,&against->version,against->verrel);
-}