ソースを参照

more fallout from Filename change

David Rose 16 年 前
コミット
f01b8ac21c

+ 2 - 0
panda/src/express/multifile.cxx

@@ -2154,6 +2154,8 @@ standardize_subfile_name(const string &subfile_name) const {
 
   if (name[0] == '/') {
     return name.get_fullpath().substr(1);
+  } else if (name.length() > 2 && name[0] == '.' && name[1] == '/') {
+    return name.get_fullpath().substr(2);
   } else {
     return name.get_fullpath();
   }

+ 31 - 1
panda/src/express/virtualFileSystem.cxx

@@ -147,6 +147,11 @@ mount(const Filename &physical_filename, const Filename &mount_point,
 ////////////////////////////////////////////////////////////////////
 bool VirtualFileSystem::
 mount(VirtualFileMount *mount, const Filename &mount_point, int flags) {
+  if (express_cat->is_debug()) {
+    express_cat->debug()
+      << "mount " << *mount << " under " << mount_point << "\n";
+  }
+
   _lock.acquire();
   bool result = do_mount(mount, mount_point, flags);
   _lock.release();
@@ -174,6 +179,10 @@ unmount(Multifile *multifile) {
         DCAST(VirtualFileMountMultifile, mount);
       if (mmount->get_multifile() == multifile) {
         // Remove this one.  Don't increment wi.
+        if (express_cat->is_debug()) {
+          express_cat->debug()
+            << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+        }
         mount->_file_system = NULL;
 
       } else {
@@ -215,6 +224,10 @@ unmount(const Filename &physical_filename) {
         DCAST(VirtualFileMountSystem, mount);
       if (smount->get_physical_filename() == physical_filename) {
         // Remove this one.  Don't increment wi.
+        if (express_cat->is_debug()) {
+          express_cat->debug()
+            << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+        }
         mount->_file_system = NULL;
         
       } else {
@@ -227,6 +240,10 @@ unmount(const Filename &physical_filename) {
         DCAST(VirtualFileMountMultifile, mount);
       if (mmount->get_multifile()->get_multifile_name() == physical_filename) {
         // Remove this one.  Don't increment wi.
+        if (express_cat->is_debug()) {
+          express_cat->debug()
+            << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+        }
         mount->_file_system = NULL;
 
       } else {
@@ -264,6 +281,10 @@ unmount(VirtualFileMount *mount) {
     (*wi) = (*ri);
     if ((*ri) == mount) {
       // Remove this one.  Don't increment wi.
+      if (express_cat->is_debug()) {
+        express_cat->debug()
+          << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+      }
       (*ri)->_file_system = NULL;
 
     } else {
@@ -299,6 +320,10 @@ unmount_point(const Filename &mount_point) {
 
     if (mount->get_mount_point() == nmp) {
       // Remove this one.  Don't increment wi.
+      if (express_cat->is_debug()) {
+        express_cat->debug()
+          << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+      }
       mount->_file_system = NULL;
 
     } else {
@@ -326,7 +351,12 @@ unmount_all() {
   _lock.acquire();
   Mounts::iterator ri;
   for (ri = _mounts.begin(); ri != _mounts.end(); ++ri) {
-    (*ri)->_file_system = NULL;
+    VirtualFileMount *mount = (*ri);
+    if (express_cat->is_debug()) {
+      express_cat->debug()
+        << "unmount " << *mount << " from " << mount->get_mount_point() << "\n";
+    }
+    mount->_file_system = NULL;
   }
 
   int num_removed = _mounts.size();

+ 1 - 0
panda/src/express/virtualFileSystem.h

@@ -62,6 +62,7 @@ PUBLISHED:
 
   int get_num_mounts() const;
   PT(VirtualFileMount) get_mount(int n) const;
+  MAKE_SEQ(get_mounts, get_num_mounts, get_mount);
 
   BLOCKING bool chdir(const Filename &new_directory);
   BLOCKING Filename get_cwd() const;