diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmd/generate-index.sh | 35 | ||||
-rw-r--r-- | lib/cmd/include.sh | 5 |
2 files changed, 36 insertions, 4 deletions
diff --git a/lib/cmd/generate-index.sh b/lib/cmd/generate-index.sh index 88ef95b..1b9798d 100644 --- a/lib/cmd/generate-index.sh +++ b/lib/cmd/generate-index.sh @@ -23,5 +23,38 @@ use output cmd_generate_index_main() { - printf 'Not implemented\n' + local comp= + local dist= + local plat= + local arch= + local feed= + + if [ ${#} -eq 0 ]; then + for comp in "${archive}/dists/"*/; do + for dist in "${comp}/"*/; do + for plat in "${dist}/"*/; do + for arch in "${plat}/"*/; do + feed="${plat#${archive}/dists/}" + cmd_generate_index "${feed}" + done + done + done + done + else + for feed in "${@}"; do + cmd_generate_index "${feed}" + done + fi +} + +cmd_generate_index() +{ + local feed="${1}" + + info "$(get_msg 'cmd_generate_index_generating')" "${feed}" + + cat "${archive}/dists/${feed}.db/"*.control \ + >"${archive}/dists/${feed}/Packages~" + mv "${archive}/dists/${feed}/Packages~" \ + "${archive}/dists/${feed}/Packages" } diff --git a/lib/cmd/include.sh b/lib/cmd/include.sh index b84a4e7..33eb5e9 100644 --- a/lib/cmd/include.sh +++ b/lib/cmd/include.sh @@ -39,9 +39,8 @@ cmd_include_main() cmd_include "${changes}" done - for feed in "${cmd_include_feeds}"; do - # TODO: Remove ":" when cmd_generate_index is implemented. - : cmd_generate_index "${feed}" + for feed in ${cmd_include_feeds}; do + cmd_generate_index "${feed}" done } |