Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388961 - scons-utils.eclass: scons_clean_makeopts fails to handle "--jobs -l3" and "-j -l3" (due to wrong regex?)
Summary: scons-utils.eclass: scons_clean_makeopts fails to handle "--jobs -l3" and "-j...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-30 12:46 UTC by Sebastian Pipping
Modified: 2011-10-30 16:28 UTC (History)
0 users

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


Attachments
Test suite for scons_clean_makeopts as a dummy ebuild (scons-test-1.0.ebuild,750 bytes, text/plain)
2011-10-30 12:46 UTC, Sebastian Pipping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2011-10-30 12:46:39 UTC
Created attachment 291217 [details]
Test suite for scons_clean_makeopts as a dummy ebuild

Hey there.  While playing with function scons_clean_makeopts I discovered that it doesn't handle these two cases properly:

  FAILED test for '--jobs -l3' (got '--jobs -l3', expected '--jobs=5')
  FAILED test for '-j -l3' (got '-j -l3', expected '-j 5')

These tests are mine: I abused a dummy ebuild for that, see attachment.
As far as I can tell the problem is that the code

  if [[ ${#} -gt 1 && ${2} =~ [0-9]+ ]]; then

in the eclass applies regex [0-9]+ rather than something like '^[0-9]+$'.  That code appears at least twice in the eclass.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-10-30 14:31:43 UTC
Patch title (first comment line): Fix broken number matching regexp in scons_clean_makeopts().
Autocommit
  cvs commit -F .msg 'scons-utils.eclass'
/var/cvsroot/gentoo-x86/eclass/scons-utils.eclass,v  <--  scons-utils.eclass
new revision: 1.7; previous revision: 1.6
Committed successfully to CVS

Thanks for the report; I've added regression tests for the bug to the test suite as well (/eclass/tests/scons-utils.sh).
Comment 2 Sebastian Pipping gentoo-dev 2011-10-30 14:39:11 UTC
Impressive response time!
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-10-30 16:28:46 UTC
(In reply to comment #2)
> Impressive response time!

Yes, that one is usually great when you are supposed to be doing something else ;D.