• R/O
  • SSH
  • HTTPS

svardos: Commit


Commit MetaInfo

Revision314 (tree)
Time2021-04-02 23:06:49
Authormateuszviste

Log Message

simplified buildidx

Change Summary

Incremental Difference

--- buildidx/buildidx.c (revision 313)
+++ buildidx/buildidx.c (revision 314)
@@ -7,6 +7,7 @@
77 files. buildidx will generate the index file and save it into the package
88 repository.
99
10+ 13 feb 2021: 'title' LSM field is no longer looked after
1011 11 feb 2021: lsm headers are no longer checked, so it is compatible with the simpler lsm format used by SvarDOS
1112 13 jan 2021: removed the identification line, changed CRC32 to bsum, not creating the listing.txt file and stopped compressing index
1213 23 apr 2017: uncompressed index is no longer created, added CRC32 of zib (bin only) files, if present
@@ -100,7 +101,7 @@
100101 }
101102 }
102103
103-static int readlsm(const char *filename, char *version, char *title, char *description) {
104+static int readlsm(const char *filename, char *version, char *description) {
104105 char linebuff[1024];
105106 char *valuestr;
106107 int x;
@@ -108,7 +109,6 @@
108109 /* reset fields to be read to empty values */
109110 version[0] = 0;
110111 description[0] = 0;
111- title[0] = 0;
112112 /* open the file */
113113 fd = fopen(filename, "rb");
114114 if (fd == NULL) return(-1);
@@ -128,11 +128,9 @@
128128 trim(linebuff);
129129 trim(valuestr);
130130 if (strcasecmp(linebuff, "version") == 0) {
131- sprintf(version, "%s", valuestr);
132- } else if (strcasecmp(linebuff, "title") == 0) {
133- sprintf(title, "%s", valuestr);
134- } else if (strcasecmp(linebuff, "description") == 0) {
135- sprintf(description, "%s", valuestr);
131+ sprintf(version, "%s", valuestr);
132+ } else if (strcasecmp(linebuff, "description") == 0) {
133+ sprintf(description, "%s", valuestr);
136134 }
137135 }
138136 }
@@ -150,9 +148,9 @@
150148
151149
152150 static void GenIndexes(const char *repodir) {
153- char *LsmFileList[4096];
151+ char *LsmFileList[4096]; /* TODO dynamic sizing, otherwise will crash if there are 4096+ packages */
154152 char tmpbuf[64];
155- char *LsmFile, LSMpackage[64], LSMtitle[128], LSMversion[128], LSMdescription[1024];
153+ char *LsmFile, LSMpackage[64], LSMversion[128], LSMdescription[1024];
156154 int LsmCount = 0, x;
157155 FILE *idx;
158156 DIR *dir;
@@ -197,10 +195,9 @@
197195 printf("Processing %s... BSUM %04X\n", LsmFile, bsum);
198196
199197 sprintf(tmpbuf, "appinfo/%s", LsmFile);
200- readlsm(tmpbuf, LSMversion, LSMtitle, LSMdescription);
198+ readlsm(tmpbuf, LSMversion, LSMdescription);
201199
202200 if (strlen(LSMpackage) > 8) printf("Warning: %s.zip is not in 8.3 format!\n", LSMpackage);
203- if (LSMtitle[0] == 0) printf("Warning: no LSM title for %s.zip\n", LSMpackage);
204201 if (LSMversion[0] == 0) printf("Warning: no LSM version for %s.zip!\n", LSMpackage);
205202 if (LSMdescription[0] == 0) printf("Warning: no LSM description for %s.zip!\n", LSMpackage);
206203 fprintf(idx, "%s\t%s\t%s\t%u\n", LSMpackage, LSMversion, LSMdescription, bsum);
Show on old repository browser