[Midnightbsd-cvs] src [7514] trunk/lib/libmport: add asset dir owner mode type.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Apr 9 17:56:56 EDT 2016


Revision: 7514
          http://svnweb.midnightbsd.org/src/?rev=7514
Author:   laffer1
Date:     2016-04-09 17:56:55 -0400 (Sat, 09 Apr 2016)
Log Message:
-----------
add asset dir owner mode type.

Modified Paths:
--------------
    trunk/lib/libmport/delete_primative.c
    trunk/lib/libmport/mport.h
    trunk/lib/libmport/plist.c

Modified: trunk/lib/libmport/delete_primative.c
===================================================================
--- trunk/lib/libmport/delete_primative.c	2016-04-09 21:01:38 UTC (rev 7513)
+++ trunk/lib/libmport/delete_primative.c	2016-04-09 21:56:55 UTC (rev 7514)
@@ -215,6 +215,7 @@
             case ASSET_DIR:
             case ASSET_DIRRM:
             case ASSET_DIRRMTRY:
+	    case ASSET_DIR_OWNER_MODE:
                 if (mport_rmdir(file, type == ASSET_DIRRMTRY ? 1 : 0) != MPORT_OK) {
                     mport_call_msg_cb(mport, "Could not remove directory '%s': %s", file, mport_err_string());
                 }

Modified: trunk/lib/libmport/mport.h
===================================================================
--- trunk/lib/libmport/mport.h	2016-04-09 21:01:38 UTC (rev 7513)
+++ trunk/lib/libmport/mport.h	2016-04-09 21:56:55 UTC (rev 7514)
@@ -83,7 +83,7 @@
     ASSET_DEPORIGIN, ASSET_NOINST, ASSET_DISPLAY, ASSET_DIR,
     ASSET_SAMPLE, ASSET_SHELL,
     ASSET_PREEXEC, ASSET_PREUNEXEC, ASSET_POSTEXEC, ASSET_POSTUNEXEC,
-    ASSET_FILE_OWNER_MODE
+    ASSET_FILE_OWNER_MODE, ASSET_DIR_OWNER_MODE
 };
 
 typedef enum _AssetListEntryType mportAssetListEntryType;

Modified: trunk/lib/libmport/plist.c
===================================================================
--- trunk/lib/libmport/plist.c	2016-04-09 21:01:38 UTC (rev 7513)
+++ trunk/lib/libmport/plist.c	2016-04-09 21:56:55 UTC (rev 7514)
@@ -119,6 +119,9 @@
 		entry->type = parse_command(cmnd);
 		if (entry->type == ASSET_FILE_OWNER_MODE)
 			parse_file_owner_mode(&entry, cmnd);
+		if (entry->type == ASSET_DIR_OWNER_MODE) {
+			parse_file_owner_mode(&entry, &cmnd[3]);
+		}
         } else {
             entry->type = ASSET_FILE;
         }
@@ -227,12 +230,15 @@
     if (STRING_EQ(s, "unexec"))
         return ASSET_UNEXEC;
 
+    /* dir is preferred to dirrm and dirrmtry */
+    if (STRING_EQ(s, "dir"))
+        return ASSET_DIR;
+    if (strncmp(s, "dir(", 4) == 0)
+	return ASSET_DIR_OWNER_MODE;
     if (STRING_EQ(s, "dirrm"))
         return ASSET_DIRRM;
     if (STRING_EQ(s, "dirrmtry"))
         return ASSET_DIRRMTRY;
-    if (STRING_EQ(s, "dir"))
-        return ASSET_DIR;
     if (STRING_EQ(s, "cwd") || STRING_EQ(s, "cd"))
         return ASSET_CWD;
 



More information about the Midnightbsd-cvs mailing list