Changeset 32965 in vbox
- Timestamp:
- Oct 7, 2010 8:32:29 AM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
-
ApplianceImplImport.cpp (modified) (5 diffs)
-
include/ApplianceImpl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplImport.cpp
r32751 r32965 1030 1030 { 1031 1031 mode = ImportFileNoManifest; 1032 Utf8Str strMfFile = manifestFileName(locInfo.strPath); 1033 if (!locInfo.strPath.endsWith(".ova", Utf8Str::CaseInsensitive)) 1034 { 1035 if (RTPathExists(strMfFile.c_str())) 1036 mode = ImportFileWithManifest; 1037 } 1038 else 1039 { 1040 if (RTTarFileExists(locInfo.strPath.c_str(), RTPathFilename(strMfFile.c_str())) == VINF_SUCCESS) 1041 mode = ImportFileWithManifest; 1042 } 1032 Utf8Str strMfFile = queryManifestFileName(locInfo.strPath); 1033 if (!strMfFile.isEmpty()) 1034 mode = ImportFileWithManifest; 1043 1035 } 1044 1036 else … … 1061 1053 1062 1054 return rc; 1055 } 1056 1057 Utf8Str Appliance::queryManifestFileName(const Utf8Str& aPath) const 1058 { 1059 Utf8Str strMfFile = manifestFileName(aPath); 1060 if (!aPath.endsWith(".ova", Utf8Str::CaseInsensitive)) 1061 { 1062 if (RTPathExists(strMfFile.c_str())) 1063 return strMfFile; 1064 1065 } 1066 else 1067 { 1068 if (RTTarFileExists(aPath.c_str(), RTPathFilename(strMfFile.c_str())) == VINF_SUCCESS) 1069 return strMfFile; 1070 } 1071 return Utf8Str(); 1063 1072 } 1064 1073 … … 1079 1088 HRESULT rc = S_OK; 1080 1089 1081 Utf8Str strManifestFile = manifestFileName(locInfo.strPath);1090 Utf8Str strManifestFile = queryManifestFileName(locInfo.strPath); 1082 1091 if (!strManifestFile.isEmpty()) 1083 1092 { … … 1392 1401 /* Add the manifest file to the list of files to extract, but only if 1393 1402 one is in the archive. */ 1394 Utf8Str strManifestFile = manifestFileName(strTmpOvf); 1395 vrc = RTTarFileExists(pTask->locInfo.strPath.c_str(), RTPathFilename(strManifestFile.c_str())); 1396 if (RT_SUCCESS(vrc)) 1403 Utf8Str strManifestFile = queryManifestFileName(strTmpOvf); 1404 if (!strManifestFile.isEmpty()) 1397 1405 filesList.push_back(pair<Utf8Str, ULONG>(strManifestFile.c_str(), 1)); 1398 1406 … … 2466 2474 Utf8StrFmt strTmpOvf("%s/%s", pszTmpDir, RTPathFilename(tmpPath.c_str())); 2467 2475 /* Now check if there is an manifest file. This is optional. */ 2468 Utf8Str strManifestFile = manifestFileName(strTmpOvf);2476 Utf8Str strManifestFile = queryManifestFileName(strTmpOvf); 2469 2477 char *pszFilename = RTPathFilename(strManifestFile.c_str()); 2470 2478 if (!pTask->pProgress.isNull()) -
trunk/src/VBox/Main/include/ApplianceImpl.h
r32837 r32965 133 133 void parseBucket(Utf8Str &aPath, Utf8Str &aBucket); 134 134 Utf8Str manifestFileName(const Utf8Str& aPath) const; 135 Utf8Str queryManifestFileName(const Utf8Str& aPath) const; 135 136 136 137 HRESULT readImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
Note:
See TracChangeset
for help on using the changeset viewer.

