author | Mike Sullivan <Mike.Sullivan@Oracle.COM> |
Thu, 24 Sep 2015 13:58:37 -0700 | |
changeset 4904 | 4f05d46b7e44 |
parent 4739 | fe9f7b631d54 |
permissions | -rw-r--r-- |
4739
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1 |
Fix Bug 16329 - RSiteSearch fails for all search strings |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
2 |
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16329 |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
3 |
|
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
4 |
Change already intergrated upstream. |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
5 |
|
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
6 |
diff --git a/src/library/utils/R/RSiteSearch.R b/src/library/utils/R/RSiteSearch.R |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
7 |
index 4578cb9..9323ddb 100644 |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
8 |
--- a/src/library/utils/R/RSiteSearch.R |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
9 |
+++ b/src/library/utils/R/RSiteSearch.R |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
10 |
@@ -1,7 +1,7 @@ |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
11 |
# File src/library/utils/R/RSiteSearch.R |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
12 |
# Part of the R package, http://www.R-project.org |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
13 |
# |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
14 |
-# Copyright (C) 1995-2012 The R Core Team |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
15 |
+# Copyright (C) 1995-2015 The R Core Team |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
16 |
# |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
17 |
# This program is free software; you can redistribute it and/or modify |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
18 |
# it under the terms of the GNU General Public License as published by |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
19 |
@@ -25,7 +25,7 @@ RSiteSearch <- function(string, |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
20 |
matchesPerPage = 20) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
21 |
{ |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
22 |
string <- paste0("http://search.r-project.org/cgi-bin/namazu.cgi?query=", |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
23 |
- gsub(" ", "+", string)) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
24 |
+ URLencode(gsub(" ", "+", string), reserved = TRUE)) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
25 |
mpp <- paste0("max=", matchesPerPage) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
26 |
format <- paste0("result=", match.arg(format)) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
27 |
|
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
28 |
@@ -47,8 +47,7 @@ RSiteSearch <- function(string, |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
29 |
## we know this is a http:// URL, so encoding should be safe. |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
30 |
## it seems that firefox on Mac OS needs it for {...} |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
31 |
## OTOH, Namazu does not decode in, say, sort=date:late. |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
32 |
- qstring <- paste(URLencode(string, reserved = TRUE), |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
33 |
- mpp, format, sortby, restr, sep = "&") |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
34 |
+ qstring <- paste(string, mpp, format, sortby, restr, sep = "&") |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
35 |
browseURL(qstring) |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
36 |
cat(gettextf("A search query has been submitted to %s", |
fe9f7b631d54
PSARC 2015/216 The R Project for Statistical Computing
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
37 |
"http://search.r-project.org"), "\n", sep = "") |