Remove deprecated os.popen, split git dir finding to a function
Remove deprecated os.popen, split git dir finding to a function

This modernizes subprocess handling in builddeps, removing deprecated
os.path and undocumented subprocess.list2cmdline.
(This eases upgrading to later versions of Python.)

Also fixes resource handling, and moves the "find git dirs" into a
module-level function, since it's purely functional and doesn't actually
need to mutate the object.

A few simplifications as well:
* don't need --full-name or . in git-ls-files, and in fact *shouldn't* use
  full name, b/c paths are assumed to be relative to cwd.
* slightly faster detection of redundant directories.

R=Jói

Review URL: https://codereview.chromium.org/250803017

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@267164 0039d316-1c4b-4281-b951-d872f2087c98

Jonekee/chromium.src,Jonekee/chromium.src,Fireblend/chromium-crosswalk,Just-D/chromium-1,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,dushu1203/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,Just-D/chromium-1,Chilledheart/chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,dednal/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src