Diff

Differences From Artifact [d5deebecbf]:

To Artifact [6085412bf1]:


216
217
218
219
220
221
222

223
224
225
226

227
228
229
230
231
232




233

234
235
236
237
238
239
240
241
242
243
244
245
216
217
218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
236
237

238
239

240
241

242
243
244
245
246
247
248







+



-
+






+
+
+
+
-
+

-


-







		package = $1;
		version = $2;
		os = $3;
		cpuArch = $4;
		hash = $5;
		isLatest = $6;

		latestKey = package "," os "," cpuArch;
		key = package "," version "," os "," cpuArch;

		if (isLatest == "1") {
			keys_latest[key] = hash;
			keys_latest[latestKey] = hash;
		}
		keys[key] = hash;
	}

	END{
		for (key in keys) {
			hash = keys[key];
			split(key, keyParts, /,/);
			latestKey = keyParts[1] "," keyParts[3] "," keyParts[4];

			if (keys_latest[key] != "") {
			if (keys_latest[latestKey] == hash) {
				isLatest = "1";
				hash = keys_latest[key];
			} else {
				isLatest = "0";
				hash = keys[key];
			}

			print key "," hash "," isLatest;
		}
	}  
' | sort -u > "${packagelistfile}.new"
cat "${packagelistfile}.new" > "${packagelistfile}"