Changeset 23864 for trunk/ippTools/src/disttool.c
- Timestamp:
- Apr 14, 2009, 3:57:09 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/disttool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/disttool.c
r23861 r23864 41 41 static bool pendingfilesetMode(pxConfig *config); 42 42 static bool addfilesetMode(pxConfig *config); 43 static bool revertfilesetMode(pxConfig *config); 44 static bool queuercrunMode(pxConfig *config); 45 static bool updatercrunMode(pxConfig *config); 46 static bool revertrcrunMode(pxConfig *config); 43 47 static bool pendingdatastoresMode(pxConfig *config); 44 48 … … 72 76 MODECASE(DISTTOOL_MODE_PENDINGFILESET, pendingfilesetMode); 73 77 MODECASE(DISTTOOL_MODE_ADDFILESET, addfilesetMode); 78 MODECASE(DISTTOOL_MODE_REVERTFILESET, revertfilesetMode); 79 MODECASE(DISTTOOL_MODE_QUEUERCRUN, queuercrunMode); 80 MODECASE(DISTTOOL_MODE_UPDATERCRUN, updatercrunMode); 81 MODECASE(DISTTOOL_MODE_REVERTRCRUN, revertrcrunMode); 74 82 MODECASE(DISTTOOL_MODE_PENDINGDATASTORES, pendingdatastoresMode); 75 83 default: … … 894 902 return true; 895 903 } 904 static bool revertfilesetMode(pxConfig *config) 905 { 906 psMetadata *where = psMetadataAlloc(); 907 PXOPT_COPY_S64(config->args, where, "-fs_id", "fs_id", "=="); 908 PXOPT_COPY_S64(config->args, where, "-dist_id", "rcDSFileset.dist_id", "=="); 909 PXOPT_COPY_S64(config->args, where, "-prod_id", "prod_id", "=="); 910 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "==");; 911 PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "=="); 912 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 913 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 914 PXOPT_COPY_S16(config->args, where, "-fault", "rcDSFileset.fault", "=="); 915 916 // It might be useful to be able to query by the parameters of the underlying runs 917 918 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { 919 psFree(where); 920 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); 921 return false; 922 } 923 924 psString query = pxDataGet("disttool_revertfileset.sql"); 925 if (!query) { 926 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 927 psFree(where); 928 return false; 929 } 930 931 if (psListLength(where->list)) { 932 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 933 psStringAppend(&query, " AND %s", whereClause); 934 psFree(whereClause); 935 } 936 937 if (!p_psDBRunQuery(config->dbh, query)) { 938 psError(PS_ERR_UNKNOWN, false, "database error"); 939 psFree(query); 940 if (!psDBRollback(config->dbh)) { 941 psError(PS_ERR_UNKNOWN, false, "database error"); 942 } 943 return false; 944 } 945 psFree(query); 946 947 int numUpdated = psDBAffectedRows(config->dbh); 948 949 psLogMsg("disttool", PS_LOG_INFO, "deleted %d rcDSFilesets", numUpdated); 950 951 return true; 952 } 896 953 897 954 static bool pendingdatastoresMode(pxConfig *config) … … 968 1025 return true; 969 1026 } 1027 1028 static bool queuercrunMode(pxConfig *config) 1029 { 1030 PS_ASSERT_PTR_NON_NULL(config, false); 1031 return true; 1032 } 1033 static bool updatercrunMode(pxConfig *config) 1034 { 1035 PS_ASSERT_PTR_NON_NULL(config, false); 1036 return true; 1037 } 1038 static bool revertrcrunMode(pxConfig *config) 1039 { 1040 PS_ASSERT_PTR_NON_NULL(config, false); 1041 return true; 1042 }
Note:
See TracChangeset
for help on using the changeset viewer.
