[opensuse-packaging] How to fix python-bytecode-inconsistent-mtime rpmlint warning?
Hi, all, I'm packaging a twitter client, whose GTK version uses Python. And I got python-bytecode-inconsistent-mtime rpmlint warning. Actually I got that msg a few times before when I was packaging other python applications. At first I try to fix it by running "python -m compileall *.pyc", but recently OBS import a new rule which will check if you have buildroot in your *.pyc file. I then "fix" a warning to an 10000 error. That's too bad. I googled the web to find a answer, only one item related: https://bugzilla.redhat.com/show_bug.cgi?id=591730 In that bug report, the packager said he fixed it, but leaved no method for me. So now it seems I'm the only one who frequently get this warning. I'm thinking two methods to fix it: 1. find . -name "*.pyc" | sed to replace buildroot in pyc to null. 2. delete all *.pyc Any better idea for me ? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, Mar 14, 2012 at 9:43 PM, Marguerite Su wrote:
Hi, all,
I'm packaging a twitter client, whose GTK version uses Python. And I got python-bytecode-inconsistent-mtime rpmlint warning.
Actually I got that msg a few times before when I was packaging other python applications.
At first I try to fix it by running "python -m compileall *.pyc", but recently OBS import a new rule which will check if you have buildroot in your *.pyc file. I then "fix" a warning to an 10000 error. That's too bad.
I googled the web to find a answer, only one item related:
https://bugzilla.redhat.com/show_bug.cgi?id=591730
In that bug report, the packager said he fixed it, but leaved no method for me.
So now it seems I'm the only one who frequently get this warning.
I'm thinking two methods to fix it:
1. find . -name "*.pyc" | sed to replace buildroot in pyc to null.
2. delete all *.pyc
Any better idea for me ?
rpmlint log here: https://build.opensuse.org/package/live_build_log?arch=x86_64&package=hotot-qt&project=home%3AMargueriteSu&repository=openSUSE_Factory package spec here: https://build.opensuse.org/package/view_file?file=hotot.spec&package=hotot-qt&project=home%3AMargueriteSu&rev=550aec6067d8cf434b9328853f7fb4d1 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, 14 Mar 2012 21:43:10 +0800 Marguerite Su wrote:
At first I try to fix it by running "python -m compileall *.pyc", but recently OBS import a new rule which will check if you have buildroot in your *.pyc file. I then "fix" a warning to an 10000 error. That's too bad.
You need to cd to buildroot first. pushd %{buildroot}%{python_sitearch} %py_compile . popd -- WBR Kyrill -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, Mar 14, 2012 at 10:50 PM, Kyrill Detinov
On Wed, 14 Mar 2012 21:43:10 +0800 Marguerite Su wrote:
At first I try to fix it by running "python -m compileall *.pyc", but recently OBS import a new rule which will check if you have buildroot in your *.pyc file. I then "fix" a warning to an 10000 error. That's too bad.
You need to cd to buildroot first.
pushd %{buildroot}%{python_sitearch} %py_compile . popd
-- WBR Kyrill -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hi, # Fix python-bytecode-inconsistent-mtime pushd %{buildroot}%{python_sitearch} %py_compile popd returns: + pushd /home/abuild/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages/ ~/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages ~/rpmbuild/BUILD/hotot-0.9.7.45 + find %1 -name '*.pyc' -exec rm -f '{}' ';' find: `%1': No such file or directory I have to make it work by: # Fix python-bytecode-inconsistent-mtime pushd %{buildroot}%{python_sitearch} rm -rf *.pyc python -m compileall *.py popd Thanks. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, 15 Mar 2012 15:24:14 +0800 Marguerite Su wrote:
# Fix python-bytecode-inconsistent-mtime pushd %{buildroot}%{python_sitearch} %py_compile popd
returns:
+ pushd /home/abuild/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages/ ~/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages ~/rpmbuild/BUILD/hotot-0.9.7.45 + find %1 -name '*.pyc' -exec rm -f '{}' ';' find: `%1': No such file or directory
You forgot to add dot as current directory: %py_compile . -- WBR Kyrill -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, Mar 15, 2012 at 4:01 PM, Kyrill Detinov
On Thu, 15 Mar 2012 15:24:14 +0800 Marguerite Su wrote:
# Fix python-bytecode-inconsistent-mtime pushd %{buildroot}%{python_sitearch} %py_compile popd
returns:
+ pushd /home/abuild/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages/ ~/rpmbuild/BUILDROOT/hotot-0.9.7.45-1.x86_64/usr/lib64/python2.7/site-packages ~/rpmbuild/BUILD/hotot-0.9.7.45 + find %1 -name '*.pyc' -exec rm -f '{}' ';' find: `%1': No such file or directory
You forgot to add dot as current directory: %py_compile .
-- WBR Kyrill -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Thanks, Kyrill, I got it run successfully. marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (2)
-
Kyrill Detinov
-
Marguerite Su