printpkgicon: print the last two changelog entries and rework function to optimize code
This commit is contained in:
parent
222691ea78
commit
4d081e2ee6
@ -152,37 +152,44 @@ void printpkgicon(FILE *fout, struct configTag *configtag, struct headerSourceLi
|
|||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
char strdate[16];
|
char strdate[16];
|
||||||
|
|
||||||
if (s->changelog) {
|
|
||||||
simpleTimeToHuman(s->changelog->time, (humanDate *) & strdate);
|
|
||||||
if (s->updrepository >= 0) {
|
if (s->updrepository >= 0) {
|
||||||
fprintf(fout,
|
fprintf(fout,
|
||||||
"<img src=\"%s/pkgup.png\" title=\"%s - %s (%s)\n%s\n\nUpdates package in %s\">",
|
"<img src=\"%s/pkgup.png\" ",
|
||||||
configtag->configdefaults->url_dir,
|
configtag->configdefaults->url_dir);
|
||||||
strdate,
|
|
||||||
s->changelog->pkg->name,
|
|
||||||
s->changelog->release,
|
|
||||||
htmlcleanNoBr(s->changelog->text,buffer,PATH_MAX),
|
|
||||||
configtag->repository[s->updrepository]->tag);
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(fout,
|
fprintf(fout,
|
||||||
"<img src=\"%s/pkg.png\" title=\"%s - %s (%s)\n%s\">",
|
"<img src=\"%s/pkg.png\" ",
|
||||||
configtag->configdefaults->url_dir,
|
configtag->configdefaults->url_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->changelog) {
|
||||||
|
simpleTimeToHuman(s->changelog->time, (humanDate *) & strdate);
|
||||||
|
fprintf(fout,
|
||||||
|
"title=\"%s - %s (%s)\n%s",
|
||||||
strdate,
|
strdate,
|
||||||
s->changelog->pkg->name,
|
s->changelog->pkg->name,
|
||||||
s->changelog->release,
|
s->changelog->release,
|
||||||
htmlcleanNoBr(s->changelog->text,buffer,PATH_MAX));
|
htmlcleanNoBr(s->changelog->text,buffer,PATH_MAX));
|
||||||
|
if (s->changelog->next) {
|
||||||
|
simpleTimeToHuman(s->changelog->next->time, (humanDate *) & strdate);
|
||||||
|
fprintf(fout,
|
||||||
|
"\n%s - %s (%s)\n%s",
|
||||||
|
strdate,
|
||||||
|
s->changelog->next->pkg->name,
|
||||||
|
s->changelog->next->release,
|
||||||
|
htmlcleanNoBr(s->changelog->next->text,buffer,PATH_MAX));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
fprintf(fout,
|
||||||
|
"title=\"WARNING: missing changelog");
|
||||||
|
}
|
||||||
|
|
||||||
if (s->updrepository >= 0) {
|
if (s->updrepository >= 0) {
|
||||||
fprintf(fout,
|
fprintf(fout,
|
||||||
"<img src=\"%s/pkgup.png\" title=\"WARNING: missing changelog\n\nUpdates package in %s\">",
|
"\n\nUpdates package in %s\">",
|
||||||
configtag->configdefaults->url_dir,
|
|
||||||
configtag->repository[s->updrepository]->tag);
|
configtag->repository[s->updrepository]->tag);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fout,
|
fprintf(fout, "\">");
|
||||||
"<img src=\"%s/pkg.png\" title=\"WARNING: missing changelog\">",
|
|
||||||
configtag->configdefaults->url_dir);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user