Commit ee6a8b27 authored by Bernhard Link's avatar Bernhard Link

some prework for predelete action

parent 0808d642
2006-06-12 Bernhard R. Link <brlink@debian.org>
* some prework for predelete action
2006-06-01 Bernhard R. Link <brlink@debian.org> 2006-06-01 Bernhard R. Link <brlink@debian.org>
* better usage description in tiffany.example * better usage description in tiffany.example
* fix the fix for the export preprocessor * fix the fix for the export preprocessor
......
...@@ -505,6 +505,24 @@ retvalue upgradelist_enqueue(struct upgradelist *upgrade,struct downloadcache *c ...@@ -505,6 +505,24 @@ retvalue upgradelist_enqueue(struct upgradelist *upgrade,struct downloadcache *c
return result; return result;
} }
/* delete all packages that will not be kept (i.e. either deleted or upgraded) */
retvalue upgradelist_predelete(struct upgradelist *upgrade,struct downloadcache *cache,filesdb filesdb,int force) {
struct package_data *pkg;
retvalue result,r;
result = RET_NOTHING;
assert(upgrade != NULL);
for( pkg = upgrade->list ; pkg != NULL ; pkg = pkg->next ) {
if( !ignoredelete && pkg->version_in_use != NULL &
(pkg->version == pkg->new_version || pkg->deleted)) {
r = target_removepackage(upgrade->target,refs,pkg->name,dereferencedfilekeys,NULL);
RET_UPDATE(result,r);
if( RET_WAS_ERROR(r) && force <= 0 )
break;
}
}
return result;
}
retvalue upgradelist_install(struct upgradelist *upgrade,const char *dbdir,filesdb files,references refs,int force, bool_t ignoredelete, struct strlist *dereferencedfilekeys){ retvalue upgradelist_install(struct upgradelist *upgrade,const char *dbdir,filesdb files,references refs,int force, bool_t ignoredelete, struct strlist *dereferencedfilekeys){
struct package_data *pkg; struct package_data *pkg;
retvalue result,r; retvalue result,r;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment