#!/bin/bash

# https://git.tuxcore.org/developer/tpkgs.git


# pkg_list=$(cat /home/wilssonmartee/Tuxiso-Iso-Out/tuxcore-2024-06-15-pkglist.txt | awk '{print $1}')


while IFS="" read -r p || [ -n "$p" ]
do
#   printf '%s\n' "$p"
pkg_name=$(echo $p |  awk '{print $1}')
# echo $pkg_name
pkg_base=$(cat /tmp/check-updates/tuxcore_repos/main/$pkg_name-*/desc | grep "%BASE%" -A1 | tail -1)

cp -r /home/wilssonmartee/GIT/packages/main/$pkg_base /home/wilssonmartee/GIT/tpkgs/main/
cp -r /home/wilssonmartee/GIT/packages/opt/$pkg_base /home/wilssonmartee/GIT/tpkgs/main/
done < /home/wilssonmartee/Tuxiso-Iso-Out/tuxcore-2024-06-15-pkglist.txt