Add support for bottle pkg manager
This commit is contained in:
parent
82810b6051
commit
a576c6263a
9
backends/alpm/bottle.conf
Normal file
9
backends/alpm/bottle.conf
Normal file
@ -0,0 +1,9 @@
|
||||
[options]
|
||||
|
||||
# Use default bottle configuration initially
|
||||
#
|
||||
Include = /etc/bottle.conf
|
||||
|
||||
# Prevent PackageKit from removing itself
|
||||
#
|
||||
HoldPkg = packagekit
|
@ -34,10 +34,10 @@ shared_module(
|
||||
c_args: [
|
||||
'-DPK_LOG_PREFIX="PACKAGEKIT"',
|
||||
'-DG_LOG_DOMAIN="PackageKit-alpm"',
|
||||
'-DPK_BACKEND_CONFIG_FILE="@0@"'.format(join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d', 'pacman.conf')),
|
||||
'-DPK_BACKEND_CONFIG_FILE="@0@"'.format(join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d', 'bottle.conf')),
|
||||
'-DPK_BACKEND_GROUP_FILE="@0@"'.format(join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d', 'groups.list')),
|
||||
'-DPK_BACKEND_REPO_FILE="@0@"'.format(join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d', 'repos.list')),
|
||||
'-DPK_BACKEND_DEFAULT_PATH="/bin:/usr/bin:/sbin:/usr/sbin"',
|
||||
'-DPK_BACKEND_DEFAULT_PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"',
|
||||
],
|
||||
install: true,
|
||||
install_dir: pk_plugin_dir,
|
||||
@ -50,7 +50,7 @@ install_data(
|
||||
|
||||
install_data(
|
||||
'groups.list',
|
||||
'pacman.conf',
|
||||
'bottle.conf',
|
||||
'repos.list',
|
||||
install_dir: join_paths(get_option('sysconfdir'), 'PackageKit', 'alpm.d')
|
||||
)
|
||||
|
@ -1,12 +0,0 @@
|
||||
# PackageKit configuration for the alpm backend
|
||||
# See the pacman.conf(5) manpage for option and repository directives.
|
||||
|
||||
[options]
|
||||
|
||||
# Use default pacman configuration initially
|
||||
#
|
||||
Include = /etc/pacman.conf
|
||||
|
||||
# Prevent PackageKit from removing itself
|
||||
#
|
||||
HoldPkg = packagekit
|
@ -651,7 +651,7 @@ pk_alpm_config_initialize_alpm (PkAlpmConfig *config, GError **error)
|
||||
|
||||
if (config->dbpath == NULL) {
|
||||
config->dbpath = g_strconcat (config->root,
|
||||
"/var/lib/pacman/" + dir,
|
||||
"/var/lib/bottle/" + dir,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -676,7 +676,7 @@ pk_alpm_config_initialize_alpm (PkAlpmConfig *config, GError **error)
|
||||
|
||||
if (config->gpgdir == NULL) {
|
||||
config->gpgdir = g_strconcat (config->root,
|
||||
"/etc/pacman.d/gnupg/" + dir,
|
||||
"/etc/bottle.d/gnupg/" + dir,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -689,14 +689,14 @@ pk_alpm_config_initialize_alpm (PkAlpmConfig *config, GError **error)
|
||||
|
||||
if (config->logfile == NULL) {
|
||||
config->logfile = g_strconcat (config->root,
|
||||
"/var/log/pacman.log" + dir,
|
||||
"/var/log/bottle.log" + dir,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (config->is_check) {
|
||||
g_free(config->logfile);
|
||||
config->logfile = g_strconcat (config->root,
|
||||
"/var/log/pacman.PackageKit.log" + dir,
|
||||
"/var/log/bottle.PackageKit.log" + dir,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -709,7 +709,7 @@ pk_alpm_config_initialize_alpm (PkAlpmConfig *config, GError **error)
|
||||
|
||||
if (config->cachedirs == NULL) {
|
||||
gchar *path = g_strconcat (config->root,
|
||||
"/var/cache/pacman/pkg/" + dir,
|
||||
"/var/cache/bottle/pkg/" + dir,
|
||||
NULL);
|
||||
config->cachedirs = alpm_list_add (NULL, path);
|
||||
}
|
||||
|
@ -71,10 +71,12 @@ static gchar **
|
||||
pk_alpm_pkg_build_urls (alpm_pkg_t *pkg)
|
||||
{
|
||||
gchar **urls = g_new0 (gchar *, 2);
|
||||
urls[0] = g_strdup_printf ("https://archlinux.org/packages/%s/%s/%s/",
|
||||
alpm_db_get_name (alpm_pkg_get_db (pkg)),
|
||||
alpm_pkg_get_arch (pkg),
|
||||
alpm_pkg_get_name (pkg));
|
||||
|
||||
urls[0] = g_strdup_printf ("https://files.martinvlba.eu/evolinx-staging/%s/packages/%s-%s-%s.pkg.tar.gz",
|
||||
alpm_db_get_name (alpm_pkg_get_db (pkg)),
|
||||
alpm_pkg_get_name (pkg),
|
||||
alpm_pkg_get_arch (pkg));
|
||||
|
||||
return urls;
|
||||
}
|
||||
|
||||
@ -399,13 +401,13 @@ pk_alpm_update_is_pkg_downloaded (alpm_pkg_t *pkg)
|
||||
{
|
||||
g_autofree gchar *filename = NULL;
|
||||
|
||||
filename = g_strconcat ("/var/cache/pacman/pkg/",
|
||||
filename = g_strconcat ("/var/cache/bottle/pkg/",
|
||||
alpm_pkg_get_name (pkg),
|
||||
"-",
|
||||
alpm_pkg_get_version (pkg),
|
||||
"-",
|
||||
alpm_pkg_get_arch (pkg),
|
||||
".pkg.tar.xz",
|
||||
".pkg.tar.gz",
|
||||
NULL);
|
||||
return g_file_test (filename, G_FILE_TEST_IS_REGULAR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user