depot_query: sort depot-user scan results

Related to issue #4054
This commit is contained in:
Norman Feske 2021-03-20 18:31:01 +01:00
parent ca5522d4d9
commit b29f1497bf
3 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,9 @@ SRC_DIR := src/app/depot_query
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
MIRROR_FROM_REP_DIR := include/depot include/gems/lru_cache.h
MIRROR_FROM_REP_DIR := include/depot include/gems/lru_cache.h \
src/app/fs_query/for_each_subdir_name.h \
src/app/fs_query/sorted_for_each.h
content: $(MIRROR_FROM_REP_DIR)

View File

@ -20,6 +20,9 @@
#include <depot/archive.h>
#include <gems/lru_cache.h>
/* fs_query includes */
#include <for_each_subdir_name.h>
namespace Depot_query {
using namespace Depot;
@ -472,9 +475,9 @@ struct Depot_query::Main : private Rom_query
_gen_versioned_report(_scan_reporter, version, [&] (Xml_generator &xml) {
query.for_each_sub_node("scan", [&] (Xml_node node) {
if (node.attribute_value("users", false)) {
_depot_dir.for_each_entry([&] (Directory::Entry const &entry) {
for_each_subdir_name(_heap, _depot_dir, [&] (auto name) {
xml.node("user", [&] () {
xml.attribute("name", entry.name()); }); }); } }); });
xml.attribute("name", name); }); }); } }); });
_gen_versioned_report(_blueprint_reporter, version, [&] (Xml_generator &xml) {
query.for_each_sub_node("blueprint", [&] (Xml_node node) {

View File

@ -1,3 +1,4 @@
TARGET = depot_query
SRC_CC = main.cc
LIBS += base vfs
TARGET := depot_query
SRC_CC := main.cc
LIBS += base vfs
INC_DIR += $(REP_DIR)/src/app/fs_query