[Zope3-checkins] CVS: Zope3/src/zope/fssync - fssync.py:1.10
Guido van Rossum
guido@python.org
Tue, 13 May 2003 15:28:57 -0400
Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv32093
Modified Files:
fssync.py
Log Message:
Small tweaks.
=== Zope3/src/zope/fssync/fssync.py 1.9 => 1.10 ===
--- Zope3/src/zope/fssync/fssync.py:1.9 Tue May 13 15:16:58 2003
+++ Zope3/src/zope/fssync/fssync.py Tue May 13 15:28:56 2003
@@ -365,7 +365,14 @@
if not entry:
raise Error("nothing known about", target)
self.network.loadrooturl(target)
- head, tail = split(realpath(target))
+ head, tail = split(target)
+ if tail in unwanted:
+ target = realpath(target)
+ head, tail = split(target)
+ if head == target or tail in unwanted:
+ raise Error("target '%s' is the filesystem root", target)
+ if not head:
+ head = os.curdir
path = entry["path"]
fp, headers = self.network.httpreq(path, "@@toFS.zip")
try:
@@ -402,11 +409,13 @@
if entry:
raise Error("path '%s' is already registered", path)
head, tail = split(path)
- if tail in unwanted or not head:
+ if tail in unwanted:
path = realpath(path)
head, tail = split(path)
if head == path or tail in unwanted:
- raise Error("can't add '%s': it is the system root directory")
+ raise Error("can't add '%s': it is the filesystem root", path)
+ if not head:
+ head = os.curdir
pentry = self.metadata.getentry(head)
if not pentry:
raise Error("can't add '%s': its parent is not registered", path)