Skip to content

Commit

Permalink
rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Jul 7, 2020
1 parent 1bd52bd commit ad4d1b6
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: PackageManager
Package: bspm
Type: Package
Title: R Bridge to System Package Manager
Version: 0.3.0
Expand All @@ -14,7 +14,7 @@ Encoding: UTF-8
OS_type: unix
SystemRequirements: systemd, python3-dbus, python3-gobject,
python bindings for your distro's package manager
URL: https://github.com/Enchufa2/PackageManager
BugReports: https://github.com/Enchufa2/PackageManager/issues
URL: https://github.com/Enchufa2/bspm
BugReports: https://github.com/Enchufa2/bspm/issues
RoxygenNote: 7.1.1
Roxygen: list(old_usage = TRUE)
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PackageManager 0.3.0
# bspm 0.3.0

- New package title, as suggested by @eddelbuettel; improved description.
- New package name, as suggested by @eddelbuettel; improved title & description.
- Allow root user to talk directly to the system package manager, without D-Bus.

# PackageManager 0.2.1
Expand Down
4 changes: 2 additions & 2 deletions R/integration.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Enable/Disable Package Manager
#' Enable/Disable Bridge to System Package Manager
#'
#' Functions to enable or disable the integration of \code{\link{install_sys}}
#' into \code{\link{install.packages}}. When enabled, packages are installed
#' transparently from system repositories if available, and from CRAN if not.
#'
#' @export
enable <- function() {
expr <- quote(if (!is.null(repos)) pkgs <- PackageManager::install_sys(pkgs))
expr <- quote(if (!is.null(repos)) pkgs <- bspm::install_sys(pkgs))
trace(utils::install.packages, expr, print=FALSE)
invisible()
}
Expand Down
8 changes: 4 additions & 4 deletions R/manager.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
utils::globalVariables(c("BUS_NAME", "OPATH", "IFACE"))

dbus_call <- function(cmd, pkgs) {
source(system.file("service/dbus-paths", package="PackageManager"))
source(system.file("service/dbus-paths", package="bspm"))

args <- c("list", "--no-pager")
out <- suppressWarnings(system2("busctl", args, stdout=TRUE, stderr=TRUE))
if (!any(grepl(BUS_NAME, out)))
stop("PackageManager service not found")
stop("bspm service not found")

args <- c("call", "--timeout=1h", BUS_NAME, OPATH, IFACE,
cmd, "ias", Sys.getpid(), length(pkgs), pkgs)
Expand All @@ -31,7 +31,7 @@ backend_call <- function(cmd, pkgs) {
tmp <- tempfile()
on.exit(unlink(tmp))

mgr <- system.file("service/PackageManager.py", package="PackageManager")
mgr <- system.file("service/bspm.py", package="bspm")
args <- c(if (cmd == "remove") "-r", "-o", tmp, "-u", pkgs)
system2(mgr, args, stderr=FALSE)

Expand All @@ -43,7 +43,7 @@ backend_call <- function(cmd, pkgs) {
#' Talk to the system package manager to download and install or remove
#' packages from system repositories.
#'
#' @param pkgs character vector of CRAN names of packages.
#' @param pkgs character vector of names of packages.
#' @return Invisibly, a character vector of the names of packages not available.
#'
#' @details The root user talks directly to the system package manager.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# R Bridge to System Package Manager
# bspm: R Bridge to System Package Manager

Enables binary package installations on Linux distributions
without administrative privileges. Provides functions to manage packages
Expand All @@ -22,7 +22,7 @@ If you plan to run it as a regular user (non-root), these are required too:
Then, if e.g. your distro's R packages are called "r-cran-[pkgname]",

```bash
sudo R CMD INSTALL PackageManager \
sudo R CMD INSTALL bspm \
--configure-vars="SYSCONF_DIR=/etc" \
--configure-vars="DATA_DIR=/usr/share" \
--configure-vars="PKG_PREFIX=r-cran-"
Expand All @@ -34,7 +34,7 @@ don't need the D-Bus service, so only `PKG_PREFIX` is required above.
To enable it by default, put the following into the `Rprofile.site`:

```r
suppressMessages(PackageManager::enable())
suppressMessages(bspm::enable())
```

Then, run `install.packages` as usual, and available system packages will be
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cleanup
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

rm -f inst/service/PackageManager.conf
rm -f inst/service/bspm.conf
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -z "$PKG_PREFIX" ]; then
echo "Error: PKG_PREFIX required"
exit 1
fi
echo "PREFIX='$PKG_PREFIX'" >> inst/service/PackageManager.conf
echo "PREFIX='$PKG_PREFIX'" >> inst/service/bspm.conf

if [ -z "$DATA_DIR" ] || [ -z "$SYSCONF_DIR" ]; then
echo "Warning: DATA_DIR and SYSCONF_DIR required to install the D-BUS service"
Expand Down
2 changes: 1 addition & 1 deletion inst/service/PackageManager.py → inst/service/bspm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from os.path import realpath, dirname
path = dirname(realpath(__file__))
exec(open(path + "/dbus-paths").read())
exec(open(path + "/PackageManager.conf").read())
exec(open(path + "/bspm.conf").read())

import argparse

Expand Down
2 changes: 1 addition & 1 deletion inst/service/dbus.service.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=@BUS_NAME@
Exec=@R_LIBRARY_DIR@/PackageManager/service/PackageManager.py
Exec=@R_LIBRARY_DIR@/bspm/service/bspm.py
User=root
2 changes: 1 addition & 1 deletion man/enable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/install_sys.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad4d1b6

Please sign in to comment.