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...
This commit is contained in:
Stephan Aßmus
2014-02-20 23:47:39 +01:00
parent 4ccc40a15c
commit 0aa2c1fca3
3 changed files with 14 additions and 5 deletions
+10 -1
View File
@@ -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
+3 -3
View File
@@ -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)
{
+1 -1
View File
@@ -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,