summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2018-08-06 13:54:40 -0700
committerShawn Landden <shawn@git.icu>2018-08-06 13:55:46 -0700
commitb71ae75f7cb99e8f4d8f2281abb860c5eb6aed97 (patch)
tree917dd6bea913adbdc107e64173f7ef0f19e30d56
parentd80562b5ba6ddd1e3818388dfef8e4d7739a2d6e (diff)
downloaddistcc-git-b71ae75f7cb99e8f4d8f2281abb860c5eb6aed97.tar.gz
update-distcc-symlinks: catch some errors
-rwxr-xr-xupdate-distcc-symlinks.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/update-distcc-symlinks.py b/update-distcc-symlinks.py
index af0fffe..bc5cff2 100755
--- a/update-distcc-symlinks.py
+++ b/update-distcc-symlinks.py
@@ -31,17 +31,26 @@ for x in standard_names:
consider_gcc("", "")
consider_gcc("c89-", "")
consider_gcc("c99-", "")
-for gnu_host in os.listdir(gcc_dir):
- consider_gcc("%(gnu_host)s-" % vars(), "")
- for version in os.listdir(gcc_dir + "/" + gnu_host):
- consider_gcc("", "-%(version)s" % vars())
- consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars())
-for gnu_host in os.listdir(gcccross_dir):
- consider_gcc("%(gnu_host)s-" % vars(), "")
- for version in os.listdir(gcccross_dir + "/" + gnu_host):
- consider_gcc("", "-%(version)s" % vars())
- consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars())
-
+try:
+ for gnu_host in os.listdir(gcc_dir):
+ consider_gcc("%(gnu_host)s-" % vars(), "")
+ for version in os.listdir(gcc_dir + "/" + gnu_host):
+ consider_gcc("", "-%(version)s" % vars())
+ consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars())
+except FileNotFoundError:
+ pass
+except NotADirectoryError:
+ pass
+try:
+ for gnu_host in os.listdir(gcccross_dir):
+ consider_gcc("%(gnu_host)s-" % vars(), "")
+ for version in os.listdir(gcccross_dir + "/" + gnu_host):
+ consider_gcc("", "-%(version)s" % vars())
+ consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars())
+except FileNotFoundError:
+ pass
+except NotADirectoryError:
+ pass
consider_clang("")
for ent in os.listdir("/usr/lib"):