mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
depot_download: support downloading index files
With this commit, the 'installation' input of the depot-download subsystem accepts <index> nodes in addition to <archive> nodes. Each index node refers to one index file specified via the 'path' attribute. This commit also improves the tracking of failure states. Once an installation job failed (due to a download of verification error), it won't get re-scheduled. In the past, such failure states were not kept across subsequent import iterations, which could result in infinite re-attempts when an installation contained archives from multiple users. The the progress of the download process is now reflected by the "progress" attribute on the download manager's state report, which allows the final report to contain the list of installed/failed archives along with the overall progress/completed state. The detection of the latter is important for the sculpt manager for reattempting the deployment of the completed packages. The patch enhances the depot_download.run script to stress the new abilities. In particular, the scenario downloads a mix of index files (one present, one missing) and archives, from two different depot users (genodelabs and nfeske). Issue #3172
This commit is contained in:
committed by
Christian Helmuth
parent
1b518965cc
commit
ac68073ffc
@@ -88,8 +88,30 @@ struct Depot::Archive
|
||||
throw Unknown_archive_type();
|
||||
}
|
||||
|
||||
static Name name (Path const &path) { return _path_element<Name>(path, 2); }
|
||||
static Version version(Path const &path) { return _path_element<Name>(path, 3); }
|
||||
/**
|
||||
* Return true if 'path' refers to an index file
|
||||
*/
|
||||
static bool index(Path const &path)
|
||||
{
|
||||
return _path_element<Name>(path, 1) == "index";
|
||||
}
|
||||
|
||||
static Name name (Path const &path) { return _path_element<Name>(path, 2); }
|
||||
static Version version (Path const &path) { return _path_element<Version>(path, 3); }
|
||||
static Version index_version(Path const &path) { return _path_element<Version>(path, 2); }
|
||||
|
||||
/**
|
||||
* Return name of compressed file to download for the given depot path
|
||||
*
|
||||
* Archives are shipped as tar.xz files whereas index files are shipped
|
||||
* as xz-compressed files.
|
||||
*/
|
||||
static Archive::Path download_file_path(Archive::Path path)
|
||||
{
|
||||
return Archive::index(path) ? Archive::Path(path, ".xz")
|
||||
: Archive::Path(path, ".tar.xz");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__DEPOT__ARCHIVE_H_ */
|
||||
|
||||
Reference in New Issue
Block a user