hrev46898 adds 1 changeset to branch 'master' old head: 4ccc40a15c5c250fbd5ddbefcfff5b651b102825 new head: 0aa2c1fca32969f649714d2bf93bfc6ef91926a0 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=0aa2c1f+%5E4ccc40a ---------------------------------------------------------------------------- 0aa2c1f: PackageInstaller: Fixed more problems with working directories I've encountered three different ways of specifying the working directory for install scripts: Relative to target folder, relative to install folder and absolute. At least those three now work... [ Stephan Aßmus <superstippi@xxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev46898 Commit: 0aa2c1fca32969f649714d2bf93bfc6ef91926a0 URL: http://cgit.haiku-os.org/haiku/commit/?id=0aa2c1f Author: Stephan Aßmus <superstippi@xxxxxx> Date: Thu Feb 20 22:44:39 2014 UTC ---------------------------------------------------------------------------- 3 files changed, 14 insertions(+), 5 deletions(-) src/apps/packageinstaller/PackageInfo.cpp | 11 ++++++++++- src/apps/packageinstaller/PackageItem.cpp | 6 +++--- src/apps/packageinstaller/PackageItem.h | 2 +- ---------------------------------------------------------------------------- diff --git a/src/apps/packageinstaller/PackageInfo.cpp b/src/apps/packageinstaller/PackageInfo.cpp index 85668be..6f3fd11 100644 --- a/src/apps/packageinstaller/PackageInfo.cpp +++ b/src/apps/packageinstaller/PackageInfo.cpp @@ -1027,8 +1027,17 @@ PackageInfo::Parse() parser_debug("Adding the script %s!\n", nameString.String()); + BString workingDirectory; + uint8 localType = P_SYSTEM_PATH; + if (path == 1) + workingDirectory << itemPath; + else if (path == 0xffffffff) { + workingDirectory << installDirectory; + localType = P_INSTALL_PATH; + } + fScripts.AddItem(new PackageScript(fPackageFile, - installDirectory, offset, size, originalSize)); + workingDirectory, localType, offset, size, originalSize)); } else { // If the directory tree count is equal to zero, this means all // directory trees have been closed and a padding sequence means the diff --git a/src/apps/packageinstaller/PackageItem.cpp b/src/apps/packageinstaller/PackageItem.cpp index 9fa3640..05abbf6 100644 --- a/src/apps/packageinstaller/PackageItem.cpp +++ b/src/apps/packageinstaller/PackageItem.cpp @@ -526,10 +526,10 @@ PackageItem::ParseData(uint8* buffer, BFile* file, uint64 originalSize, // #pragma mark - PackageScript -PackageScript::PackageScript(BFile* parent, const BString& path, uint64 offset, - uint64 size, uint64 originalSize) +PackageScript::PackageScript(BFile* parent, const BString& path, uint8 type, + uint64 offset, uint64 size, uint64 originalSize) : - PackageItem(parent, path, P_INSTALL_PATH, 0, 0, offset, size), + PackageItem(parent, path, type, 0, 0, offset, size), fOriginalSize(originalSize), fThreadId(-1) { diff --git a/src/apps/packageinstaller/PackageItem.h b/src/apps/packageinstaller/PackageItem.h index 9e66b15..24b609a 100644 --- a/src/apps/packageinstaller/PackageItem.h +++ b/src/apps/packageinstaller/PackageItem.h @@ -129,7 +129,7 @@ public: class PackageScript : public PackageItem { public: PackageScript(BFile* parent, const BString& path, - uint64 offset = 0, uint64 size = 0, + uint8 type, uint64 offset = 0, uint64 size = 0, uint64 originalSize = 0); virtual status_t DoInstall(const char* path = NULL,