Revision | 314 (tree) |
---|---|
Time | 2021-04-02 23:06:49 |
Author | ![]() |
simplified buildidx
@@ -7,6 +7,7 @@ | ||
7 | 7 | files. buildidx will generate the index file and save it into the package |
8 | 8 | repository. |
9 | 9 | |
10 | + 13 feb 2021: 'title' LSM field is no longer looked after | |
10 | 11 | 11 feb 2021: lsm headers are no longer checked, so it is compatible with the simpler lsm format used by SvarDOS |
11 | 12 | 13 jan 2021: removed the identification line, changed CRC32 to bsum, not creating the listing.txt file and stopped compressing index |
12 | 13 | 23 apr 2017: uncompressed index is no longer created, added CRC32 of zib (bin only) files, if present |
@@ -100,7 +101,7 @@ | ||
100 | 101 | } |
101 | 102 | } |
102 | 103 | |
103 | -static int readlsm(const char *filename, char *version, char *title, char *description) { | |
104 | +static int readlsm(const char *filename, char *version, char *description) { | |
104 | 105 | char linebuff[1024]; |
105 | 106 | char *valuestr; |
106 | 107 | int x; |
@@ -108,7 +109,6 @@ | ||
108 | 109 | /* reset fields to be read to empty values */ |
109 | 110 | version[0] = 0; |
110 | 111 | description[0] = 0; |
111 | - title[0] = 0; | |
112 | 112 | /* open the file */ |
113 | 113 | fd = fopen(filename, "rb"); |
114 | 114 | if (fd == NULL) return(-1); |
@@ -128,11 +128,9 @@ | ||
128 | 128 | trim(linebuff); |
129 | 129 | trim(valuestr); |
130 | 130 | 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); | |
136 | 134 | } |
137 | 135 | } |
138 | 136 | } |
@@ -150,9 +148,9 @@ | ||
150 | 148 | |
151 | 149 | |
152 | 150 | 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 */ | |
154 | 152 | char tmpbuf[64]; |
155 | - char *LsmFile, LSMpackage[64], LSMtitle[128], LSMversion[128], LSMdescription[1024]; | |
153 | + char *LsmFile, LSMpackage[64], LSMversion[128], LSMdescription[1024]; | |
156 | 154 | int LsmCount = 0, x; |
157 | 155 | FILE *idx; |
158 | 156 | DIR *dir; |
@@ -197,10 +195,9 @@ | ||
197 | 195 | printf("Processing %s... BSUM %04X\n", LsmFile, bsum); |
198 | 196 | |
199 | 197 | sprintf(tmpbuf, "appinfo/%s", LsmFile); |
200 | - readlsm(tmpbuf, LSMversion, LSMtitle, LSMdescription); | |
198 | + readlsm(tmpbuf, LSMversion, LSMdescription); | |
201 | 199 | |
202 | 200 | 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); | |
204 | 201 | if (LSMversion[0] == 0) printf("Warning: no LSM version for %s.zip!\n", LSMpackage); |
205 | 202 | if (LSMdescription[0] == 0) printf("Warning: no LSM description for %s.zip!\n", LSMpackage); |
206 | 203 | fprintf(idx, "%s\t%s\t%s\t%u\n", LSMpackage, LSMversion, LSMdescription, bsum); |