[1784] in Moira

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

make www.gen support filesystem aliases

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Sun May 6 01:53:35 2001

Message-Id: <200105060553.BAA01587@never-never-land.mit.edu>
To: moiradev@MIT.EDU
Date: Sun, 06 May 2001 01:53:30 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	Subject line should be self-explanatory.

Index: www.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/www.pc,v
retrieving revision 1.5
diff -u -r1.5 www.pc
--- www.pc	2000/11/30 23:27:49	1.5
+++ www.pc	2001/05/06 05:51:59
@@ -151,6 +151,7 @@
   EXEC SQL BEGIN DECLARE SECTION;
   char label[FILESYS_LABEL_SIZE], path[FILESYS_NAME_SIZE];
   char type[FILESYS_TYPE_SIZE], key[FSGROUP_KEY_SIZE];
+  char alias[ALIAS_NAME_SIZE];
   int status, fid;
   EXEC SQL END DECLARE SECTION;
 
@@ -183,9 +184,26 @@
 	  EXEC SQL CLOSE group_cursor;
 	}
 
+      EXEC SQL DECLARE alias_cursor CURSOR FOR
+	SELECT name INTO :alias FROM alias
+	WHERE type='FILESYS' AND trans=:label;
+
       if (!*strtrim(path))
 	continue;
       fprintf(out, "%s:%s\n", label, path);
+
+      EXEC SQL OPEN alias_cursor;
+      while (1)
+	{
+	  EXEC SQL FETCH alias_cursor INTO :alias;
+	  if (sqlca.sqlcode)
+	    break;
+	  
+	  if (!*strtrim(alias))
+	    continue;
+	  fprintf(out, "%s:%s\n", alias, path);
+	}
+      EXEC SQL CLOSE alias_cursor;
     }
 
   EXEC SQL CLOSE filsys_cursor;

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