]> andersk Git - moira.git/blobdiff - incremental/afs_rename.pl
Release old path's parent volume, if necessary (required some restructuring)
[moira.git] / incremental / afs_rename.pl
index 1f8e2bee1087d81cc05e95253cfe4fa007eac539..026cdfc662eeba27bd0a05c96709f5cd9852b335 100644 (file)
@@ -55,14 +55,20 @@ if ($oldtype eq "ERR") {
 $newvname = "X" . $newvname if ($newtype eq "ERR");
 $newvname =~ s/[^-A-Za-z0-9_.]//g;     # strip out illegal characters
 
-&run("$fs rmm $oldpath");
 &run("$vos rename $oldvname $newvname -cell $newcell")
     if ($oldvname ne $newvname);
 &run("$vos remove $oldbackup $oldvname.backup -cell $oldcell")
     if ($oldbackup && $newvname =~ /^n\./);
-&run("$fs mkm $newpath $newvname")
-    if ($newtype eq "AFS");
-&release_parent($newpath);
+
+if ($oldtype eq "AFS") {
+    &run("$fs rmm $oldpath");
+    &release_parent($oldpath)
+       if ($newtype ne "AFS" || $oldpath ne $newpath);
+}
+if ($newtype eq "AFS") {
+    &run("$fs mkm $newpath $newvname");
+    &release_parent($newpath);
+}
 
 exit;
 
This page took 0.136391 seconds and 4 git commands to generate.