tarch-bin/update_repo.sh
2024-02-26 14:14:38 +03:00

34 lines
851 B
Bash
Executable File

#!/bin/bash
source "$HOME/bin/scripts/system/style"
cd x86_64
echo -e ""
echo -e "${BOLD}${GREEN}############# обновление пакета #############${RESET_COLOR}"
declare -a OLD_DATABASE=(
"tarch-bin.db"
"tarch-bin.files"
)
echo -e "${CYAN}\n[*] удаляем старую БД...\n${RESET_COLOR}"
for i in ${OLD_DATABASE[@]}; do
rm $i
done
sleep 0.5
echo -e "${CYAN}\n[+] обновляем базу pacman ...\n${RESET_COLOR}"
repo-add tarch-bin.db.tar.gz *.pkg.tar.zst
sleep 0.5
# remove syslink to avoid any issues #
echo -e "${CYAN}\n[+] удаляем симлинки и заменяем на файлы ...\n${RESET_COLOR}"
rm tarch-bin.db
rm tarch-bin.files
mv tarch-bin.db.tar.gz tarch-bin.db
mv tarch-bin.files.tar.gz tarch-bin.files
sleep 0.5
echo -e "\n${BOLD}${GREEN}[✔] обновление успешно... "