View | Details | Raw Unified | Return to bug 16490 | Differences between
and this patch

Collapse All | Expand All

(-)src/library/base/R/attach.R (-4 / +3 lines)
Lines 66-73 Link Here
66
            if (any(obj.same > 0L)) {
66
            if (any(obj.same > 0L)) {
67
                same <- ob[obj.same]
67
                same <- ob[obj.same]
68
                same <- same[!(same %in% dont.mind)]
68
                same <- same[!(same %in% dont.mind)]
69
                Classobjs <- grep("^\\.__", same)
69
                same <- same[ substr(same, 1L, 3L) != ".__" ]
70
                if(length(Classobjs)) same <- same[-Classobjs]
71
                ## report only objects which are both functions or
70
                ## report only objects which are both functions or
72
                ## both non-functions.
71
                ## both non-functions.
73
		same.isFn <- function(where)
72
		same.isFn <- function(where)
Lines 125-137 Link Here
125
124
126
    ## we need to treat packages differently from other objects, so get those
125
    ## we need to treat packages differently from other objects, so get those
127
    ## out of the way now
126
    ## out of the way now
128
    if (! grepl("^package:", packageName) )
127
    if (substr(packageName, 1L, 8L) != "package:")
129
        return(invisible(.Internal(detach(pos))))
128
        return(invisible(.Internal(detach(pos))))
130
129
131
    ## From here down we are detaching a package.
130
    ## From here down we are detaching a package.
132
    pkgname <- .rmpkg(packageName)
131
    pkgname <- .rmpkg(packageName)
133
    for(pkg in search()[-1L]) {
132
    for(pkg in search()[-1L]) {
134
        if(grepl("^package:", pkg) &&
133
        if(substr(pkg, 1L, 8L) == "package:" &&
135
           exists(".Depends", pkg, inherits = FALSE) &&
134
           exists(".Depends", pkg, inherits = FALSE) &&
136
           pkgname %in% get(".Depends", pkg, inherits = FALSE))
135
           pkgname %in% get(".Depends", pkg, inherits = FALSE))
137
            if(force)
136
            if(force)
(-)src/library/base/R/library.R (-3 / +2 lines)
Lines 160-166 Link Here
160
        else {
160
        else {
161
            ## A package will have created a generic
161
            ## A package will have created a generic
162
            ## only if it has created a formal method.
162
            ## only if it has created a formal method.
163
            length(grep(pattern="^\\.__T", names(env))) == 0L
163
            all( substr(names(env), 1L, 4L) != ".__T" )
164
        }
164
        }
165
    }
165
    }
166
166
Lines 194-201 Link Here
194
            if (any(obj.same > 0)) {
194
            if (any(obj.same > 0)) {
195
                same <- ob[obj.same]
195
                same <- ob[obj.same]
196
                same <- same[!(same %in% dont.mind)]
196
                same <- same[!(same %in% dont.mind)]
197
                Classobjs <- grep("^\\.__", same)
197
                same <- same[ substr(same, 1L, 3L) != ".__" ]
198
                if(length(Classobjs)) same <- same[-Classobjs]
199
                ## report only objects which are both functions or
198
                ## report only objects which are both functions or
200
                ## both non-functions.
199
                ## both non-functions.
201
		same.isFn <- function(where)
200
		same.isFn <- function(where)
(-)src/library/base/R/namespace.R (-2 / +2 lines)
Lines 973-980 Link Here
973
        miss <- expnames[!eie]
973
        miss <- expnames[!eie]
974
        ## if called (indirectly) for namespaceImportClasses
974
        ## if called (indirectly) for namespaceImportClasses
975
        ## these are all classes
975
        ## these are all classes
976
        if(all(grepl("^\\.__C__", miss))) {
976
        if(all(substr(miss, 1L, 6L) == ".__C__")) {
977
            miss <- sub("^\\.__C__", "", miss)
977
            miss <- substr(miss, 7L, nchar(miss))
978
            stop(sprintf(ngettext(length(miss),
978
            stop(sprintf(ngettext(length(miss),
979
                                  "class %s is not exported by 'namespace:%s'",
979
                                  "class %s is not exported by 'namespace:%s'",
980
                                  "classes %s are not exported by 'namespace:%s'"),
980
                                  "classes %s are not exported by 'namespace:%s'"),

Return to bug 16490