src/new-ebuild: only create ebuilds if they don't exist

Signed-off-by: Maciej Barć <xgqt@protonmail.com>
This commit is contained in:
Maciej Barć 2020-12-25 14:04:13 +01:00
parent f8e53b113b
commit 1aab1497bf
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A

View File

@ -42,10 +42,26 @@ metadata_template='<?xml version="1.0" encoding="UTF-8"?>
</pkgmetadata>' </pkgmetadata>'
main() {
ebuild="$(basename "$(pwd)")-9999.ebuild"
if [ ! -f "${ebuild}" ]
then
echo "${ebuild_template}" > "${ebuild}"
else
echo "Already exists: ${ebuild}"
fi
if [ ! -f "metadata.xml" ]
then
echo "${metadata_template}" > "metadata.xml"
else
echo "Already exists: metadata.xml"
fi
}
if [ -f ../../profiles/repo_name ] if [ -f ../../profiles/repo_name ]
then then
echo "${ebuild_template}" >> "$(basename "$(pwd)")-9999.ebuild" main
echo "${metadata_template}" >> "metadata.xml"
else else
echo "Are you in a overlay repo?" echo "Are you in a overlay repo?"
echo "To use this script successfully:" echo "To use this script successfully:"