BPackageInfoContentHandler: Handle new attributes
Also add respective *Data constructors to BUser, BUserSettingsFileInfo, and BGlobalSettingsFileInfo.
This commit is contained in:
@@ -13,9 +13,17 @@
|
|||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
|
|
||||||
|
namespace BHPKG {
|
||||||
|
struct BGlobalSettingsFileInfoData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class BGlobalSettingsFileInfo {
|
class BGlobalSettingsFileInfo {
|
||||||
public:
|
public:
|
||||||
BGlobalSettingsFileInfo();
|
BGlobalSettingsFileInfo();
|
||||||
|
BGlobalSettingsFileInfo(
|
||||||
|
const BHPKG::BGlobalSettingsFileInfoData&
|
||||||
|
infoData);
|
||||||
BGlobalSettingsFileInfo(const BString& path,
|
BGlobalSettingsFileInfo(const BString& path,
|
||||||
BSettingsFileUpdateType updateType);
|
BSettingsFileUpdateType updateType);
|
||||||
~BGlobalSettingsFileInfo();
|
~BGlobalSettingsFileInfo();
|
||||||
|
|||||||
@@ -13,9 +13,15 @@
|
|||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
|
|
||||||
|
namespace BHPKG {
|
||||||
|
struct BUserData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class BUser {
|
class BUser {
|
||||||
public:
|
public:
|
||||||
BUser();
|
BUser();
|
||||||
|
BUser(const BHPKG::BUserData& userData);
|
||||||
BUser(const BString& name,
|
BUser(const BString& name,
|
||||||
const BString& realName,
|
const BString& realName,
|
||||||
const BString& home, const BString& shell,
|
const BString& home, const BString& shell,
|
||||||
|
|||||||
@@ -12,9 +12,17 @@
|
|||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
|
|
||||||
|
namespace BHPKG {
|
||||||
|
struct BUserSettingsFileInfoData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class BUserSettingsFileInfo {
|
class BUserSettingsFileInfo {
|
||||||
public:
|
public:
|
||||||
BUserSettingsFileInfo();
|
BUserSettingsFileInfo();
|
||||||
|
BUserSettingsFileInfo(
|
||||||
|
const BHPKG::BUserSettingsFileInfoData&
|
||||||
|
infoData);
|
||||||
BUserSettingsFileInfo(const BString& path,
|
BUserSettingsFileInfo(const BString& path,
|
||||||
const BString& templatePath = BString());
|
const BString& templatePath = BString());
|
||||||
~BUserSettingsFileInfo();
|
~BUserSettingsFileInfo();
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <package/GlobalSettingsFileInfo.h>
|
#include <package/GlobalSettingsFileInfo.h>
|
||||||
|
|
||||||
|
#include <package/hpkg/PackageInfoAttributeValue.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
@@ -18,6 +20,15 @@ BGlobalSettingsFileInfo::BGlobalSettingsFileInfo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BGlobalSettingsFileInfo::BGlobalSettingsFileInfo(
|
||||||
|
const BHPKG::BGlobalSettingsFileInfoData& infoData)
|
||||||
|
:
|
||||||
|
fPath(infoData.path),
|
||||||
|
fUpdateType(infoData.updateType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BGlobalSettingsFileInfo::BGlobalSettingsFileInfo(const BString& path,
|
BGlobalSettingsFileInfo::BGlobalSettingsFileInfo(const BString& path,
|
||||||
BSettingsFileUpdateType updateType)
|
BSettingsFileUpdateType updateType)
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Ingo Weinhold, [email protected].
|
* Copyright 2011-2013, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -139,6 +139,31 @@ BPackageInfoContentHandler::HandlePackageAttribute(
|
|||||||
fPackageInfo.SetInstallPath(value.string);
|
fPackageInfo.SetInstallPath(value.string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_BASE_PACKAGE:
|
||||||
|
fPackageInfo.SetBasePackage(value.string);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_GLOBAL_SETTINGS_FILES:
|
||||||
|
fPackageInfo.AddGlobalSettingsFileInfo(
|
||||||
|
value.globalSettingsFileInfo);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_USER_SETTINGS_FILES:
|
||||||
|
fPackageInfo.AddUserSettingsFileInfo(value.userSettingsFileInfo);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_USERS:
|
||||||
|
fPackageInfo.AddUser(value.user);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_GROUPS:
|
||||||
|
fPackageInfo.AddGroup(value.string);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_PACKAGE_INFO_POST_INSTALL_SCRIPTS:
|
||||||
|
fPackageInfo.AddPostInstallScript(value.string);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (fErrorOutput != NULL) {
|
if (fErrorOutput != NULL) {
|
||||||
fErrorOutput->PrintError(
|
fErrorOutput->PrintError(
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <package/hpkg/PackageInfoAttributeValue.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
@@ -23,6 +25,19 @@ BUser::BUser()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BUser::BUser(const BHPKG::BUserData& userData)
|
||||||
|
:
|
||||||
|
fName(userData.name),
|
||||||
|
fRealName(userData.realName),
|
||||||
|
fHome(userData.home),
|
||||||
|
fShell(userData.shell),
|
||||||
|
fGroups()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < userData.groupCount; i++)
|
||||||
|
fGroups.Add(userData.groups[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BUser::BUser(const BString& name, const BString& realName, const BString& home,
|
BUser::BUser(const BString& name, const BString& realName, const BString& home,
|
||||||
const BString& shell, const BStringList& groups)
|
const BString& shell, const BStringList& groups)
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <package/UserSettingsFileInfo.h>
|
#include <package/UserSettingsFileInfo.h>
|
||||||
|
|
||||||
|
#include <package/hpkg/PackageInfoAttributeValue.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BPackageKit {
|
namespace BPackageKit {
|
||||||
|
|
||||||
@@ -18,6 +20,15 @@ BUserSettingsFileInfo::BUserSettingsFileInfo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BUserSettingsFileInfo::BUserSettingsFileInfo(
|
||||||
|
const BHPKG::BUserSettingsFileInfoData& infoData)
|
||||||
|
:
|
||||||
|
fPath(infoData.path),
|
||||||
|
fTemplatePath(infoData.templatePath)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
|
BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
|
||||||
const BString& templatePath)
|
const BString& templatePath)
|
||||||
:
|
:
|
||||||
|
|||||||
Reference in New Issue
Block a user