-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix HTTP(S) git repo installation #603
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Hsiao-nan Cheung <niheaven@gmail.com>
Signed-off-by: Hsiao-nan Cheung <niheaven@gmail.com>
Signed-off-by: Hsiao-nan Cheung <niheaven@gmail.com>
devtools::test(pkg = "E:/Projects/Repos/remotes", filter = "install-github")
#> i<U+00A0>Loading remotes
#> i<U+00A0>Testing remotes
#> √ | OK F W S | Context
#> √ | 26 | Install from GitHub [170.5 s]
#>
#> == Results =====================================================================
#> Duration: 170.6 s
#>
#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 26 ] Session info: devtools::session_info()
#> - Session info ---------------------------------------------------------------
#> setting value
#> version R version 4.0.5 (2021-03-31)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate Chinese (Simplified)_China.936
#> ctype Chinese (Simplified)_China.936
#> tz Asia/Taipei
#> date 2021-04-23
#>
#> - Packages -------------------------------------------------------------------
#> package * version date lib source
#> backports 1.2.1 2020-12-09 [1] CRAN (R 4.0.3)
#> cachem 1.0.4.9000 2021-03-13 [1] local
#> callr 3.7.0.9000 2021-04-20 [1] local
#> cli 2.4.0.9000 2021-04-05 [1] local
#> crayon 1.4.1.9000 2021-03-13 [1] local
#> desc 1.3.0.9000 2021-03-13 [1] local
#> devtools 2.4.0.9000 2021-04-19 [1] local
#> digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.3)
#> ellipsis 0.3.1.9000 2021-03-20 [1] local
#> evaluate 0.14.1 2021-03-13 [1] local
#> fansi 0.4.2 2021-01-15 [1] CRAN (R 4.0.3)
#> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.3)
#> fs 1.5.0.9000 2021-03-23 [1] local
#> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
#> highr 0.9 2021-04-16 [1] CRAN (R 4.0.5)
#> htmltools 0.5.1.9002 2021-04-21 [1] local
#> knitr 1.32 2021-04-14 [1] CRAN (R 4.0.5)
#> lifecycle 1.0.0.9000 2021-03-23 [1] local
#> magrittr 2.0.1.9000 2021-03-25 [1] local
#> memoise 2.0.0.9000 2021-03-16 [1] local
#> pillar 1.6.0.9001 2021-04-18 [1] local
#> pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.0.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2)
#> pkgload 1.2.1.9000 2021-04-06 [1] local
#> prettyunits 1.1.1.9000 2021-03-19 [1] local
#> processx 3.5.1.9000 2021-04-11 [1] local
#> ps 1.6.0.9000 2021-03-13 [1] local
#> purrr 0.3.4.9000 2021-03-23 [1] local
#> R6 2.5.0.9000 2021-03-13 [1] local
#> remotes 2.3.0.9000 2021-04-22 [1] local
#> reprex 1.0.0.9002 2021-03-15 [1] local
#> rlang 0.4.10.9002 2021-04-21 [1] local
#> rmarkdown 2.7.4 2021-03-24 [1] local
#> rprojroot 2.0.2.9000 2021-03-18 [1] local
#> sessioninfo 1.1.1.9000 2021-03-14 [1] local
#> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.2)
#> stringr 1.4.0.9000 2021-03-20 [1] local
#> styler 1.4.1.9000 2021-04-16 [1] local
#> testthat 3.0.2.9000 2021-03-16 [1] local
#> tibble 3.1.1.9000 2021-04-18 [1] local
#> usethis 2.0.1.9000 2021-04-19 [1] local
#> utf8 1.2.1 2021-03-12 [1] CRAN (R 4.0.4)
#> vctrs 0.3.7.9000 2021-03-30 [1] local
#> withr 2.4.2 2021-04-16 [1] local
#> xfun 0.22 2021-03-11 [1] CRAN (R 4.0.4)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.2)
#>
#> [1] E:/Documents/R/win-library/4.0
#> [2] D:/Scoop/apps/r/4.0.5/library |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now for git repo,
remotes
usegit archive
to getDESCRIPTION
file and package name (remote_package_name.git2r_remote
andremote_package_name.xgit_remote
). But for HTTP(S) protocol,git archive
just sayfatal: operation not supported by protocol
and cannot work.This lead to some problem when users use HTTP(S) protocol with any git server, e.g. GitHub.com or private hosted server (Gogs, Gitea, etc.). Here is a example:
devtools
' DESCRIPTION file:In this way we install
rversions
andhttr
from GitHub.com using HTTPS protocol.2. Remove these two packages from local lib
3. Check for dependencies
devtools
remotes
installsrversions
andhttr
three times: two from GitHub.com and one from CRAN.Oh no they think we still don't have
rersions
andhttr
!Okay, this time, we install these packages, TWICE!
This error is introduced from
NA_character_
return ofremote_package_name
, thenparse_one_extra
, thenextra_deps
, thendev_package_deps
, and finallyinstall_deps
.When
remote_package_name
could give correct package name, there will be noNA
packages indev_package_deps
, andupgradable_packages
will produce correct result:Main fixes are in
R/install-git.R
L82-L83 and L148-L152, other diff is made bystyler
. I've also added some necessary tests and modified vignette.