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 strdate[16];
|
||||
|
||||
if (s->updrepository >= 0) {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkgup.png\" ",
|
||||
configtag->configdefaults->url_dir);
|
||||
} else {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkg.png\" ",
|
||||
configtag->configdefaults->url_dir);
|
||||
}
|
||||
|
||||
if (s->changelog) {
|
||||
simpleTimeToHuman(s->changelog->time, (humanDate *) & strdate);
|
||||
if (s->updrepository >= 0) {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkgup.png\" title=\"%s - %s (%s)\n%s\n\nUpdates package in %s\">",
|
||||
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 {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkg.png\" title=\"%s - %s (%s)\n%s\">",
|
||||
configtag->configdefaults->url_dir,
|
||||
strdate,
|
||||
s->changelog->pkg->name,
|
||||
s->changelog->release,
|
||||
htmlcleanNoBr(s->changelog->text,buffer,PATH_MAX));
|
||||
fprintf(fout,
|
||||
"title=\"%s - %s (%s)\n%s",
|
||||
strdate,
|
||||
s->changelog->pkg->name,
|
||||
s->changelog->release,
|
||||
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 {
|
||||
if (s->updrepository >= 0) {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkgup.png\" title=\"WARNING: missing changelog\n\nUpdates package in %s\">",
|
||||
configtag->configdefaults->url_dir,
|
||||
configtag->repository[s->updrepository]->tag);
|
||||
} else {
|
||||
fprintf(fout,
|
||||
"<img src=\"%s/pkg.png\" title=\"WARNING: missing changelog\">",
|
||||
configtag->configdefaults->url_dir);
|
||||
}
|
||||
fprintf(fout,
|
||||
"title=\"WARNING: missing changelog");
|
||||
}
|
||||
|
||||
if (s->updrepository >= 0) {
|
||||
fprintf(fout,
|
||||
"\n\nUpdates package in %s\">",
|
||||
configtag->repository[s->updrepository]->tag);
|
||||
} else {
|
||||
fprintf(fout, "\">");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user