Index: trunk/ippTools/src/pubtool.c
===================================================================
--- trunk/ippTools/src/pubtool.c	(revision 25256)
+++ trunk/ippTools/src/pubtool.c	(revision 25929)
@@ -32,4 +32,5 @@
 
 static bool defineclientMode(pxConfig *config);
+static bool updateclientMode(pxConfig *config);
 static bool definerunMode(pxConfig *config);
 static bool pendingMode(pxConfig *config);
@@ -57,4 +58,5 @@
     switch (config->mode) {
         MODECASE(PUBTOOL_MODE_DEFINECLIENT, defineclientMode);
+        MODECASE(PUBTOOL_MODE_UPDATECLIENT, updateclientMode);
         MODECASE(PUBTOOL_MODE_DEFINERUN, definerunMode);
         MODECASE(PUBTOOL_MODE_PENDING, pendingMode);
@@ -94,8 +96,50 @@
     PXOPT_LOOKUP_STR(comment, config->args, "-comment",  false, false);
 
-    if (!publishClientInsert(config->dbh, 0, product, stage, workdir, comment)) {
-        psError(PS_ERR_UNKNOWN, false, "Database error");
-        return false;
-    }
+    if (!publishClientInsert(config->dbh, 0, 0, product, stage, workdir, comment)) {
+        psError(PS_ERR_UNKNOWN, false, "Database error");
+        return false;
+    }
+
+    return true;
+}
+
+static bool updateclientMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psMetadata *where = psMetadataAlloc(); // WHERE conditions
+    PXOPT_COPY_S64(config->args, where, "-client_id", "client_id", "==");
+    PXOPT_COPY_STR(config->args, where, "-product", "product", "==");
+    PXOPT_COPY_STR(config->args, where, "-stage", "stage", "==");
+    PXOPT_COPY_STR(config->args, where, "-comment", "comment", "LIKE");
+
+    PXOPT_LOOKUP_BOOL(active, config->args, "-active",  false);
+    PXOPT_LOOKUP_BOOL(inactive, config->args, "-inactive",  false);
+
+    if ((!active && !inactive) || (active && inactive)) {
+        psError(PS_ERR_UNKNOWN, false, "Must specify one, and only one, of -active and -inactive.");
+        psFree(where);
+        return false;
+    }
+
+    psString query = NULL;              // Query to run
+    psStringAppend(&query, "UPDATE publishRun SET active = %d", active ? 1 : 0);
+
+    if (psListLength(where->list)) {
+        psString clause = psDBGenerateWhereConditionSQL(where, NULL);
+        psStringAppend(&query, "\n AND %s", clause);
+        psFree(clause);
+    }
+    psFree(where);
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "Database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    long numUpdated = psDBAffectedRows(config->dbh);
+    psLogMsg("pubtool", PS_LOG_INFO, "%ld rows updated.", numUpdated);
 
     return true;
