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