- Timestamp:
- Jun 2, 2017 6:25:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r67254 r67257 75 75 LocationInfo locInfo; 76 76 i_parseURI(aLocation, locInfo); 77 78 Utf8Str strBasename(locInfo.strPath); 79 strBasename.stripPath().stripSuffix(); 80 if (locInfo.strPath.endsWith(".tar.gz", Utf8Str::CaseSensitive)) 81 strBasename.stripSuffix(); 82 77 83 // create a new virtual system to store in the appliance 78 84 rc = pNewDesc.createObject(); … … 349 355 if (FAILED(rc)) throw rc; 350 356 351 Utf8Str strName = Utf8Str(locInfo.strPath).stripPath().stripSuffix(); 352 if (locInfo.strPath.endsWith(".tar.gz", Utf8Str::CaseSensitive)) 353 strName.stripSuffix(); 354 strTargetImageName = Utf8StrFmt("%s-disk%.3d.vmdk", strName.c_str(), ++pAppliance->m->cDisks); 357 strTargetImageName = Utf8StrFmt("%s-disk%.3d.vmdk", strBasename.c_str(), ++pAppliance->m->cDisks); 355 358 if (strTargetImageName.length() > RTTAR_NAME_MAX) 356 359 throw setError(VBOX_E_NOT_SUPPORTED, … … 443 446 continue; 444 447 445 Utf8Str strName = Utf8Str(locInfo.strPath).stripPath().stripSuffix(); 446 strTargetImageName = Utf8StrFmt("%s-disk%.3d.iso", strName.c_str(), ++pAppliance->m->cDisks); 448 strTargetImageName = Utf8StrFmt("%s-disk%.3d.iso", strBasename.c_str(), ++pAppliance->m->cDisks); 447 449 if (strTargetImageName.length() > RTTAR_NAME_MAX) 448 450 throw setError(VBOX_E_NOT_SUPPORTED, … … 2167 2169 if (cTarballs > 0) 2168 2170 { 2171 2172 strTarballPath.stripFilename().append(RTPATH_SLASH_STR).append(pDiskEntry->strOvf); 2169 2173 const char *pszExt = RTPathSuffix(pDiskEntry->strOvf.c_str()); 2170 pszExt = !pszExt || *pszExt != '.' ? ""2171 : pDiskEntry->type == VirtualSystemDescriptionType_HardDiskImage ? "img" : pszExt + 1;2172 2173 strTarballPath.stripFilename().append(RTPATH_SLASH_STR).append(pDiskEntry->strOvf);2174 if (*pszExt)2175 strTarballPath.stripSuffix().append("_").append(pszExt);2174 if (pszExt && pszExt[0] == '.' && pszExt[1] != '\0') 2175 { 2176 strTarballPath.stripSuffix(); 2177 if (pDiskEntry->type != VirtualSystemDescriptionType_HardDiskImage) 2178 strTarballPath.append("_").append(&pszExt[1]); 2179 } 2176 2180 strTarballPath.append(".tar.gz"); 2177 2181 }
Note:
See TracChangeset
for help on using the changeset viewer.

