Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316951 - sys-libs/cracklib: Verify and potentially improve Python-related code
Summary: sys-libs/cracklib: Verify and potentially improve Python-related code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 308257
  Show dependency tree
 
Reported: 2010-04-24 18:24 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2010-06-10 23:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,33.99 KB, text/plain)
2010-06-02 06:13 UTC, Peter Volkov (RETIRED)
Details
cracklib-2.8.16.ebuild-python-cleanup.fixes.patch (cracklib-2.8.16.ebuild-python-cleanup.fixes.patch,1.96 KB, patch)
2010-06-02 06:32 UTC, Peter Volkov (RETIRED)
Details | Diff
cracklib-2.8.16.ebuild.patch (cracklib-2.8.16.ebuild.patch,2.33 KB, patch)
2010-06-02 16:24 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff
cracklib-2.8.16.ebuild.patch (cracklib-2.8.16.ebuild.patch,2.36 KB, patch)
2010-06-03 13:48 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff
cracklib-2.8.16.ebuild.patch (cracklib-2.8.16.ebuild.patch,2.37 KB, patch)
2010-06-03 14:07 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff
cracklib-2.8.16.ebuild.patch (cracklib-2.8.16.ebuild.patch,1.44 KB, patch)
2010-06-04 12:39 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-24 18:24:08 UTC
- If this package can be used as a library and installs Python modules
  (*.so or *.py) into site-packages directories, then consider supporting
  installation for multiple Python versions.
  Please read section "Types of packages" in documentation [1] to decide
  if this package can support installation for multiple Python versions.

- Ensure that the ebuilds do not use deprecated functions or variables.

- Please check if Python 3 is supported by this package. You can temporarily
  set Python 3 as main active version of Python to properly test if this
  package supports Python 3.

- If this package does not support Python 3:
  - Specify dependency on Python 2.
    You can use PYTHON_DEPEND helper variable, which should be set before
    inheriting of python eclass.
    Please read section "Specification of dependency on Python" in
    documentation [1].

  - If this package cannot support installation for multiple versions of
    Python, then set active version of Python using
    python_set_active_version().

  - Ensure that shebangs in installed scripts specify correct version of
    Python. If shebangs are too generic (e.g. '#!/usr/bin/python'), then you
    can use python_convert_shebangs() to convert shebangs.
    (Wrapper scripts generated by python_generate_wrapper_scripts() do not
    require any changes.)
    Please read section "Shebangs in installed scripts" in documentation [1].

  - To ensure that changes applied to the ebuilds are sufficient, please
    temporarily set Python 3 as main active version of Python and test if
    this package can be properly installed and if it works at run time.

Please see documentation [1] for more details.
[1] http://www.gentoo.org/proj/en/Python/developersguide.xml
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-30 21:11:59 UTC
sys-libs/cracklib-2.8.16 fails to build with Python 3.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-04-30 21:20:50 UTC
So howabout  providing patch here for review. One restricted with python-2.
Comment 3 SpanKY gentoo-dev 2010-04-30 21:28:56 UTC
no log, so i'm going to guess you're talking about the install failure.  it builds just fine.

it's coming from the local py-compile file from python-2.x.  might be fixed by converting to distutils.

...
  File "<string>", line 6
    print 'Byte-compiling python modules...'
                                           ^
SyntaxError: invalid syntax
make[2]: *** [install-pythonPYTHON] Error 1

as for fixing that file, i have no idea.  i dont know what's wrong with it wrt python-3 syntax.
Comment 4 Peter Volkov (RETIRED) gentoo-dev 2010-06-02 06:13:31 UTC
Created attachment 233809 [details]
build.log

it fails if python-3 was installed and eselected as system compiler... I'll try to add patch for this failure soon.
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2010-06-02 06:32:53 UTC
Created attachment 233811 [details, diff]
cracklib-2.8.16.ebuild-python-cleanup.fixes.patch

This patch fixes the problem. As I did some clenup as we go, small summary of python related changes:

1. inherit python
2. set DEPEND through eclass with PYTHON_DEPEND="python? 2"
3. python_set_active_version 2

This also fixes bug 302908. This package works only with python-2 and thus fix that was suggested in bug 302908 is incorrect and I've dropped it:

-	sed -i '/PYTHON/s:\(print\) \([^"]*\):\1(\2):' configure #302908

It's interesting to note, that after this fix was introduced, on 08 Mar 2010 Zac Medico specified <python-3 but forgot to drop this sed...

Please review and either commit or give me Ok to commit. Should I bump revision during bump?
Comment 6 SpanKY gentoo-dev 2010-06-02 07:11:54 UTC
the die w/dodoc is crap.  otherwise, tweaking the python behavior doesnt really matter to me as i never used it.  feel free to commit once the dodoc thing is fixed.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2010-06-02 08:01:19 UTC
(In reply to comment #6)
> the die w/dodoc is crap.

Why? It does not fail on it's own...
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2010-06-02 08:15:19 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > the die w/dodoc is crap.
> 
> Why? It does not fail on it's own...
> 

|| die is for functions that prevent cracklib (or any other ebuild) from working, docs don't fall into that category (as in, it will work fine even if ChangeLog is missing)
Comment 9 SpanKY gentoo-dev 2010-06-02 08:16:58 UTC
nor should it.  blocking an otherwise perfectly fine install due to what largely amount to useless noise no one reads is stupid.  if something goes wrong with the dodoc, we'll eventually see a bug, but there's absolutely no reason to screw over end users in the mean time.
Comment 10 Neil Funk 2010-06-02 15:26:06 UTC
Nixing the ||die sounds reasonable to me.  Otherwise, looks like that patch fixes a lot of stuff The Right Way.  Thanks, Peter, for your work on this and on the related bug 302908 that I reported.
Comment 11 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-02 15:42:54 UTC
It's better to not build static versions of Python modules instead of building them and later removing them.
Comment 12 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-02 16:24:33 UTC
Created attachment 233867 [details, diff]
cracklib-2.8.16.ebuild.patch

It's better to use distutils. It allows to easily support installation for multiple Python ABIs and avoids building of static versions of Python modules.
Comment 13 SpanKY gentoo-dev 2010-06-02 21:36:10 UTC
sticking one statement in an if block is lame.  do `use python && foo` instead.

if you arent going to use the bundled python logic anymore, then the python linking patch probably can be dropped too.
Comment 14 Michael Weber (RETIRED) gentoo-dev 2010-06-03 09:02:55 UTC
Hm, the ebuild should be tested by the maintainer, not the end user.
Since it's no LiveCVS ebuild, the existence/absence of an ChangeLog is pretty determined. 

Anyway, one of these patched should go into the tree, a flame war about `|| die` or not `|| die` doesn't solve any bug.
Comment 15 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-03 13:48:36 UTC
Created attachment 233971 [details, diff]
cracklib-2.8.16.ebuild.patch

(In reply to comment #13)

I'm attaching updated patch.
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2010-06-03 14:00:14 UTC
(In reply to comment #15)
> Created an attachment (id=233971) [details]
> cracklib-2.8.16.ebuild.patch
> 
> (In reply to comment #13)
> 
> I'm attaching updated patch.
> 

You can't drop elibtoolize when there's library that gets installed, and ~x86-fbsd in KEYWORDS because it's also to get sane .so versioning for g/fbsd.
Comment 17 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-03 14:07:52 UTC
Created attachment 233975 [details, diff]
cracklib-2.8.16.ebuild.patch
Comment 18 SpanKY gentoo-dev 2010-06-03 18:33:15 UTC
Michael: unless you have something useful to add, please refrain from commenting

Arfrever: i dont know why you changed the quoting/slash style used with `rm` in the src_install, but the old way was correct.  otherwise that new patch looks OK.
Comment 19 Michael Weber (RETIRED) gentoo-dev 2010-06-03 19:32:43 UTC
(In reply to comment #18)
> Michael: unless you have something useful to add, please refrain from
> commenting
point taken.

I am concerned about all these patches adding sys-libs/zlib, a member of 
the system list, defined in line 67 of /usr/portage/profiles/base/packages, to the *DEPEND. Isn't that redundant?
Comment 20 Samuli Suominen (RETIRED) gentoo-dev 2010-06-03 19:40:20 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > Michael: unless you have something useful to add, please refrain from
> > commenting
> point taken.
> 
> I am concerned about all these patches adding sys-libs/zlib, a member of 
> the system list, defined in line 67 of /usr/portage/profiles/base/packages, to
> the *DEPEND. Isn't that redundant?
> 

no. "or example, the embedded profile doesn't have zlib in system target" [1]

[1] http://devmanual.gentoo.org/general-concepts/dependencies/index.html#implicit-system-dependency

as in, it's always best to define the exact dependencies.
Comment 21 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-03 20:14:28 UTC
(In reply to comment #18)
> Arfrever: i dont know why you changed the quoting/slash style used with `rm` in
> the src_install, but the old way was correct.  otherwise that new patch looks
> OK.

I committed the patch without change in quoting/slash style.
Comment 22 Peter Volkov (RETIRED) gentoo-dev 2010-06-04 12:39:43 UTC
Created attachment 234115 [details, diff]
cracklib-2.8.16.ebuild.patch

And another patch for review: use do_python to make code a bit clearer. Is this good idea to apply?
Comment 23 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-04 12:43:47 UTC
(In reply to comment #22)

It would cause problems for people who grep ebuilds for distutils_src_prepare() etc.
Comment 24 SpanKY gentoo-dev 2010-06-04 18:11:26 UTC
screw em, i like that patch and it addresses a complaint i did not vocalize as i lacked an idea for a better way.  Peter: please 2 apply.