[dia] New option: --remove-non-local removing from tree everything not in cwd
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] New option: --remove-non-local removing from tree everything not in cwd
- Date: Wed, 6 Oct 2010 22:00:34 +0000 (UTC)
commit 37f66bba5c70d530fcc5011ba9d2c7b6ba1d8e10
Author: Hans Breuer <hans breuer org>
Date: Fri Oct 1 22:28:38 2010 +0200
New option: --remove-non-local removing from tree everything not in cwd
plug-ins/python/wdeps.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/python/wdeps.py b/plug-ins/python/wdeps.py
index 0d83896..2bd6207 100644
--- a/plug-ins/python/wdeps.py
+++ b/plug-ins/python/wdeps.py
@@ -266,6 +266,13 @@ def RemoveRegEx (deps, reg_ex) :
for k2 in node.deps.keys () :
if rr.match (k2) :
del node.deps[k2]
+def RemoveNonLocal (deps) :
+ "Remove everything not available in the current directory"
+ for k in deps.keys() :
+ node = deps[k]
+ for c in node.deps.keys() :
+ if not os.path.exists (c) :
+ del node.deps[c]
def RemoveBySymbols (deps, list) :
"If a connection is conly caused by some symbol in 'list' it is removed"
for k in deps.keys() :
@@ -600,6 +607,7 @@ def main () :
nSymbols = 0
nCutLeafs = 0
+ bRemoveNonLocal = 0
if IsWin32() :
# check if we are running from the right environment
@@ -618,6 +626,7 @@ def main () :
elif arg == "--remove-crt" : dllsToRemove.extend (dllsCrts)
elif arg == "--remove-mfc" : dllsToRemove.extend (dllsMfc)
elif arg == "--remove-gtk" : dllsToRemove.extend (dllsGtk)
+ elif arg == "--remove-non-local" : bRemoveNonLocal = 1
elif string.find (arg, "--remove-regex=") == 0 :
regexRemoves.append (arg[len("--remove-regex="):])
elif string.find (arg, "--remove-symbols=") == 0 :
@@ -752,6 +761,9 @@ For more information read the source.
for rr in regexRemoves :
RemoveRegEx (deps, rr)
+ if bRemoveNonLocal :
+ RemoveNonLocal (deps)
+
while nCutLeafs > 0 :
# not always iterating here, CutLeafs does too
if bDump :
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]