Fixed 'deep' repository data creation not using the updated database format

This commit is contained in:
EnumDev 2024-09-14 14:24:37 +00:00
parent e4a9622ff2
commit c2de62c343

View File

@ -37,9 +37,14 @@ fi
shopt -s nullglob
if ! $DEEP; then
for arch in "$REPO"/*/; do
for pkg in "$arch"/*.bpm; do
create_entry() {
if [ $# -eq 0 ]; then
return 0
fi
if ! [ -f "$1" ]; then
return 0
fi
info="info:"$'\n'
info+=$(tar -xf "$pkg" pkg.info -O | sed 's/^/ /g')
package=$(echo "$info" | grep 'name: ' | xargs | awk '{print $2}')
@ -52,21 +57,18 @@ if ! $DEEP; then
info+=$'\n'"download: ${file}"
info+=$'\n---'
echo "$info"
}
if ! $DEEP; then
for arch in "$REPO"/*/; do
for pkg in "$arch"/*.bpm; do
create_entry "$pkg"
done
done
else
for arch in "$REPO"/*/; do
for pkg in "$arch"/**/*.bpm; do
info=$(tar -xf "$pkg" pkg.info -O)
package=$(echo "$info" | grep 'name: ' | awk '{print $2}')
if [[ ${PKGS[@]} =~ "$package" ]]; then
echo "The following package was found in more than 1 package archives: ${package}"
fi
PKGS+=("$package")
file="$(realpath -s --relative-to="$REPO" "$pkg")"
info+=$'\n'"file: ${file}"
info+=$'\n---'
echo "$info"
create_entry "$pkg"
done
done
fi