Skip to content

Commit

Permalink
HPCC-32140 eclcc should expand embedded archives within an ECL archiv…
Browse files Browse the repository at this point in the history
…e file

Embedded archives will be unpacked into subdirectories based upon their original package values (typically git branch names) or, if package values are not found, an ascending numeric archive_NNNNNN name.
  • Loading branch information
dcamper committed Jun 25, 2024
1 parent f86122c commit c309fd1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ecl/hql/hqlcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,24 @@ extern HQL_API void expandArchive(const char * path, IPropertyTree * archive, bo
StringBuffer baseFilename;
makeAbsolutePath(path, baseFilename, false);
addPathSepChar(baseFilename);
unsigned int embeddedArchiveNum = 0;

// Look for embedded archives and recursively expand them
Owned<IPropertyTreeIterator> embeddedArchives = archive->getElements("Archive");
ForEach(*embeddedArchives)
{
// Append the package value to the path, if it exists
StringBuffer embeddedFilename(baseFilename);
if (embeddedArchives->query().hasProp("@package"))
{
embeddedFilename.append(embeddedArchives->query().queryProp("@package"));
}
else
{
embeddedFilename.appendf("archive_%0*d", 6, ++embeddedArchiveNum);
}
expandArchive(embeddedFilename, &embeddedArchives->query(), includePlugins);
}

Owned<IPropertyTreeIterator> modules = archive->getElements("Module");
ForEach(*modules)
Expand Down

0 comments on commit c309fd1

Please sign in to comment.