Permalink
Browse files

Make sure pkg is a package object

  • Loading branch information...
1 parent e898771 commit e4aca48e5a658e0dce4797c25420e189edb93c5c @wch wch committed Sep 19, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 R/namespace-env.r
View
@@ -72,6 +72,7 @@ makeNamespace <- function(name, version = NULL, lib = NULL) {
# Read the NAMESPACE file and set up the imports metdata.
# (which is stored in .__NAMESPACE__.)
setup_ns_imports <- function(pkg = ".") {
+ pkg <- as.package(pkg)
nsInfo <- parse_ns_file(pkg)
setNamespaceInfo(pkg$package, "imports", nsInfo$imports)
}
@@ -81,6 +82,7 @@ setup_ns_imports <- function(pkg = ".") {
# run after all the objects are loaded into the namespace because
# namespaceExport throw errors if the objects are not present.
setup_ns_exports <- function(pkg = ".", export_all = FALSE) {
+ pkg <- as.package(pkg)
nsInfo <- parse_ns_file(pkg)
nsenv <- ns_env(pkg)

0 comments on commit e4aca48

Please sign in to comment.