OSSP CVS Repository

ossp - Check-in [3481]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3481
Date: 2003-Jun-30 18:32:53 (local)
2003-Jun-30 16:32:53 (UTC)
User:ms
Branch:
Comment: Bugfix eval mode config handling logic, and implement eval mode common handling logic.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc_proc.c      1.56 -> 1.57     29 inserted, 6 deleted

ossp-pkg/rc/rc_proc.c 1.56 -> 1.57

--- rc_proc.c    2003/06/30 16:25:54     1.56
+++ rc_proc.c    2003/06/30 16:32:53     1.57
@@ -215,13 +215,12 @@
             qsort((void *)ppSectmp, (size_t)pRc->m_pList->m_nFiles, \
                 sizeof(rc_section_t *), priCompare);
             for (nTmp = 0; nTmp < pRc->m_pList->m_nFiles && ppSectmp[nTmp]; nTmp++) {
-                /* Conditionally print config section notice in verbal mode */
                 if (configGetval(RC_VRB_VAL)) {
-                    /* Conditionally print config section notice in verbal mode */
-                    nBytes = (strlen(RC_PRN_TEXT) + strlen(RC_DEF_NCF) + \
+                    /* Conditionally evaluate config section notice in verbal mode */
+                    nBytes = (strlen(RC_EVN_TEXT) + strlen(RC_DEF_NCF) + \
                         strlen(sectionGetparent(ppSectmp[nTmp])) + 2) * sizeof (char);
                     szVerbose = malloc(nBytes);
-                    sprintf(szVerbose, RC_PRN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
+                    sprintf(szVerbose, RC_EVN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
                     strcat(szVerbose, "\n");
                     scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
                     free(szVerbose);
@@ -229,6 +228,30 @@
                 }
                 scriptAdd(pFatscript, pRc->m_pScriptcnf);
 
+                /* Examine our list, and try to take the corresponding */
+                /* common section data from it to add to your script   */
+                {
+                    rc_section_t *pComsec = NULL;
+                    pComsec = rcfileGetsec(listGetrcfile(pRc->m_pList, \
+                        ppSectmp[nTmp]->m_szParent), configGetval(RC_CMN_VAL));
+                    if (pComsec) { /* Do we have a common section to load? */
+                        if (configGetval(RC_VRB_VAL)) {
+                            szTmp = (char *)sectionGetname(pComsec);
+                            nBytes = (strlen(RC_EVN_TEXT) + strlen(szTmp) + \
+                                strlen (sectionGetparent(pComsec)) + \
+                                strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
+                                sizeof (char);
+                            szVerbose = malloc(nBytes);
+                            sprintf(szVerbose, RC_EVN_TEXT, szTmp, sectionGetparent(pComsec));
+                            strcat(szVerbose, "\n");
+                            scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
+                            free(szVerbose);
+                            szVerbose = NULL;
+                        }
+                        scriptAdd(pFatscript, sectionGetscript(pComsec));
+                    }
+                }
+
                 /* Conditionally print each section notice in verbal mode */
                 if (configGetval(RC_VRB_VAL)) {
                     szTmp = (char *)sectionGetname(ppSectmp[nTmp]);
@@ -519,7 +542,7 @@
                     if (pComsec) { /* Do we have a common section to load? */
                         if (configGetval(RC_VRB_VAL)) {
                             szTmp = (char *)sectionGetname(pComsec);
-                            nBytes = (strlen(RC_EXN_TEXT) + strlen(szTmp) + \
+                            nBytes = (strlen(RC_PRN_TEXT) + strlen(szTmp) + \
                                 strlen (sectionGetparent(pComsec)) + \
                                 strlen(RC_ECHO_STR) + strlen("\"\"") + 1) * \
                                 sizeof (char);
@@ -530,7 +553,7 @@
                             free(szVerbose);
                             szVerbose = NULL;
                         }
-                    sectionDump(pComsec);
+                        sectionDump(pComsec);
                     }
                 }
 

CVSTrac 2.0.1