packagefs: system_packages take precedence over non-system packages.
Affects *all* nodes, i.e., both directories and files. It is still possible to override these, but it must be done in another system_package, not just by mounting a package with newer datestamps on the conflicting files. This is the pure version of axeld's proposal 2(d) from #10071. However, as the haiku_secondary packages contain application mime_db entires and are also 'system_package's, it does not fully solve that ticket.
This commit is contained in:
parent
0779294800
commit
abf0c2878a
@ -268,6 +268,10 @@ struct Package::LoaderContentHandler : BPackageContentHandler {
|
||||
break;
|
||||
}
|
||||
|
||||
case B_PACKAGE_INFO_FLAGS:
|
||||
fPackage->SetFlags(value.unsignedInt);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_ARCHITECTURE:
|
||||
if (value.unsignedInt >= B_PACKAGE_ARCHITECTURE_ENUM_COUNT)
|
||||
RETURN_ERROR(B_BAD_VALUE);
|
||||
@ -816,6 +820,7 @@ Package::Package(::Volume* volume, PackagesDirectory* directory, dev_t deviceID,
|
||||
fInstallPath(),
|
||||
fVersionedName(),
|
||||
fVersion(NULL),
|
||||
fFlags(0),
|
||||
fArchitecture(B_PACKAGE_ARCHITECTURE_ENUM_COUNT),
|
||||
fLinkDirectory(NULL),
|
||||
fFD(-1),
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
|
||||
#include <package/hpkg/DataReader.h>
|
||||
#include <package/PackageFlags.h>
|
||||
#include <package/PackageArchitecture.h>
|
||||
|
||||
#include <Referenceable.h>
|
||||
@ -69,6 +70,11 @@ public:
|
||||
::Version* Version() const
|
||||
{ return fVersion; }
|
||||
|
||||
void SetFlags(uint32 flags)
|
||||
{ fFlags = flags; }
|
||||
uint32 Flags() const
|
||||
{ return fFlags; }
|
||||
|
||||
void SetArchitecture(
|
||||
BPackageArchitecture architecture)
|
||||
{ fArchitecture = architecture; }
|
||||
@ -123,6 +129,7 @@ private:
|
||||
String fInstallPath;
|
||||
String fVersionedName;
|
||||
::Version* fVersion;
|
||||
uint32 fFlags;
|
||||
BPackageArchitecture fArchitecture;
|
||||
PackageLinkDirectory* fLinkDirectory;
|
||||
int fFD;
|
||||
|
@ -17,6 +17,7 @@
|
||||
PackageNode::PackageNode(Package* package, mode_t mode)
|
||||
:
|
||||
fPackage(package),
|
||||
fPackageFlags(package != NULL ? package->Flags() : 0),
|
||||
fParent(NULL),
|
||||
fName(),
|
||||
fMode(mode),
|
||||
@ -107,5 +108,13 @@ PackageNode::UnsetIndexCookie(void* attributeCookie)
|
||||
bool
|
||||
PackageNode::operator<(const PackageNode& other) const
|
||||
{
|
||||
const bool isSystemPkg = (fPackageFlags
|
||||
& BPackageKit::B_PACKAGE_FLAG_SYSTEM_PACKAGE) != 0,
|
||||
otherIsSystemPkg = (other.fPackageFlags
|
||||
& BPackageKit::B_PACKAGE_FLAG_SYSTEM_PACKAGE) != 0;
|
||||
if (isSystemPkg && !otherIsSystemPkg)
|
||||
return false;
|
||||
if (!isSystemPkg && otherIsSystemPkg)
|
||||
return true;
|
||||
return fModifiedTime < other.fModifiedTime;
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
|
||||
protected:
|
||||
Package* fPackage;
|
||||
uint32 fPackageFlags;
|
||||
PackageDirectory* fParent;
|
||||
String fName;
|
||||
mode_t fMode;
|
||||
|
Loading…
Reference in New Issue
Block a user