summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FS.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize the repo. Moved src/engine/SCons to ./SCons to be more in line ↵William Deegan2020-05-061-3806/+0
| | | | with current python packaging practices
* Fix inconsistencies between RootDir attributesAdam Gross2020-04-021-1/+7
| | | | | | | | | | | | The RootDir class was returning different values for path and _path as well as different values for abspath and _abspath. This is because the underscored versions were being set in the RootDir constructor, while the non-underscored versions were going through the EntryProxy wrapper, which is only coded to do a simple append of paths. I considered trying to fix EntryProxy to detect this case but instead went with a simpler approach where RootDir overrides the attributes that it wants to avoid EntryProxy calls. Right now I have this as path and abspath.
* Remove u' u" from strings. no longer neededWilliam Deegan2020-02-181-1/+1
|
* more post py27 cleanupWilliam Deegan2020-02-181-16/+5
|
* replace dictionary initializations with simpler logicWilliam Deegan2020-02-181-9/+3
|
* Remove 'from __future__ import print_function' no longer needed as we're ↵William Deegan2020-02-171-2/+0
| | | | dropping < py 3.5
* Stop converting to list where not neededMats Wichmann2020-01-161-2/+2
| | | | | | | | | | | | | | | | | | Python 3 returns a special object, which is iterable, rather than a list when you ask for dictionary keys(), values(), items(). if you then proceed to iterate over it it's being used as expected and doesn't have to be forced to a list first. This occurs a number of places in this form: for k in list(something.keys()): Also there are several places where the code loops over the result of dict.keys() and then uses the key to index into the dictionary, this can be replaced by: for k, v in something.items(): Signed-off-by: Mats Wichmann <mats@linux.com>
* syntax fixups suggested by PyCharmMats Wichmann2019-12-231-20/+19
| | | | | | | | | | | | | | Drop unneeded parens. Drop trailing semicolons. Triple double-quote docstrings. Regexes drop unneeded escapes. Spaces around parens, braces: remove/add. Some one-tuples get their missing closing comma. A couple of sets use set init syntax {foo} instead of set([iter]) now. And a fiddle in Node to reduce lookup time on md5 signature functions (came about because of a line-too-long issue, initially) Signed-off-by: Mats Wichmann <mats@linux.com>
* Optimize for most common case in Entry.disambiguate()Mathew Robinson2019-12-121-5/+5
| | | | This removes many unnecessary os.stat and related FS IO calls.
* Add test and fix to regression in current 3.1.0 dropJason Kenny2019-07-301-0/+2
|
* [ci skip] Fix spelling picked up by siderWilliam Deegan2019-07-141-1/+1
|
* Fix docstrings and comments for repo node changesWilliam Deegan2019-07-141-6/+8
|
* Clean up __slots__ specification to be list, remove some obsoleted codeWilliam Deegan2019-07-091-4/+2
|
* Fix __slots = ('single element') -> ('single element',) per finding by mwichmannWilliam Deegan2019-07-051-3/+3
|
* Fix _add_strings_to_dependency_map() perf degredationWilliam Deegan2019-06-281-2/+1
|
* Restore MD5-Timestamp performance by removing try/except from every call. ↵William Deegan2019-06-261-25/+62
| | | | Also some optimized logic for updating and using the dependency_map built as part of the decider. Fixed tests. Note Deciders now need a fourth argument 'repo_node' which is the repository node for the file if it's to be used. This is currently only used by md5-timestamp decider File.changed_timestamp_then_content()
* Merge pull request #3345 from mwichmann/py38warns4-testsWilliam Deegan2019-04-281-2/+2
|\ | | | | [wip] Py38warns4 tests
| * [PY 3.8] test fixes for file closings, rawstringsMats Wichmann2019-04-251-11/+11
| | | | | | | | | | | | | | On a linux host (missing some things that may be on the Travis CI setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages. Signed-off-by: Mats Wichmann <mats@linux.com>
| * [PY 3.8] file closes in tools and othersMats Wichmann2019-04-251-2/+2
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* | Some more lint-derived cleanupsMats Wichmann2019-04-271-15/+15
|/ | | | | | | | | | | | Consistently use "not is" and "not in", many instances used the form "not x is y" instead, which pylint objected to. A couple of bare except clauses got a qualifier. Files otherwise touched had trailing whitespace cleaned up as well. These are all things that sider would complain about if a change happened nearby, so this is pre-emptive. Signed-off-by: Mats Wichmann <mats@linux.com>
* Forgot to add current file csig when shortcutting calling changed_content(). ↵William Deegan2019-03-021-0/+5
| | | | Directly calling get_csig() when there is no previous build history
* Added logic to shortcut comparing prev_ni if there is no dependency map from ↵William Deegan2019-03-011-4/+24
| | | | previous build. This should speed up md5-timestamp builds for clean builds. Also added debug logic to dump and check aagainst previous implementation at top of FS.PY MD5_TIMESTAMP_DEBUG flag. currently set to False
* On windows first try with native file paths with \\ then swap path to ↵William Deegan2019-02-271-7/+26
| | | | normalized path string with / separators. On a fresh windows build the node string will have windows dirsep and not normalizd. This yielded broken builds for the Meta project'
* Resolve comments from @GaryO to clarify new code.William Deegan2018-11-121-2/+13
|
* Fix docstring on FileBuildInfo per comment from @dirkbaechleWilliam Deegan2018-11-121-3/+11
|
* switch from izip to zip. no izip in py3William Deegan2018-11-121-2/+2
|
* Revisit caching of filename -> csig map and invalidate when reasonableWilliam Deegan2018-11-121-37/+28
|
* Add docstringWilliam Deegan2018-11-121-0/+8
|
* Change logic to ensure we only build the dependency map once per target file.William Deegan2018-11-121-3/+14
|
* Moved logic to handle Timestamp-MD5 decider issues into File() node. One ↵William Deegan2018-11-121-2/+93
| | | | minor change in Node.Changed() it now has to handle the decider called indirectly throwing DeciderNeedsNode exception which has a property of decider it should call. Also had to update the explain logic to handle this exception.
* move comment to docstring for LinkFunc()William Deegan2018-11-121-5/+7
|
* clarify docstring on decider functionWilliam Deegan2018-11-121-2/+2
|
* Clear up some comments and convert comment to docstring where it makes senseWilliam Deegan2018-11-121-16/+24
|
* add method find_repo_file() which finds the file in it's known repositories. ↵William Deegan2018-11-121-3/+28
| | | | Minor reformat in rfile().
* Fix comment spellingWilliam Deegan2018-11-121-1/+1
|
* Added docstring to File.changed_timestamp_then_content()include a note and ↵William Deegan2018-11-121-3/+16
| | | | reference to issue #2980
* Fix some bad code formatting.William Deegan2018-11-121-8/+20
|
* Fix Bug #3212. Using CacheDir with Configure TryCompile with Python 3 was ↵William Deegan2018-10-101-0/+5
| | | | failing because it was yielding a mixture of bytes and strings when generating cachedir signature use to determine file and directory in cachedir to use
* A few syntax cleanupsMats Wichmann2018-10-031-5/+5
| | | | | | | | | | | | | | | | | | | | | Suggested by PyCharm. Includes three "real" changes: 1. src/engine/SCons/Node/__init__.py has a print statement in a function which references 'self', but there is no 'self' defined (it is not a method in a class). Guessing it should have been 'node'. 2. src/engine/SCons/Environment.py makes a call using 'kwbd' which is not defined, looks like a copy-paste error and should be 'bd'. 3. src/engine/SCons/Tool/JavaCommon.py splits 'file', which is not defined, was evidently supposed to be 'fn'. These should be double-checked. The rest are purely syntax: whitespace, dropping trailing semicolons, using "is" to test for None, simplifying comparisons, normalizing docstring commenting ("always triple double quotes"), unneeded backslashes. Signed-off-by: Mats Wichmann <mats@linux.com>
* Updated FS to handle removal of splitunc function from python 3.7Daniel Moody2018-08-101-1/+4
|
* Fix problem with Install and multiple dirs outside src tree.Gary Oberbrunner2018-01-051-1/+6
| | | | | | | | | | | | In some cases it's possible to get a case where the target path already does exist, but the dir node for it hasn't been updated yet. This fix prevents MkdirFunc from trying to create it when it already exists. Added a testcase which failed before the fix and works after it. Also fixes a problem running tests on Windows, using standard python 3 which is installed in "C:/Program Files/Python36". The python path name has to be escaped in that case. See runtest.py.
* Fix many epydoc warningsWilliam Deegan2017-09-011-18/+12
|
* Updates to get_text_content() logic and testsWilliam Deegan2017-08-241-3/+6
|
* Handle decode errors by backslashing character. Should only throw exception ↵William Deegan2017-08-231-2/+2
| | | | if content is not a byte type now
* Fix issue for PY3 where file content has not BOM and isn't ascii by ↵William Deegan2017-08-231-1/+1
| | | | decodeing to utf-8
* Added support for a PyPackageDir functiongrbd2017-08-031-0/+29
|
* PY2/3 For the time being disable using soft or hard links in duplicating ↵William Deegan2017-05-161-2/+7
| | | | files on win32. It's supported under PY3, but SCons will need more work to make sure it's used in a consistant way and if user permissions are needed if they user has them
* more removal of sccs and rcs builder logicWilliam Deegan2017-04-181-76/+2
|
* py2/3 Need to add __hash__ function to EntryProxy as with py3 __hash__ ↵William Deegan2017-04-061-0/+6
| | | | function is removed when a class provides __eq__
* py2/3 define __lt__ for nodes, so sort will work on py3William Deegan2017-04-031-0/+4
|