aides-spec/aides_spec/utils/empty_template.py

55 lines
1,014 B
Python
Raw Permalink Normal View History

2025-01-05 08:37:11 +00:00
import sys
file = """name=example
version=1.0.0
release=1
epoch=0
desc=Description
homepage=https://exemple.com
maintainer=
# or 'all' for noarch
architectures=('amd64')
licenses=('custom:proprietary')
provides=()
conflicts=()
deps=()
build_deps=()
opt_deps=()
auto_deps=0
auto_req=0
replaces=()
sources=()
checksums=()
backup=()
scripts=(
['preinstall']='preinstall.sh'
['postinstall']='postinstall.sh'
['preremove']='preremove.sh'
['postremove']='postremove.sh'
['preupgrade']='preupgrade.sh'
['postupgrade']='postupgrade.sh'
['pretrans']='pretrans.sh'
['posttrans']='posttrans.sh'
)
prepare() {
echo "PREPARE"
}
build() {
echo "BUILD"
}
package() {
echo "PACKAGE"
}
"""
def create_from_empty_template(output_file):
try:
with open(output_file, "w") as f:
f.write(file)
print(f"Файл успешно записан в {output_file}.")
except IOError as e:
print(f"Ошибка при записи файла: {e}")
sys.exit(1)