0
0
mirror of https://github.com/termux-pacman/glibc-packages.git synced 2024-11-24 02:26:21 +00:00
glibc-packages/scripts-cgct/utils/get_deleted_pkgs.sh
2024-06-27 15:30:43 +03:00

28 lines
621 B
Bash

#!/usr/bin/env bash
get_deleted_pkgs() {
if [ -d ${IMAGE_PATH_BUILD}/PKGBUILDs ]; then
local new_pkg_list=$(makepkg --packagelist)
(
cd ${IMAGE_PATH_BUILD}/PKGBUILDs
if [ -f $PKGNAME ]; then
mv $PKGNAME PKGBUILD
for i in $(makepkg --packagelist); do
local delete=true
local pkgpart=$(get_name ${i##*/})
for j in $new_pkg_list; do
if [ $pkgpart = $(get_name ${j##*/}) ]; then
local delete=false
break
fi
done
if $delete; then
echo "$pkgpart" >> ${IMAGE_PATH_BUILD}/${CGCT_FILE_DELETING}
fi
done
mv PKGBUILD $PKGNAME
fi
)
fi
}