summaryrefslogtreecommitdiffstats
path: root/meta/classes/metadata_scm.bbclass
AgeCommit message (Collapse)Author
2014-12-31metadata_scm: Fix crash due to uncaught python exceptionMerten Sach
Function base_get_metadata_svn_revision was crashing due to an uncaught IndexError exception. The except notation without parentheses is legacy syntax. It is the equivalent to 'except IOError as IndexError' which is not what we want here. The change catches both exceptions. (From OE-Core rev: 33bea949bae54ddc89aa83cf07d7b1ee62e2b393) (From OE-Core rev: 4a3f37f7d004b196b9caeb558d3461452dd85edc) Signed-off-by: Merten Sach <msach@mailbox.tu-berlin.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-24metadata_scm: Avoid crashing on new svn version layoutsRichard Purdie
This avoids crashing on newer svn layouts where the entries files don't contain three lines. If someone wants to fix this to get the right version on newer subversion checkouts, patches welcome but this at least stops things crashing. [YOCTO #5363] (From OE-Core rev: e850c53d4d8cb877a704a23f9ce02d6185ba3ffa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09class/lib: Fix up various file access methodsRichard Purdie
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases (From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09metadata_scm: Replace deprecated operatorRichard Purdie
The <> operator is deprecated, use != instead which is equivalent. (From OE-Core rev: dde7af5f6c769eae721b1ee18462b841c8ea3277) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30Revert "meta: replace os.popen with subprocess.Popen"Richard Purdie
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion is not correct. Its replacing readlines() calls which generate an array with what are effectively strings. There are split("\n") calls missing in many cases so this needs to be reverted until it gets fixed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30meta: replace os.popen with subprocess.PopenRobert Yang
Replace os.popen with subprocess.Popen since the older function would fail (more or less) silently if the executed program cannot be found There are both bb.process.run() and bb.process.Popen() which wraps the subprocess module, use it for simplifying the code. Note: We don't need the "2>/dev/null" or "2>&1" since bb.process.run() can handle it, it will raise exception when error occurs, we should handle the exception ourselves if we want to ignore the error. More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] (From OE-Core rev: e83d8e58a6b107eea87df0ec233a1bc932b2c6ea) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie
Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` (From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-11metadata_scm.bbclass: Use COREBASE to grok for SCM operationsKhem Raj
(From OE-Core rev: 17c8c41b837d66bd3cc02c4c60e62dcfc13b80a8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-10-21metadata_scm: Ensure that if an SCM isn't present, we dont print a revision ↵Richard Purdie
of 'fatal:' as it looks bad Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-08metadata_scm.bbclass: Make errors quiet if we're not in a git based scmJoe Sauer
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-19base.bbclass: Split up as per the patch in OE.dev by Chris Larson making ↵Richard Purdie
code more readable and modularised Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>