Changeset 39180 in vbox
- Timestamp:
- Nov 2, 2011 8:59:30 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74659
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ExtPackUtil.h
r37843 r39180 90 90 /** The version string. */ 91 91 RTCString strVersion; 92 /** The edition string. */ 93 RTCString strEdition; 92 94 /** The internal revision number. */ 93 95 uint32_t uRevision; … … 120 122 RTCString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cbMax); 121 123 int VBoxExtPackCalcDir(char *pszExtPackDir, size_t cbExtPackDir, const char *pszParentDir, const char *pszName); 122 bool VBoxExtPackIsValidVersionString(const char *pszName); 124 bool VBoxExtPackIsValidVersionString(const char *pszVersion); 125 bool VBoxExtPackIsValidEditionString(const char *pszEdition); 123 126 bool VBoxExtPackIsValidModuleString(const char *pszModule); 124 127 -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r37843 r39180 390 390 if (SUCCEEDED(hrc)) 391 391 { 392 Bstr str(m->Desc.strVersion); 393 str.cloneTo(a_pbstrVersion); 392 /* HACK ALERT: This is for easing backporting to 4.1. The edition stuff 393 will be changed into a separate */ 394 if (m->Desc.strEdition.isEmpty()) 395 { 396 Bstr str(m->Desc.strVersion); 397 str.cloneTo(a_pbstrVersion); 398 } 399 else 400 { 401 RTCString strHack(m->Desc.strVersion); 402 strHack.append('-'); 403 strHack.append(m->Desc.strEdition); 404 405 Bstr str(strHack); 406 str.cloneTo(a_pbstrVersion); 407 } 394 408 } 395 409 return hrc; … … 1610 1624 if (SUCCEEDED(hrc)) 1611 1625 { 1612 Bstr str(m->Desc.strVersion); 1613 str.cloneTo(a_pbstrVersion); 1626 /* HACK ALERT: This is for easing backporting to 4.1. The edition stuff 1627 will be changed into a separate */ 1628 if (m->Desc.strEdition.isEmpty()) 1629 { 1630 Bstr str(m->Desc.strVersion); 1631 str.cloneTo(a_pbstrVersion); 1632 } 1633 else 1634 { 1635 RTCString strHack(m->Desc.strVersion); 1636 strHack.append('-'); 1637 strHack.append(m->Desc.strEdition); 1638 1639 Bstr str(strHack); 1640 str.cloneTo(a_pbstrVersion); 1641 } 1614 1642 } 1615 1643 return hrc; … … 3052 3080 { 3053 3081 if (pExtPackData->fUsable) 3054 LogRel((" %s (Version: %s r%u ; VRDE Module: %s)\n",3082 LogRel((" %s (Version: %s r%u%s%s; VRDE Module: %s)\n", 3055 3083 pExtPackData->Desc.strName.c_str(), 3056 3084 pExtPackData->Desc.strVersion.c_str(), 3057 3085 pExtPackData->Desc.uRevision, 3086 pExtPackData->Desc.strEdition.isEmpty() ? "" : " ", 3087 pExtPackData->Desc.strEdition.c_str(), 3058 3088 pExtPackData->Desc.strVrdeModule.c_str() )); 3059 3089 else 3060 LogRel((" %s (Version: %s r%u ; VRDE Module: %s unusable because of '%s')\n",3090 LogRel((" %s (Version: %s r%u%s%s; VRDE Module: %s unusable because of '%s')\n", 3061 3091 pExtPackData->Desc.strName.c_str(), 3062 3092 pExtPackData->Desc.strVersion.c_str(), 3063 3093 pExtPackData->Desc.uRevision, 3094 pExtPackData->Desc.strEdition.isEmpty() ? "" : " ", 3095 pExtPackData->Desc.strEdition.c_str(), 3064 3096 pExtPackData->Desc.strVrdeModule.c_str(), 3065 3097 pExtPackData->strWhyUnusable.c_str() )); -
trunk/src/VBox/Main/src-all/ExtPackUtil.cpp
r39172 r39180 5 5 6 6 /* 7 * Copyright (C) 2010 Oracle Corporation7 * Copyright (C) 2010-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 70 70 a_pExtPackDesc->strDescription.setNull(); 71 71 a_pExtPackDesc->strVersion.setNull(); 72 a_pExtPackDesc->strEdition.setNull(); 72 73 a_pExtPackDesc->uRevision = 0; 73 74 a_pExtPackDesc->strMainModule.setNull(); … … 146 147 uRevision = 0; 147 148 149 const char *pszEdition; 150 if (!pVersionElm->getAttributeValue("edition", pszEdition)) 151 pszEdition = ""; 152 if (!VBoxExtPackIsValidEditionString(pszEdition)) 153 return &(new RTCString("Invalid edition string: "))->append(pszEdition); 154 148 155 const xml::ElementNode *pMainModuleElm = pVBoxExtPackElm->findChildElement("MainModule"); 149 156 if (!pMainModuleElm) … … 194 201 a_pExtPackDesc->strDescription = pszDesc; 195 202 a_pExtPackDesc->strVersion = pszVersion; 203 a_pExtPackDesc->strEdition = pszEdition; 196 204 a_pExtPackDesc->uRevision = uRevision; 197 205 a_pExtPackDesc->strMainModule = pszMainModule; … … 350 358 a_pExtPackDesc->strDescription.setNull(); 351 359 a_pExtPackDesc->strVersion.setNull(); 360 a_pExtPackDesc->strEdition.setNull(); 352 361 a_pExtPackDesc->uRevision = 0; 353 362 a_pExtPackDesc->strMainModule.setNull(); … … 573 582 if (*pszVersion == '-' || *pszVersion == '_') 574 583 { 584 /** @todo Should probably restrict this to known build types (alpha, 585 * beta, rc, ++). */ 575 586 do 576 587 pszVersion++; … … 581 592 } 582 593 583 /* revision or nothing */ 584 if (*pszVersion != '\0') 585 { 586 if (*pszVersion != 'r') 594 return *pszVersion == '\0'; 595 } 596 597 /** 598 * Validates the extension pack edition string. 599 * 600 * @returns true if valid, false if not. 601 * @param pszEdition The edition string to validate. 602 */ 603 bool VBoxExtPackIsValidEditionString(const char *pszEdition) 604 { 605 if (*pszEdition) 606 { 607 if (!RT_C_IS_UPPER(*pszEdition)) 587 608 return false; 609 588 610 do 589 pszVersion++; 590 while (RT_C_IS_DIGIT(*pszVersion)); 591 } 592 593 /* upper case string indicating the edition */ 594 if (*pszVersion == '-') 595 { 596 do 597 pszVersion++; 598 while (RT_C_IS_UPPER(*pszVersion)); 599 } 600 601 return *pszVersion == '\0'; 611 pszEdition++; 612 while ( RT_C_IS_UPPER(*pszEdition) 613 || RT_C_IS_DIGIT(*pszEdition) 614 || *pszEdition == '-' 615 || *pszEdition == '_'); 616 } 617 return *pszEdition == '\0'; 602 618 } 603 619
Note:
See TracChangeset
for help on using the changeset viewer.