Even more garbage collection of dpkg.c and even some of dpkg-lib.c

Signed-off-by: Niels Thykier <niels@thykier.net>
master
Niels Thykier 13 years ago
parent 8bf3c3d606
commit c9160d4ac3

@ -5,10 +5,6 @@ extern "C" {
#include "dpkg.h" #include "dpkg.h"
int versioncmp(char *left, char *right) {
return debVS.CmpVersion(left, right);
}
int cmpversions(char *left, int op, char *right) { int cmpversions(char *left, int op, char *right) {
int i = debVS.CmpVersion(left, right); int i = debVS.CmpVersion(left, right);

@ -701,20 +701,6 @@ static void uninstall(dpkg_packages *pkgs, dpkg_collected_package *cpkg) {
} }
} }
satisfieddep *new_satisfieddep(void) {
satisfieddep *sd = block_malloc(sizeof(satisfieddep));
if (!sd) die("new_satisfieddep alloc:");
return sd;
}
void free_satisfieddep(satisfieddep *sd) {
if (!sd) return;
free_packagelist(sd->pkgs);
block_free(sd, sizeof(satisfieddep));
}
LIST_IMPL(satisfieddeplist, satisfieddep *, free_satisfieddep, block_malloc, block_free);
packagelist *collpkglist2pkglist(collpackagelist *l) { packagelist *collpkglist2pkglist(collpackagelist *l) {
packagelist *r = NULL; packagelist *r = NULL;
packagelist **addto = &r; packagelist **addto = &r;
@ -727,33 +713,6 @@ packagelist *collpkglist2pkglist(collpackagelist *l) {
return r; return r;
} }
satisfieddeplist *checkunsatisfiabledeps(dpkg_packages *pkgs,
deplistlist *deps) {
satisfieddeplist *unsatisfiable = NULL;
satisfieddeplist **addto = &unsatisfiable;
satisfieddep *sd;
collpackagelist *deppkgs;
for (; deps != NULL; deps = deps->next) {
/* deplist *dep; */
/* for (dep = deps->value; dep != NULL; dep = dep->next) { */
sd = new_satisfieddep();
/* sd->dep = dep->value; */
sd->depl = deps->value;
deppkgs = NULL;
/* get_matching_low(&deppkgs, pkgs, dep->value); */
deppkgs = get_matching(pkgs, deps->value, __LINE__);
sd->pkgs = collpkglist2pkglist(deppkgs);
free_collpackagelist(deppkgs);
insert_satisfieddeplist(addto, sd);
addto = &(*addto)->next;
/* } */
}
return unsatisfiable;
}
int checkinstallable2(dpkg_packages *pkgs, char *pkgname) { int checkinstallable2(dpkg_packages *pkgs, char *pkgname) {
dpkg_collected_package *cpkg = lookup_packagetbl(pkgs->packages, pkgname); dpkg_collected_package *cpkg = lookup_packagetbl(pkgs->packages, pkgname);

@ -66,16 +66,6 @@ struct dpkg_package {
LIST(packagelist, dpkg_package *); LIST(packagelist, dpkg_package *);
LIST(ownedpackagelist, dpkg_package *); LIST(ownedpackagelist, dpkg_package *);
typedef struct satisfieddep satisfieddep;
struct satisfieddep {
/* dependency *dep; */
deplist *depl;
packagelist *pkgs;
};
LIST(satisfieddeplist, satisfieddep *);
/************************************************************************** /**************************************************************************
* Coping with a source package (and collections thereof) as an abstract * Coping with a source package (and collections thereof) as an abstract
* entity, owning a bunch of binary packages * entity, owning a bunch of binary packages
@ -128,7 +118,6 @@ struct dpkg_packages {
}; };
int versioncmp(char *left, char *right);
int cmpversions(char *left, int op, char *right); int cmpversions(char *left, int op, char *right);

Loading…
Cancel
Save