mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 05:57:28 +00:00
Even more garbage collection of dpkg.c and even some of dpkg-lib.c
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
11f40f1f17
commit
bdaf40775a
@ -5,10 +5,6 @@ extern "C" {
|
||||
|
||||
#include "dpkg.h"
|
||||
|
||||
int versioncmp(char *left, char *right) {
|
||||
return debVS.CmpVersion(left, right);
|
||||
}
|
||||
|
||||
int cmpversions(char *left, int op, char *right) {
|
||||
int i = debVS.CmpVersion(left, right);
|
||||
|
||||
|
41
lib/dpkg.c
41
lib/dpkg.c
@ -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 *r = NULL;
|
||||
packagelist **addto = &r;
|
||||
@ -727,33 +713,6 @@ packagelist *collpkglist2pkglist(collpackagelist *l) {
|
||||
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) {
|
||||
dpkg_collected_package *cpkg = lookup_packagetbl(pkgs->packages, pkgname);
|
||||
|
11
lib/dpkg.h
11
lib/dpkg.h
@ -66,16 +66,6 @@ struct dpkg_package {
|
||||
LIST(packagelist, 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
|
||||
* 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);
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user