Update debtap

This commit is contained in:
Federico Francescon 2025-05-02 15:15:58 +02:00 committed by GitHub
parent 27a9ff5863
commit 38453ac535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

51
debtap
View File

@ -3440,39 +3440,26 @@ echo -e "\n}" >> PKGBUILD
# Moving PKGBUILD (and .INSTALL, if it exists) and announcing its creation # Moving PKGBUILD (and .INSTALL, if it exists) and announcing its creation
pkgname="$(grep '^pkgname=' PKGBUILD | sed s'/^pkgname=//')" pkgname="$(grep '^pkgname=' PKGBUILD | sed s'/^pkgname=//')"
if [[ $output == set ]]; then if [[ $output == set ]]; then
pkgbuild_location="$(dirname "$outputdirectory/$pkgname-PKGBUILD")" pkgbuild_location="$outputdirectory"
rm -rf "$pkgbuild_location" 2> /dev/null
mkdir "$pkgbuild_location" 2> /dev/null
if [[ $? != 0 ]]; then
echo -e "${red}Error: Cannot create PKGBUILD directory to output directory, permission denied. Removing leftover files and exiting...${NC}"
rm -rf "$working_directory"
rm -rf /tmp/debtap
exit 1
fi
mv PKGBUILD "$pkgbuild_location"
if [[ -e .INSTALL ]]; then
mv .INSTALL "$pkgbuild_location/$pkgname.install"
echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD and "$pkgname.install" are now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}"
else
echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD is now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}"
fi
else else
pkgbuild_location="$(dirname ""$(dirname "$package_with_full_path")"/$pkgname-PKGBUILD")" pkgbuild_location= "$(dirname "$package_with_full_path")"
rm -rf "$pkgbuild_location" 2> /dev/null fi
mkdir "$pkgbuild_location" 2> /dev/null pkgbuild_location="$pkgbuild_location/$pkgname-PKGBUILD"
if [[ $? != 0 ]]; then rm -rf "$pkgbuild_location" 2> /dev/null
echo -e "${red}Error: Cannot create PKGBUILD directory to the same directory as .deb package, permission denied. Removing leftover files and exiting...${NC}" mkdir "$pkgbuild_location" 2> /dev/null
rm -rf "$working_directory" echo "pkgbuild_location = $pkgbuild_location"
rm -rf /tmp/debtap if [[ $? != 0 ]]; then
exit 1 echo -e "${red}Error: Cannot create PKGBUILD directory to the same directory as .deb package, permission denied. Removing leftover files and exiting...${NC}"
fi rm -rf "$working_directory"
mv PKGBUILD "$pkgbuild_location" rm -rf /tmp/debtap
if [[ -e .INSTALL ]]; then exit 1
mv .INSTALL "$pkgbuild_location/$pkgname.install" fi
echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD and "$pkgname.install" are now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}" mv PKGBUILD "$pkgbuild_location/PKGBUILD"
else if [[ -e .INSTALL ]]; then
echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD is now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}" mv .INSTALL "$pkgbuild_location/$pkgname.install"
fi echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD and "$pkgname.install" are now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}"
else
echo -e "${lightgreen}==>${NC} ${bold}PKGBUILD is now located in${normal} ${lightblue}\"$pkgbuild_location\"${NC} ${bold}and ready to be edited${normal}"
fi fi
# Removing leftover files # Removing leftover files