# HG changeset patch # User Paul Boddie # Date 1316980919 -7200 # Node ID 61df4406786d875562f15c0fa8e1394f44511cd5 # Parent 78fbcba0c3b95242711cd560f1573d2ac6066ef5 Added tests for the presence of resources to be moved in the target location, typically the case when a conf symbolic link points to the parent directory. diff -r 78fbcba0c3b9 -r 61df4406786d moinsetup.py --- a/moinsetup.py Sun Sep 18 21:37:22 2011 +0200 +++ b/moinsetup.py Sun Sep 25 22:01:59 2011 +0200 @@ -1074,9 +1074,11 @@ if exists(conf_dir): for filename in listdir(conf_dir): pathname = join(conf_dir, filename) - print "Move", filename, "from conf directory." - if not test: - rename(pathname, join(self.common_dir, filename)) + target = join(self.common_dir, filename) + if not exists(target): + print "Move", filename, "from conf directory." + if not test: + rename(pathname, target) else: print "No conf directory." @@ -1084,9 +1086,11 @@ if exists(wikidata): htdocs = join(wikidata, "share", "moin", "htdocs") if exists(htdocs): - print "Move htdocs from wikidata directory." - if not test: - rename(htdocs, join(self.common_dir, "htdocs")) + target = join(self.common_dir, "htdocs") + if not exists(target): + print "Move htdocs from wikidata directory." + if not test: + rename(htdocs, target) else: print "No wikidata directory."