Commit 3961e3a6 authored by Bernhard Link's avatar Bernhard Link

[refactor] remove description_prepareaddpackage

parent 0d1df41e
......@@ -632,7 +632,7 @@ static retvalue floodlist_install(struct floodlist *list, struct logger *logger,
logger, pkg->name, pkg->new_version,
pkg->new_control, &pkg->new_filekeys,
false, td, architecture_all,
NULL, NULL, NULL);
NULL, NULL);
RET_UPDATE(result, r);
if (RET_WAS_ERROR(r))
break;
......
......@@ -675,7 +675,7 @@ retvalue binaries_adddeb(const struct deb_headers *deb, const struct atomlist *f
false,
trackingdata,
deb->architecture,
NULL, NULL, NULL);
NULL, NULL);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r, r2);
}
......@@ -717,7 +717,7 @@ retvalue binaries_adddeb(const struct deb_headers *deb, const struct atomlist *f
false,
trackingdata,
deb->architecture,
NULL, NULL, NULL);
NULL, NULL);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r, r2);
}
......
......@@ -147,7 +147,7 @@ retvalue dsc_addprepared(const struct dsc_headers *dsc, component_t component, c
dsc->control, filekeys,
false, trackingdata,
architecture_source,
NULL, NULL, NULL);
NULL, NULL);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r, r2);
}
......
......@@ -274,7 +274,7 @@ static retvalue package_add(struct distribution *into, /*@null@*/trackingdb trac
(tracks != NULL)?
&trackingdata:NULL,
package->architecture,
NULL, suitefrom, NULL);
NULL, suitefrom);
RET_UPDATE(into->status, r);
if (tracks != NULL) {
retvalue r2;
......
......@@ -99,7 +99,7 @@ static void description_genmd5(const char *description, /*@out@*/ char *d, size_
* the cached description is not yet used, long descriptions are not stored elsewhere
* and thus also no reference counting is done. */
retvalue description_addpackage(struct target *target, const char *package, const char *control, const char *oldcontrol, struct description *cached, char **control_p) {
retvalue description_addpackage(struct target *target, const char *package, const char *control, char **control_p) {
char *description, *description_md5, *deb_description, *newcontrol;
struct fieldtoadd *todo;
size_t dlen;
......@@ -200,8 +200,3 @@ retvalue description_addpackage(struct target *target, const char *package, cons
*control_p = newcontrol;
return RET_OK;
}
retvalue description_preparepackage(UNUSED(struct target *target), UNUSED(const char *package), UNUSED(const char *control), UNUSED(struct description **description_p)) {
/* everything yet done in description_addpackage */
return RET_NOTHING;
}
#ifndef REPREPRO_DESCRIPTIONS_H
#define REPREPRO_DESCRIPTIONS_H
struct description;
retvalue description_preparepackage(struct target*, const char */*package*/, const char */*control*/, /*@out@*/struct description**);
/* Do what is needed description/translation wise for a new package added.
* control is the control chunk of the new package to be normalized
* (depending on the target, towards containing full Description or checksumed),
* oldcontrol is a old version of a package replaced or NULL
* (for repairdescriptions oldcontrol==control).
* newcontrol_p gets the new normalized control chunk.
* description is the data returned by a description_prepareaddpackage or NULL
* if that was not yet called
*/
retvalue description_addpackage(struct target*, const char */*package*/, const char */*control*/,/*@null@*/const char */*oldcontrol*/, /*@null@*/struct description*, /*@out@*/char **/*newcontrol_p*/);
retvalue description_addpackage(struct target*, const char */*package*/, const char */*control*/, /*@out@*/char **/*newcontrol_p*/);
#endif
......@@ -1788,7 +1788,7 @@ static retvalue add_dsc(struct distribution *into, struct trackingdata *tracking
&p->filekeys,
false, trackingdata,
architecture_source,
NULL, NULL, NULL);
NULL, NULL);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r, r2);
}
......
......@@ -2545,7 +2545,6 @@ static retvalue repair_descriptions(struct target *target) {
/* replace it by itself to normalize the Description field */
r = description_addpackage(target, iterator.current.name,
iterator.current.control,
iterator.current.control, NULL,
&newcontrolchunk);
RET_UPDATE(result, r);
if (RET_WAS_ERROR(r))
......
......@@ -403,7 +403,7 @@ static retvalue addpackages(struct target *target, const char *packagename, cons
return result;
}
retvalue target_addpackage(struct target *target, struct logger *logger, const char *name, const char *version, const char *control, const struct strlist *filekeys, bool downgrade, struct trackingdata *trackingdata, architecture_t architecture, const char *causingrule, const char *suitefrom, struct description *description) {
retvalue target_addpackage(struct target *target, struct logger *logger, const char *name, const char *version, const char *control, const struct strlist *filekeys, bool downgrade, struct trackingdata *trackingdata, architecture_t architecture, const char *causingrule, const char *suitefrom) {
struct strlist oldfilekeys, *ofk;
char *newcontrol;
struct package old;
......@@ -490,8 +490,7 @@ retvalue target_addpackage(struct target *target, struct logger *logger, const c
}
newcontrol = NULL;
r = description_addpackage(target, name, control, old.control,
description, &newcontrol);
r = description_addpackage(target, name, control, &newcontrol);
if (RET_IS_OK(r))
control = newcontrol;
if (!RET_WAS_ERROR(r))
......
......@@ -91,7 +91,7 @@ retvalue target_closepackagesdb(struct target *);
/* The following calls can only be called if target_initpackagesdb was called before: */
struct logger;
struct description;
retvalue target_addpackage(struct target *, /*@null@*/struct logger *, const char *name, const char *version, const char *control, const struct strlist *filekeys, bool downgrade, /*@null@*/struct trackingdata *, architecture_t, /*@null@*/const char *causingrule, /*@null@*/const char *suitefrom, /*@null@*/struct description *);
retvalue target_addpackage(struct target *, /*@null@*/struct logger *, const char *name, const char *version, const char *control, const struct strlist *filekeys, bool downgrade, /*@null@*/struct trackingdata *, architecture_t, /*@null@*/const char *causingrule, /*@null@*/const char *suitefrom);
retvalue target_checkaddpackage(struct target *, const char *name, const char *version, bool tracking, bool permitnewerold);
retvalue target_removepackage(struct target *, /*@null@*/struct logger *, const char *name, struct trackingdata *);
/* like target_removepackage, but do not read control data yourself but use available */
......
......@@ -60,8 +60,6 @@ struct package_data {
/* the list of files that will belong to this:
* same validity */
struct strlist new_filekeys;
/* cache/info what description is needed for this */
struct description *description;
struct checksumsarray new_origfiles;
/* to destinguish arch all from not arch all */
architecture_t architecture;
......@@ -703,8 +701,7 @@ retvalue upgradelist_install(struct upgradelist *upgrade, struct logger *logger,
pkg->new_control,
&pkg->new_filekeys, true,
NULL, pkg->architecture,
causingrule, suitefrom,
pkg->description);
causingrule, suitefrom);
}
RET_UPDATE(result, r);
if (RET_WAS_ERROR(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