From 0cbc7e3f8f95b958304b0a86c9b9a1f7d1e4ec86 Mon Sep 17 00:00:00 2001
From: Puck Meerburg <puck@puckipedia.nl>
Date: Mon, 27 Jan 2014 19:08:06 +0000
Subject: [PATCH] PackageInstaller: Dynamically replace /boot/system with the
system non-packaged dir, same with ~/config
---
src/apps/packageinstaller/PackageItem.cpp | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/apps/packageinstaller/PackageItem.cpp b/src/apps/packageinstaller/PackageItem.cpp
index 2b5d53f..6959eb9 100644
a
|
b
|
|
15 | 15 | #include <ByteOrder.h> |
16 | 16 | #include <Catalog.h> |
17 | 17 | #include <Directory.h> |
| 18 | #include <FindDirectory.h> |
18 | 19 | #include <fs_info.h> |
19 | 20 | #include <Locale.h> |
20 | 21 | #include <NodeInfo.h> |
… |
… |
PackageItem::InitPath(const char *path, BPath *destination)
|
204 | 205 | ret = destination->SetTo(mountPoint.Path(), fPath.String()); |
205 | 206 | } |
206 | 207 | |
| 208 | BPath systemNonPackagedDir; |
| 209 | find_directory(B_SYSTEM_NONPACKAGED_DIRECTORY, &systemNonPackagedDir); |
| 210 | |
| 211 | BString pathString(destination->Path()); |
| 212 | |
| 213 | // Hardcoded paths, the .pkg files hardcode this to the same |
| 214 | if (pathString.FindFirst("/boot/system") == 0 && pathString.FindFirst("non-packaged") == B_ERROR) { |
| 215 | pathString.Replace("/boot/system", systemNonPackagedDir.Path(), 1); |
| 216 | } |
| 217 | |
| 218 | if (pathString.FindFirst("/config") == 0 && pathString.FindFirst("non-packaged") == B_ERROR) { |
| 219 | pathString.Replace("/config", "/config/non-packaged", 1); |
| 220 | } |
| 221 | |
| 222 | destination->SetTo(pathString.String()); |
| 223 | |
207 | 224 | return ret; |
208 | 225 | } |
209 | 226 | |