[1851] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r3997 - trunk/moira/incremental/afs

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Mar 30 14:48:39 2010

Date: Tue, 30 Mar 2010 14:48:33 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201003301848.o2UImXGq018074@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2010-03-30 14:48:33 -0400 (Tue, 30 Mar 2010)
New Revision: 3997

Modified:
   trunk/moira/incremental/afs/afs_create.pl
Log:
Desktop directory in default dotfiles.  Adds alliteration.

Modified: trunk/moira/incremental/afs/afs_create.pl
===================================================================
--- trunk/moira/incremental/afs/afs_create.pl	2010-03-30 15:40:58 UTC (rev 3996)
+++ trunk/moira/incremental/afs/afs_create.pl	2010-03-30 18:48:33 UTC (rev 3997)
@@ -161,9 +161,10 @@
 	chmod(0755, $path);
 	mkdir("$path/Public",0755) && mkdir("$path/www",0755) &&
 	    mkdir("$path/Private",0700) && mkdir("$path/Mail", 0700) &&
-		chown($uid,0,"$path/Public","$path/www",
-		      "$path/Private","$path/Mail") ||
-			  die "Unable to create subdirectories\n";
+	    mkdir("$path/Desktop",0755) &&
+	    chown($uid,0,"$path/Public","$path/www",
+		  "$path/Private","$path/Mail","$path/Desktop") ||
+		  die "Unable to create subdirectories\n";
 	system("$fs sa -dir $path/Public $path/www -acl @acl system:anyuser rl -clear") &&
 	    die "Unable to set acl on Public directory";
 	system("$fs sa -dir $path/Private $path/Mail -acl @acl -clear") &&
@@ -183,6 +184,25 @@
 	    close(IN);
 	    chown($uid,0,"$path/$i");
 	}
+
+	opendir(DIR,"$protodir/Desktop") || die "Unable to open prototype Desktop directory\n";
+	@files = readdir(DIR);
+	closedir(DIR);
+
+	for $i (@files) {
+	    next if ($i eq "." || $i eq "..");
+	    next unless -f "$protodir/Desktop/$i";
+	    open(IN,"<$protodir/Desktop/$i") || die "Unable to open $protodir/Desktop/$i\n";
+            open(OUT,">$path/Desktop/$i") || die "Unable to create Desktop/$i\n";
+            while ($_=<IN>) { print OUT $_; };
+            close(OUT);
+            close(IN);
+            chown($uid,0,"$path/Desktop/$i");
+        }
+
+	system("$fs sa -dir $path/Desktop -acl @acl system:anyuser l -clear") &&
+	    die "Unable to set acl on Desktop directory";
+	
 	system("$fs sa $path @acl system:anyuser l -clear") &&
 	    die "Unable to set acl on top-level directory\n";
 	return;


home help back first fref pref prev next nref lref last post