Skip to content

Commit

Permalink
freebsd backend: Start from meta.conf when gathering repository metad…
Browse files Browse the repository at this point in the history
…ata.
  • Loading branch information
arrowd authored and ximion committed Jan 30, 2024
1 parent aa355cd commit b8d5e9f
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions src/asgen/backends/freebsd/fbsdpkgindex.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,40 @@ public:
private Package[] loadPackages (string suite, string section, string arch)
{
auto pkgRoot = buildPath (rootDir, suite);
auto listsTarFname = buildPath (pkgRoot, "packagesite.pkg");
auto metaFname = buildPath (pkgRoot, "meta.conf");
string manifestFname, manifestArchive;

if (!std.file.exists (metaFname)) {
logError ("Metadata file '%s' does not exist.", metaFname);
return [];
}

foreach(line; std.file.slurp!(string)(metaFname, "%s")) {
if (line.startsWith("manifests_archive")) {
// manifests_archive = "packagesite";
auto splitResult = line.split("\"");
if (splitResult.length == 3)
manifestArchive = splitResult[1];
}
else if (line.startsWith("manifests")) {
// manifests = "packagesite.yaml";
auto splitResult = line.split("\"");
if (splitResult.length == 3)
manifestFname = splitResult[1];
}
}

auto listsTarFname = buildPath (pkgRoot, manifestArchive ~ ".pkg");
if (!std.file.exists (listsTarFname)) {
logWarning ("Package lists file '%s' does not exist.", listsTarFname);
logError ("Package lists file '%s' does not exist.", listsTarFname);
return [];
}

ArchiveDecompressor ad;
ad.open (listsTarFname);
logDebug ("Opened: %s", listsTarFname);

auto d = ad.readData("packagesite.yaml");
auto d = ad.readData(manifestFname);
auto pkgs = appender!(Package[]);

foreach(entry; d.split('\n')) {
Expand Down

0 comments on commit b8d5e9f

Please sign in to comment.