%{_unitdir}/pkgdir-tool.service
%{_bindir}/pkg_initdb
%attr(0755,root,root) %{_sysconfdir}/gumd/useradd.d/10_package-manager-add.post
+%attr(0755,root,root) %{_sysconfdir}/gumd/userdel.d/11_package-manager-del.post
%license LICENSE
%files devel
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/bin
+
+mkdir -p -Z User::Home -m 755 /opt/dbspace/user
+
+export `tzplatform-get --user $2 TZ_USER_NAME`
+
+mkdir -p -Z User::Home -m 770 /opt/dbspace/user/$2
+chown $TZ_USER_NAME:system_share /opt/dbspace/user/$2
+
pkg_initdb --uid $2
}
void RemoveOldDatabases(uid_t uid) {
- if (!IsGlobal(uid))
- tzplatform_set_user(uid);
+ char *parser_db = getUserPkgParserDBPathUID(uid);
+ char *cert_db = getUserPkgCertDBPathUID(uid);
+ std::string journal = "-journal";
+ std::string parser_db_journal = parser_db + journal;
+ std::string cert_db_journal = cert_db + journal;
bs::error_code error;
- bf::path info_db_path(tzplatform_mkpath(
- IsGlobal(uid) ? TZ_SYS_DB : TZ_USER_DB, ".pkgmgr_parser.db"));
- bf::path info_db_journal_path(tzplatform_mkpath(
- IsGlobal(uid) ? TZ_SYS_DB : TZ_USER_DB, ".pkgmgr_parser.db-journal"));
- bf::path cert_db_path(tzplatform_mkpath(
- IsGlobal(uid) ? TZ_SYS_DB : TZ_USER_DB, ".pkgmgr_cert.db"));
- bf::path cert_db_journal_path(tzplatform_mkpath(
- IsGlobal(uid) ? TZ_SYS_DB : TZ_USER_DB, ".pkgmgr_cert.db-journal"));
+ bf::path info_db_path(parser_db);
+ bf::path info_db_journal_path(parser_db_journal.c_str());
+ bf::path cert_db_path(cert_db);
+ bf::path cert_db_journal_path(cert_db_journal.c_str());
bf::remove(info_db_path, error);
if (error)
if (error)
std::cerr << cert_db_journal_path << " is not removed" << std::endl;
- tzplatform_reset_user();
+ free(cert_db);
+ free(parser_db);
}
} // namespace