sessioninfo/0000755000176200001440000000000013370075702012615 5ustar liggesuserssessioninfo/inst/0000755000176200001440000000000013333007121013557 5ustar liggesuserssessioninfo/inst/README.markdown0000644000176200001440000000500513333007121016260 0ustar liggesusers # sessioninfo > R Session Information [![Linux Build Status](https://travis-ci.org/r-lib/sessioninfo.svg?branch=master)](https://travis-ci.org/r-lib/sessioninfo) [![Windows Build status](https://ci.appveyor.com/api/projects/status/github/r-lib/sessioninfo?svg=true)](https://ci.appveyor.com/project/gaborcsardi/sessioninfo) [![](http://www.r-pkg.org/badges/version/sessioninfo)](http://www.r-pkg.org/pkg/sessioninfo) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/sessioninfo)](http://www.r-pkg.org/pkg/sessioninfo) [![Coverage Status](https://img.shields.io/codecov/c/github/r-lib/sessioninfo/master.svg)](https://codecov.io/github/r-lib/sessioninfo?branch=master) Query and print information about the current R session. It is similar to `utils::sessionInfo()`, but includes more information about packages, and where they were installed from. ## Installation ```r devtools::install_github("r-lib/sessioninfo") ``` ## Usage Example output: ```r sessioninfo::session_info() ``` ```r ─ Session info ─────────────────────────────────────────────────────────────── setting value version R version 3.5.0 (2018-04-23) os macOS Sierra 10.12.6 system x86_64, darwin15.6.0 ui X11 language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz Europe/Brussels date 2018-08-09 ─ Packages ─────────────────────────────────────────────────────────────────── package * version date source clisymbols 1.2.0 2017-05-21 CRAN (R 3.5.0) crayon 1.3.4 2017-09-16 CRAN (R 3.5.0) gitty 1.0.0 2018-07-16 Github (gaborcsardi/gitty@67a6e3e) memuse 4.0-0 2017-11-10 CRAN (R 3.5.0) prettycode * 1.0.1 2017-12-12 CRAN (R 3.5.0) prompt 1.0.0 2018-07-16 Github (gaborcsardi/prompt@e5248b5) sessioninfo 1.0.1.9000 2018-08-09 local tracer * 1.0.0 2017-01-28 CRAN (R 3.5.0) whisker 0.3-2 2013-04-28 CRAN (R 3.5.0) withr 2.1.2 2018-03-15 CRAN (R 3.5.0) ``` ### Copying to the clipboard You can use the [`clipr` package](https://cran.rstudio.com/web/packages/clipr/) to copy the session info to the clipboard: ```r clipr::write_clip(session_info()) ``` (The current `clipr` version prints a warning, but you can ignore that.) ## License GPL-2 sessioninfo/tests/0000755000176200001440000000000013140372733013756 5ustar liggesuserssessioninfo/tests/testthat.R0000644000176200001440000000010213140372733015732 0ustar liggesuserslibrary(testthat) library(sessioninfo) test_check("sessioninfo") sessioninfo/tests/testthat/0000755000176200001440000000000013370075702015617 5ustar liggesuserssessioninfo/tests/testthat/test-utils.R0000644000176200001440000000022113140372733020051 0ustar liggesusers context("utils") test_that("sort_ci", { expect_equal( sort_ci(c("ant", "\u00a0nt", "bottom")), c("ant", "bottom", "\u00a0nt") ) }) sessioninfo/tests/testthat/fixtures/0000755000176200001440000000000013364464476017505 5ustar liggesuserssessioninfo/tests/testthat/fixtures/devtools.rda0000644000176200001440000000203513140372733022016 0ustar liggesusersUn6V `[ b7uKd(PEgIHMcg ;$f6lدő-\?d[eu:k9<_ڶӈ.4^WB8 N钦`yDgX2* OuͭG_௠B=QJ}""C!U1>$ R ^2!v;Kj$y|o `XS"E@ pA8[WTaCh*g8"Gh*EA-* Kn_#D\o{'Qumި; sessioninfo/tests/testthat/fixtures/devtools-deps.rda0000644000176200001440000000131613352221171022742 0ustar liggesusersWK06MAy$MpE8UB$ަud;-{C(8rBj$'x<3;r\i>[ChNGB.edOQ2+RtTBI^򜫮[vRzb2-9Q]zaLS"^JeR&ʴdILFEN;'sF&ʌzuYAB{,4Ǫ!\wsܚUxn8c* YbPAUzB^Qy+*3X:/ R0ךpz:4QWtv4D[ivfu 5?Pb߇%QuQ3="Z`x;Bb?WeP)21 W"mbv:Z|iBV&[ife% ,U]N9GdL a^6)LBH*K$fYޮ$DKUZ1IԒb^-.M⵹4)a˚-۷IT!7ǯ~$8aN;,KaH,[rQ gX=VϰϰqE՚װmu-Q[`Hq iAw] !)Q܌!ɁBH4ZOx N̩3sessioninfo/tests/testthat/fixtures/no-sha.rda0000644000176200001440000000155713140372733021354 0ustar liggesusersUn9MA h"h'@KKZhj%*NL'+.wϴ+MRS&?|3h4 fXh*yGS-\i,6{1y*`{g^ R`wnQkBO`zyVZ}qg* 8J,@RĈMg[[ qt 1'?8v:SU';# $,98*ߐf`ryێuDB%*XECi%  cRg?c+~KY$ɉWG ʓ\$ ['DhR~htb< $R< ޏV)g [JBA)aKqƤEBl"f`$"8]Ql%njʈTh D4Ri4.!'X"׌v>)hXKRvhLNm6;KLB!MYbJ%<;DcN%tj$s2Uy A zovf`Fը zkk`%gU.OzaO7gp]5($?Fܳk͈10hR!TzT*#=Ò K\څPB7]yd\ 绍Ku 9vi2S&K;MsLG߬9;MK|QJnɁOl8gw_w4WܿeJۢ=$IER!0c~޳ڷsessioninfo/tests/testthat/fixtures/descs.rda0000644000176200001440000002622213140372733021264 0ustar liggesusers}w#ǹI#J%aْJ# mċ  3 s3]zII=YrNVwM 'YwE6oHVYd{(TgF#ږFuUu=wՕW.\||-+K?_b"oqvs/~فeY}VP+Z\+J2ꅏU0 w,EvK>XCxJFqA0= <~Vc;׋S~Qzo`I9*nwLh0!g1ٌqo;3hdٜYÎݾC63~s`ȺVY:մ Koĵς`jMgY+wyǣwAA㼑.FQoڟaNU򼰸 Rn'EU: pa0F U 8TḰ\(ȕ(c?ύyq5*7UQ j9Iɢ;PqC{hCn`߅ŶH}ZtcӁ N#ߍq`?qϓU `UHq0.ܔď-/1bX*r= jڂZ?V*J0$цokwnހyn[MV{ƙu[ώ]Hb5js_iˢzЊfu[MٱyznU{g[oX-]} $qeXd@7I%dIo ĸltXb|7xd(}O-IGAG|}'yw}{@ a[\j뛿7% ٤jpӈH7'r Z[E uY9Q j3J3 ?4ҔHm-TFG1#O<(O VN^-4ɤ؜͞>W +%RHmݳVn4FcWyo˪95gl4yYm}^\hJ J>-jU`zEWYR#3ӘC3pe9#G^cU:n3@k:E KHOzkixCCy,?C4 !vB9ql ?XA(7 79՛VTn0ʎȾ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DŽ01&#9-?f|2՗O6Zʏst/B+u~_OI?D dҞ{C {cs/7?ӽϟ=sDk_"'x]Q )p]ª̝$ů ^~PLYZO/=.u5!S| !'Lef L6aoMj1$ y¬O .3+_otf٘UԈڒ le.߫_u~˞̗u~_u~_UYu~_u~_UƾI闘;W'eR4v!r@vzTv:S&`!GIBPO!l?1Fq\=~ΎL 'o_z<}\.L@FHqO^ @ r}?O u+)sC<&2B.f9H~=ɬSlwi eBS$X,趠A`6BIQ$Bw,dQx_NN^V_ap^3Ou8F(cVj7Wg^Vu^`#yVE;)`-sTˢd,=i 5yTA44EiXg8fSA(4p"0B%(u֡O8k |64gv>4Y-Cp$Tб8LG3Y SmA(q]~,m8)2.P/ ,dn1b]"bgg524԰2aNJ͊-XHbT$(;"2<2o/硧<yfz05(3I a895njAϲ0a^H$<Y``FWφ,RI]Pūuȥp3"z,z$EM|r+G4=! </ &$sessioninfo/tests/testthat/fixtures/MD50000644000176200001440000000262013351733277020007 0ustar liggesusersa429f780423be984b698e4c36d285b33 *DESCRIPTION bff899621c77de080a3ef27cfb70b33b *INDEX 22cd8a05255133c305564b516e7a3746 *Meta/Rd.rds 429724b30f0322e2d56778dd130867d3 *Meta/features.rds 01a94e36648a1f8302fc451ef692c986 *Meta/hsearch.rds 9bd30c296e0e705b742b51f44f99b61e *Meta/links.rds 06019c01d899dd9ac5bcbc1ab93c316c *Meta/nsInfo.rds 55be8b99dcf16cc28f441c279ea55bc6 *Meta/package.rds 5156c45818e1683a3d9e3ec41e3843df *Meta/vignette.rds 96ec3b945479563c93da75299c577a76 *NAMESPACE 049fdaedb9fff0f07342ca6a6c75e3bc *NEWS.md ebf0fc819595d631b8bf280c4b049940 *R/fansi 97dca9d3f744065714257d1d0de6bb63 *R/fansi.rdb 880e55930e831680e23992e6f03c83f2 *R/fansi.rdx 5079e586ae2ba970be4944ad0dd123aa *doc/index.html 7642f25e75f84d5811fefb105694ff48 *doc/sgr-in-rmd.R 34fe1d9bbffdb860fd7a2fa35a24c327 *doc/sgr-in-rmd.Rmd 9653f9785b8daba190d1b04e9acd080c *doc/sgr-in-rmd.html c2d517b6a0191bc228b782c576f3cdb0 *help/AnIndex c5d03d5e1c296bf829dd6edad6a4e103 *help/aliases.rds 6ecf56a6d11f78f93e28b849908942ed *help/fansi.rdb 37b6d5ce67db287a9a8a4b507e9f1dc3 *help/fansi.rdx 062471f7f5e674f589302364ed41ee13 *help/paths.rds 0d5b55bbd16d41e19ff10a8ab36aee54 *html/00Index.html b6763e6916890c631fdc3f2643803b1a *html/R.css 7b96ab4bf019b0cfed86425634d640e8 *libs/i386/fansi.dll 24b4d526fc30094c13969216ceb1dd56 *libs/i386/symbols.rds 6503170d698e5a7916bf2457edc5de8d *libs/x64/fansi.dll 598b845e7cfc22b2d72fbae5de46a21f *libs/x64/symbols.rds sessioninfo/tests/testthat/fixtures/no-remote-repo.rda0000644000176200001440000000155013140372733023030 0ustar liggesusersU[o0.`#@BBBȪ֊\Z`\6@v@YBRԎlg<?c&^v7A4~ޫj3z^+~]TU.lrdȠĠՍo7`dX8^'I>Ծk FÃό7|h$"*݋t I"6VVe<ـ^F埈peZ;8erlZN] PU]s?eH8r"TUP!M超e} JLUF.L< X0&Gxj:]nl[%/#=2KQ9*>G}18&RpǺA!0, I2{CCN=s3&õోEIoo$"0^Pl!Gʀi D,h*$h[B Nr1E,!4-_RрdY٫iUĘJ()KL])xV]%3؂8 AG|f@off`kwA<\Z\\j?2((w.t9{9St .κ?;sT~ν536C"3̽3؋/ ^TFr7ō AƜ߀&=(a׷ nHc3.\]9*RuLq ORL7G@ɜȞ} %Zb\1myMF^N_:hvޟղIY}:^Q0 4X¨D'1lsessioninfo/tests/testthat/fixtures/fsdfgwetdhsdfhq4yqh_0.0.0.9000.tar.gz0000644000176200001440000000102513364463344025706 0ustar liggesusersT]o0ٿ⊽$RB!!e(IJiɅJlj;MدinRUA9/TH֨<~ƗË|j\u}]# ]k^| \RJ3 )*cSN3ÌF43[J5a+@s0a[P`H6W ׁ_2XTHutho$9}̤vX%ˊ9)h5l2ؑDJKʲEٵ>pCyN$vPE庚 j_$M$ӦC&,BɞހiX)Td#3e~'QMCrdX,OrA!t\oNBg~_ skdaP:Wƃne\_+>3)ǶMg`8~[=[|4C5pWhmyǜ%^(גi2fCp gTka^^_;7&fV5j'f sessioninfo/tests/testthat/fixtures/devtools-info-windows.rda0000644000176200001440000000172713352221171024440 0ustar liggesusersXo0.}i Ha8Ni\$n5+?Nd6MB꤮ϿWGRT+ƣJ&.kOſy">*ʾn"0|D#Or&(dFeUbLfz7b4VY,| rI:LoRsuw,K2;S4ͽ91bٛOF"u[36%1fWBU *n]PBTpM"I 8el\|L 5n@ |m(oи ݶn@n( P5_w̚0摃b7 Vk/ͬ}ھ m`E $<+ƛܢ,T]i^nd1g o[6LEӴe% C-Uѕ jkǚB[̙mLh33_T+l̎cY7t&:Ӑ=fHЁ=#=KHPv()!WD "fY ʖ[ p@TհTYYӳ/VVʴ"hcIyvVI ILԬާՓپSwjW\8< 2)+Z-"-A sessioninfo/tests/testthat/fixtures/memoise.rda0000644000176200001440000000157713140372733021627 0ustar liggesusersTn7XNc;(xt#7~rؑĭ%-38UrLJ!}hx+ 6MhO=Vux9y>Ji*9,`ȐBoMFl_?ONY#N~ 12Kp ]$|(6S hugfTX$~,`%raqngyM:<*}+.uKDq3CioJ8D8CΰWHx8A=4`/C}`-8=6;Qʴ_ۧW[ )/Qނ C:u |pGWۍb6$tg,(ZkBy53d~sȚŬJ$[GC%l:*})(WbCj+qJhWE YFލ+>l9!*aLɵ`*~_}o sessioninfo/tests/testthat/fixtures/biobase.rda0000644000176200001440000000142213140372733021562 0ustar liggesusersmUmo0 XAh?p6m2(c]I톺䖚vd;l_?!.mfJI|s{Z[Ѳ^ųmx[}|՘t܅zu&#˕4p4.R2"{;6F>|AiNl}qրC< p{ @D10Ԑ%hNx;ѤOc*X0ZZi--{AF$Jd#C{;{AMc5o;~HrRONT{EP0d\ZzP?M㊭Ow=iˍQ3t{?c5IBk%T*~DkzO2FR\6yB8i&Y:p !_6K ]q)E&*wwT!<<{ưYGŦ'bǚMBsۣTɏ"N ^sZ !m aPZ +c?қĴ-k}=`sessioninfo/tests/testthat/test-printing.R0000644000176200001440000000026013140372733020546 0ustar liggesusers context("printing") test_that("rule", { expect_match( withr::with_options(list(width = 20), rule("test", pad = "-")), "- test -----------", fixed = TRUE ) }) sessioninfo/tests/testthat/test-platform-info.R0000644000176200001440000000166313351537617021511 0ustar liggesusers context("platform_info") test_that("platform_info", { pi <- platform_info() expect_equal( names(pi), c("version", "os", "system", "ui", "language", "collate", "ctype", "tz", "date") ) ## This can be a variety of strings, e.g. "R Under development" expect_match(pi$version, "R ") expect_true(is_string(pi$os)) expect_true(is_string(pi$system) && grepl(",", pi$system)) expect_true(is_string(pi$ui)) expect_true(is_string(pi$language)) expect_true(is_string(pi$tz)) expect_true(is_string(pi$date)) expect_equal(pi$date, as.character(as.Date(pi$date))) }) test_that("print.platform_info", { expect_output(print(platform_info()), "setting value", fixed = TRUE) }) test_that("print.platform_info ignores max.print", { pi <- platform_info() withr::local_options(list(max.print = 1)) out <- capture_output(print(pi)) out <- tail(strsplit(out, split = "\r?\n")[[1]], -1) expect_length(out, length(pi)) }) sessioninfo/tests/testthat/test-warnings.R0000644000176200001440000001013213364466715020557 0ustar liggesusers context("warnings") test_that("broken dll", { if (.Platform$OS.type != "windows") { expect_true(TRUE); return() } skip_on_cran() ## To check this, we need a package with a dll. ## We need to install it into some temporary library, and then mess ## up the MD5 sum. We can use testhat itself to do this, as long as it ## has compiled code. We also run package_info() in another process, ## to avoid changing the current one. dir.create(lib <- tempfile()) on.exit(unlink(lib, recursive = TRUE), add = TRUE) file.copy(system.file(package = "testthat"), lib, recursive = TRUE) md5file <- file.path(lib, "testthat", "MD5") if (!file.exists(md5file)) skip("Cannot test broken DLLs") l <- readLines(md5file) dllline <- grep("testthat.dll", l)[1] substr(l[dllline], 2, 5) <- "xxxx" writeLines(l, md5file) pi <- callr::r( function(lib) { library(testthat, lib.loc = lib) sessioninfo::package_info() }, args = list(lib = lib), libpath = c(lib, .libPaths()), timeout = 10) expect_false(pi$md5ok[pi$package == "testthat"]) expect_output(print(pi), "DLL MD5 mismatch, broken installation") }) test_that("loaded & on-disk path mismatch", { skip_on_cran() ## Copy testthat to another library, load it from there, and then ## remove that lib from the library path. dir.create(lib <- tempfile()) on.exit(unlink(lib, recursive = TRUE), add = TRUE) file.copy(system.file(package = "testthat"), lib, recursive = TRUE) pi <- callr::r( function(lib) { library(testthat, lib.loc = lib) .libPaths(.libPaths()[-1]) sessioninfo::package_info() }, args = list(lib = lib), libpath = c(lib, .libPaths()), timeout = 10 ) wh <- which(pi$package == "testthat") expect_false(pi$path[wh] == pi$loadedpath[wh]) expect_output(print(pi), "Loaded and on-disk path mismatch") }) test_that("loaded & on-disk version mismatch", { skip_on_cran() ## Copy testthat to another library and change the version, after ## loading it. dir.create(lib <- tempfile()) on.exit(unlink(lib, recursive = TRUE), add = TRUE) file.copy(system.file(package = "testthat"), lib, recursive = TRUE) pi <- callr::r( function(lib) { library(testthat, lib.loc = lib) desc_file <- file.path(lib, "testthat", "DESCRIPTION") desc <- readLines(desc_file) desc <- sub("^Version:.*$", "Version: 0.0.1", desc) writeLines(desc, desc_file) binary_desc <- file.path(lib, "testthat", "Meta", "package.rds") if (file.exists(binary_desc)) { pkg_desc <- readRDS(binary_desc) desc <- as.list(pkg_desc$DESCRIPTION) desc$Version <- "0.0.1" pkg_desc$DESCRIPTION <- stats::setNames(as.character(desc), names(desc)) saveRDS(pkg_desc, binary_desc) } sessioninfo::package_info() }, args = list(lib = lib), libpath = c(lib, .libPaths()), timeout = 10 ) wh <- which(pi$package == "testthat") expect_false(pi$ondiskversion[wh] == pi$loadedversion[wh]) expect_output(print(pi), "Loaded and on-disk version mismatch") }) test_that("deleted package", { skip_on_cran() foo <- "fsdfgwetdhsdfhq4yqh" dir.create(lib <- tempfile()) on.exit(unlink(lib, recursive = TRUE), add = TRUE) pkgfile <- normalizePath(paste0("fixtures/", foo, "_0.0.0.9000.tar.gz")) install.packages(pkgfile, lib = lib, repos = NULL, type = "source", quiet = TRUE) pis <- callr::r( function(lib, foo) { library(foo, character.only = TRUE, lib.loc = lib) unlink(file.path(lib, foo), recursive = TRUE) list( sessioninfo::session_info(), sessioninfo::session_info(pkgs = foo) ) }, args = list(lib = lib, foo = foo), libpath = c(lib, .libPaths()), timeout = 10, error = "stack" ) expect_true(is.list(pis)) expect_equal(length(pis), 2) for (i in seq_along(pis)) { pi <- pis[[i]]$packages wh <- which(pi$package == foo) expect_equal(pi$ondiskversion[wh], NA_character_) expect_equal(pi$path[wh], NA_character_) expect_equal(pi$date[wh], NA_character_) expect_equal(pi$source[wh], NA_character_) } }) sessioninfo/tests/testthat/test-session-info.R0000644000176200001440000000074613352221171021333 0ustar liggesusers context("session_info") test_that("session_info", { info <- readRDS(paste0("fixtures/devtools-info-", .Platform$OS.type, ".rda")) mockery::stub(session_info, "package_info", pi) si <- session_info() expect_equal(si$platform, platform_info()) expect_equal(si$packages, pi) }) test_that("print.session_info", { si <- session_info() expect_output(print(si), "setting value", fixed = TRUE) expect_output(print(si), "package[ ]+\\* version[ ]+date[ ]+lib[ ]+source") }) sessioninfo/tests/testthat/test-dependent-packages.R0000644000176200001440000000425413364456231022451 0ustar liggesusers context("dependent_packages") test_that("dependent_packages", { ins <- readRDS("fixtures/installed.rda") dep <- readRDS("fixtures/devtools-deps.rda") alldsc <- readRDS("fixtures/descs.rda") mockery::stub(dependent_packages, 'utils::installed.packages', ins) mockery::stub( dependent_packages, 'pkg_desc', function(x) alldsc[[x]] ) mockery::stub( dependent_packages, 'loadedNamespaces', function() ins ) mockery::stub( dependent_packages, 'getNamespaceVersion', function(x) alldsc[[x]]$Version ) mockery::stub( dependent_packages, 'search', function() paste0("package:", dep$package[dep$attached]) ) mockery::stub( dependent_packages, 'getNamespaceInfo', function(x, ...) alldsc[[x]]$Version ) exp <- dep[, setdiff(colnames(dep), c("path", "loadedpath"))] tec <- dependent_packages("devtools", NA) tec <- tec[, setdiff(colnames(tec), c("path", "loadedpath"))] expect_equal(exp, tec) }) test_that("pkg_path_disk", { p1 <- pkg_path_disk(utils::packageDescription("stats")) expect_equal( read.dcf(file.path(p1, "DESCRIPTION"))[, "Package"], c(Package = "stats") ) }) test_that("find_deps", { ins <- readRDS("fixtures/installed.rda") expect_equal( sort_ci(find_deps("devtools", ins)), sort_ci( c("devtools", "callr", "httr", "utils", "tools", "methods", "memoise", "whisker", "digest", "rstudioapi", "jsonlite", "stats", "git2r", "withr", "pkgbuild", "pkgload", "curl", "crayon", "testthat", "BiocInstaller", "Rcpp", "MASS", "rmarkdown", "knitr", "hunspell", "lintr", "bitops", "roxygen2", "evaluate", "rversions", "covr", "gmailr", "processx", "R6", "assertthat", "debugme", "grDevices", "graphics", "mime", "openssl", "desc", "rprojroot", "backports", "praise", "magrittr", "xml2", "BH", "yaml", "htmltools", "caTools", "base64enc", "stringr", "highr", "markdown", "stringi", "rex", "codetools", "stringdist", "xmlparsedata", "lazyeval", "parallel", "brew", "commonmark") ) ) ## An edge case expect_equal( find_deps("foobar", top_dep = character(), rec_dep = character()), "foobar" ) }) sessioninfo/tests/testthat/test-package-info.R0000644000176200001440000000654113364456311021253 0ustar liggesusers context("package_info") test_that("package_info, loaded", { descs <- readRDS("fixtures/devtools-deps.rda") alldsc <- readRDS("fixtures/descs.rda") exp <- readRDS(paste0("fixtures/devtools-info-", .Platform$OS.type, ".rda")) mockery::stub(package_info, "loaded_packages", descs) mockery::stub( package_info, "pkg_desc", function(x, ...) alldsc[[x]] ) mockery::stub(package_info, "pkg_lib_paths", levels(exp$library)) pi <- package_info() expect_identical(pi, exp) }) test_that("package_info, dependent", { descs <- readRDS("fixtures/devtools-deps.rda") alldsc <- readRDS("fixtures/descs.rda") exp <- readRDS(paste0("fixtures/devtools-info-", .Platform$OS.type, ".rda")) mockery::stub(package_info, "dependent_packages", descs) mockery::stub( package_info, "pkg_desc", function(x, ...) alldsc[[x]] ) mockery::stub(package_info, "pkg_lib_paths", levels(exp$library)) pi <- package_info("devtools") expect_identical(pi, exp) }) test_that("pkg_date", { crayon <- readRDS("fixtures/descs.rda")$crayon expect_equal(pkg_date(crayon), "2016-06-28") crayon$`Date/Publication` <- NULL expect_equal(pkg_date(crayon), "2016-06-29") crayon$`Built` <- NULL expect_identical(pkg_date(crayon), NA_character_) }) test_that("pkg_source", { descs <- readRDS("fixtures/descs.rda") expect_identical( pkg_source(descs$debugme), "Github (gaborcsardi/debugme@df8295a)" ) expect_identical(pkg_source(descs$curl), "CRAN (R 3.3.3)") biobase <- readRDS("fixtures/biobase.rda") expect_identical(pkg_source(biobase), "Bioconductor") memoise <- readRDS("fixtures/memoise.rda") expect_identical(pkg_source(memoise), "CRAN (R 3.3.3)") }) test_that("pkg_source edge case, remote repo, but no RemoteSha", { desc <- readRDS("fixtures/no-sha.rda") expect_identical(pkg_source(desc), "github (r-pkgs/desc)") }) test_that("pkg_source edge case, remote repo, no RemoteRepo", { desc <- readRDS("fixtures/no-remote-repo.rda") expect_identical(pkg_source(desc), "github") }) test_that("pkg_md5_stored", { md5 <- pkg_md5_stored("fixtures") exp <- c(`libs/i386/fansi.dll` = "7b96ab4bf019b0cfed86425634d640e8", `libs/x64/fansi.dll` = "6503170d698e5a7916bf2457edc5de8d") expect_identical(md5, exp) }) test_that("pkg_md5_disk", { dir.create(tmp <- tempfile()) on.exit(unlink(tmp, recursive = TRUE), add = TRUE) dir.create(file.path(tmp, "libs")) dir.create(file.path(tmp, "libs", "i386")) dir.create(file.path(tmp, "libs", "x64")) writeBin(charToRaw("foo\n"), con = file.path(tmp, "libs", "i386", "foo.dll")) writeBin(charToRaw("bar\n"), con = file.path(tmp, "libs", "x64", "foo.dll")) md5 <- pkg_md5_disk(tmp) exp <- c(`libs/i386/foo.dll` = "d3b07384d113edec49eaa6238ad5ff00", `libs/x64/foo.dll` = "c157a79031e1c40f85931829bc5fc552") expect_identical(md5,exp) }) test_that("print.packages_info", { info <- readRDS(paste0("fixtures/devtools-info-", .Platform$OS.type, ".rda")) expect_output( print(info), "package * version date lib source", fixed = TRUE ) }) test_that("print.packages_info ignores max.print", { info <- readRDS(paste0("fixtures/devtools-info-", .Platform$OS.type, ".rda")) withr::local_options(list(max.print = 1)) out <- capture_output(print(info)) out <- tail(strsplit(out, split = "\r?\n")[[1]], -1) expect_length(out, nrow(info) + 3) }) sessioninfo/tests/testthat/test-loaded-packages.R0000644000176200001440000000064313140372733021725 0ustar liggesusers context("loaded_packages") test_that("loaded_packages", { lp <- loaded_packages() expect_equal(sort_ci(lp$package), sort_ci(loadedNamespaces())) expect_identical( gsub("-", ".", lp$loadedversion), unlist(lapply(lp$package, function(x) as.character(packageVersion(x)))) ) expect_true(all(file.exists(lp$path))) expect_equal( paste0("package:", lp$package) %in% search(), lp$attached ) }) sessioninfo/NAMESPACE0000644000176200001440000000067513352255743014051 0ustar liggesusers# Generated by roxygen2: do not edit by hand S3method(as.character,packages_info) S3method(as.character,platform_info) S3method(as.character,session_info) S3method(print,packages_info) S3method(print,platform_info) S3method(print,session_info) export(os_name) export(package_info) export(platform_info) export(session_info) importFrom(cli,symbol) importFrom(utils,capture.output) importFrom(utils,packageVersion) importFrom(withr,with_collate) sessioninfo/NEWS.md0000644000176200001440000000322213370070022013700 0ustar liggesusers# 1.1.1 * `package_info()` and `session_info()` now detect locally installed packages correctly if they have an empty `biocViews` field in `DESCRIPTION (@llrs, #25) * `package_info()` and `session_info()` now handle the case when a loaded package was removed from the disk. # 1.1.0 * `package_info()` now has a `dependencies` argument, to filter the type of dependent packages in the output (#22). * `session_info()` and `package_info()` now show the library search path, and also which library each package was loaded from. They also warn if the on-disk version of the package has a different path than the loaded version (#9, #20). * `package_info()`'s `ondiskversion` entry is now correct. * `session_info()` and `package_info()` now verify the MD5 hashes of DLL files on Windows, and warns for micmatches, as these are usually broken packages (#12, #16). * We use now the cli package, instead of clisymbols, and this fixes printing bugs in LaTeX documents (#14). * `session_info()` and `platform_info()` now include the `LC_CTYPE` locale category (@patperry, #11) * `session_info()` and `package_info()` now print source of the CRAN packages in uppercase, always, even if they were installed by devtools. * `session_info()` and `platform_info()` now handle the case when `utils::sessionInfo()$running` is `NULL` (@HenrikBengtsson, #7). * `session_info()` and `package_info()` now only list loaded versions for namespaces which are already loaded. This only makes a difference if the `pkgs` argument is given (#4). * Do not consult the `max.print` option, for platform and package info (@jennybc, #13). # 1.0.0 First public release. sessioninfo/R/0000755000176200001440000000000013370065115013013 5ustar liggesuserssessioninfo/R/osname.R0000644000176200001440000000142413364455771014437 0ustar liggesusers #' Human readable name of the current operating system #' #' For example Windows 8.1 instead of Windows version 6.3.9600. #' On macOS it includes the code names, on Linux it includes the #' distribution names and codenames if appropriate. #' #' It uses [utils::sessionInfo()], but simplifies its output a bit #' on Windows, to make it more concise. #' #' @return A character scalar. #' #' @export os_name <- function() { x <- suppressWarnings(utils::sessionInfo("base")$running) if (is.null(x)) return(NA_character_) # Regexps to clean up long windows strings generated at # https://github.com/wch/r-source/blob/af7f52f70101960861e5d995d3a4bec010bc89e6/src/library/utils/src/windows/util.c x <- gsub("Service Pack", "SP", x) x <- gsub(" \\(build \\d+\\)", "", x) x } sessioninfo/R/utils.R0000644000176200001440000000063513364455771014320 0ustar liggesusers `%||%` <- function(l, r) if (is.null(l)) r else l #' @importFrom withr with_collate sort_ci <- function(x) { with_collate("C", x[order(tolower(x), x)]) } is_string <- function(x) { is.character(x) && length(x) == 1 && !is.na(x) } order_by_name <- function(x) { if (!length(x)) { x } else if (is.null(names(x))) { stop("Cannot order by name, no names") } else { x[order(names(x))] } } sessioninfo/R/package-info.R0000644000176200001440000001724713370065115015475 0ustar liggesusers #' Information about the currently loaded packages, or about a chosen set #' #' @param pkgs Either a vector of package names or NULL. If \code{NULL}, #' displays all loaded packages. If a character vector, also, includes #' all dependencies of the package. #' @param include_base Include base packages in summary? By default this is #' false since base packages should always match the R version. #' @param dependencies Whether to include the (recursive) dependencies #' as well. See the `dependencies` argument of [utils::install.packages()]. #' @return A data frame with columns: #' * `package`: package name. #' * `ondiskversion`: package version (on the disk, which is sometimes #' not the same as the loaded version). #' * `loadedversion`: package version. This is the version of the loaded #' namespace if `pkgs` is `NULL`, and it is the version of the package #' on disk otherwise. The two of them are almost always the same, #' though. #' * `path`: path to the package on disk. #' * `loadedpath`: the path the package was originally loaded from. #' * `attached`: logical, whether the package is attached to the search #' path. #' * `is_base`: logical, whether the package is a base package. #' * `date`: the date the package was installed or built. #' * `source`: where the package was installed from. E.g. #' `CRAN`, `GitHub`, `local` (from the local machine), etc. #' * `md5ok`: Whether MD5 hashes for package DLL files match, on Windows. #' `NA` on other platforms. #' * `library`: factor, which package library the package was loaded from. #' For loaded packages, this is (the factor representation of) #' `loadedpath`, for others `path`. #' #' See [session_info()] for the description of the *printed* columns #' by `package_info` (as opposed to the *returned* columns). #' #' @export #' @examples #' package_info() #' package_info("sessioninfo") package_info <- function(pkgs = NULL, include_base = FALSE, dependencies = NA) { if (is.null(pkgs)) { pkgs <- loaded_packages() } else { pkgs <- dependent_packages(pkgs, dependencies) } desc <- lapply(pkgs$package, pkg_desc, lib.loc = .libPaths()) pkgs$is_base <- vapply( desc, function(x) identical(x$Priority, "base"), logical(1) ) pkgs$date <- vapply(desc, pkg_date, character(1)) pkgs$source <- vapply(desc, pkg_source, character(1)) pkgs$md5ok <- vapply(desc, pkg_md5ok_dlls, logical(1)) libpath <- pkg_lib_paths() path <- ifelse(is.na(pkgs$loadedpath), pkgs$path, pkgs$loadedpath) pkgs$library <- factor(dirname(path), levels = libpath) if (!include_base) pkgs <- pkgs[! pkgs$is_base, ] rownames(pkgs) <- pkgs$package class(pkgs) <- c("packages_info", "data.frame") pkgs } pkg_desc <- function(package, lib.loc = NULL) { desc <- suppressWarnings( utils::packageDescription(package, lib.loc = lib.loc)) if (inherits(desc, "packageDescription")) desc else NULL } pkg_lib_paths <- function() { normalizePath(.libPaths(), winslash = "/") } pkg_date <- function (desc) { if (!is.null(desc$`Date/Publication`)) { date <- desc$`Date/Publication` } else if (!is.null(desc$Built)) { built <- strsplit(desc$Built, "; ")[[1]] date <- built[3] } else { date <- NA_character_ } as.character(as.Date(strptime(date, "%Y-%m-%d"))) } pkg_source <- function(desc) { if (is.null(desc)) { NA_character_ } else if (!is.null(desc$GithubSHA1)) { str <- paste0("Github (", desc$GithubUsername, "/", desc$GithubRepo, "@", substr(desc$GithubSHA1, 1, 7), ")") } else if (!is.null(desc$RemoteType) && desc$RemoteType != "cran") { # want to generate these: # remoteType (username/repo@commit) # remoteType (username/repo) # remoteType (@commit) # remoteType remote_type <- desc$RemoteType # RemoteUsername and RemoteRepo should always be present together if (!is.null(desc$RemoteUsername) && (!is.null(desc$RemoteRepo))) { user_repo <- paste0(desc$RemoteUsername, "/", desc$RemoteRepo) } else { user_repo <- NULL } if (!is.null(desc$RemoteSha)) { sha <- paste0("@", substr(desc$RemoteSha, 1, 7)) } else { sha <- NULL } # in order to fulfill the expectation of formatting, we paste the user_repo # and sha together if (!is.null(user_repo) || !is.null(sha)) { user_repo_and_sha <- paste0(" (", user_repo, sha, ")") } else { user_repo_and_sha <- NULL } str <- paste0(remote_type, user_repo_and_sha) } else if (!is.null(desc$Repository)) { repo <- desc$Repository if (!is.null(desc$Built)) { built <- strsplit(desc$Built, "; ")[[1]] ver <- sub("$R ", "", built[1]) repo <- paste0(repo, " (", ver, ")") } repo } else if (!is.null(desc$biocViews) && desc$biocViews != "") { "Bioconductor" } else { "local" } } pkg_md5ok_dlls <- function(desc) { if (is.null(desc)) return(NA) if (.Platform$OS.type != "windows") return(NA) pkgdir <- dirname(dirname(attr(desc, "file"))) if (!file.exists(file.path(pkgdir, "libs"))) return(TRUE) stored <- pkg_md5_stored(pkgdir) if (is.null(stored)) return(NA) disk <- pkg_md5_disk(pkgdir) identical(stored, disk) } pkg_md5_stored <- function(pkgdir) { md5file <- file.path(pkgdir, "MD5") md5 <- tryCatch( suppressWarnings(readLines(md5file)), error = function(e) NULL) if (is.null(md5)) return(NULL) hash <- sub(" .*$", "", md5) filename <- sub("^[^ ]* \\*", "", md5) dll <- grep("[dD][lL][lL]$", filename) order_by_name(structure(hash[dll], names = tolower(filename[dll]))) } pkg_md5_disk <- function(pkgdir) { withr::with_dir(pkgdir, { dll_files <- file.path( "libs", dir("libs", pattern = "[dD][lL][lL]$", recursive = TRUE)) md5_files <- tools::md5sum(dll_files) order_by_name(structure(unname(md5_files), names = tolower(dll_files))) }) } #' @export print.packages_info <- function(x, ...) { unloaded <- is.na(x$loadedversion) flib <- function(x) ifelse(is.na(x), "?", as.integer(x)) px <- data.frame( package = x$package, "*" = ifelse(x$attached, "*", ""), version = ifelse(unloaded, x$ondiskversion, x$loadedversion), date = x$date, lib = paste0("[", flib(x$library), "]"), source = x$source, stringsAsFactors = FALSE, check.names = FALSE ) badloaded <- package_version(x$loadedversion, strict = FALSE) != package_version(x$ondiskversion, strict = FALSE) badloaded <- !is.na(badloaded) & badloaded badmd5 <- !is.na(x$md5ok) & !x$md5ok badpath <- !is.na(x$loadedpath) & x$loadedpath != x$path baddel <- is.na(x$ondiskversion) badpath[baddel] <- FALSE if (any(badloaded) || any(badmd5) || any(badpath) || any(baddel)) { prob <- paste0( ifelse(badloaded, "V", ""), ifelse(badpath, "P", ""), ifelse(badmd5, "D", ""), ifelse(baddel, "R", "")) px <- cbind("!" = prob, px) } withr::local_options(list(max.print = 99999)) pr <- print.data.frame(px, right = FALSE, row.names = FALSE) cat("\n") lapply( seq_along(levels(x$library)), function(i) cat_ln(paste0("[", i, "] ", levels(x$library)[i]))) if ("!" %in% names(px)) cat("\n") if (any(badloaded)) { cat_ln(" V ", dash(2), " Loaded and on-disk version mismatch.") } if (any(badpath)) { cat_ln(" P ", dash(2), " Loaded and on-disk path mismatch.") } if (any(badmd5)) { cat_ln(" D ", dash(2), " DLL MD5 mismatch, broken installation.") } if (any(baddel)) { cat_ln(" R ", dash(2), " Package was removed from disk.") } invisible(x) } #' @export #' @importFrom utils capture.output as.character.packages_info <- function(x, ...) { capture.output(print(x)) } sessioninfo/R/session-info.R0000644000176200001440000000334213164511307015554 0ustar liggesusers #' Print session information #' #' This is [utils::sessionInfo()] re-written from scratch to both exclude #' data that's rarely useful (e.g., the full collate string or base packages #' loaded) and include stuff you'd like to know (e.g., where a package was #' installed from). #' #' @details #' Columns in the *printed* package list: #' * `package`: package name #' * `*`: whether the package is attached to the search path #' * `version`: package version. If the version is marked with `(!)` that #' means that the loaded and the on-disk version of the package are #' different. #' * `date`: when the package was built, if this information is available. #' This is the `Date/Publication` or the `Built` field from #' `DESCRIPTION`. (These are usually added automatically by R.) #' Sometimes this data is not available, then it is `NA`. #' * `source`: where the package was built or installed from, if available. #' Examples: `CRAN (R 3.3.2)`, `Github (r-lib/pkgbuild@8aab60b)`, #' `Bioconductor`, `local`. #' #' See [package_info()] for the list of columns in the data frame that #' is *returned* (as opposed to *printed*). #' #' @inheritParams package_info #' @export #' @examples #' session_info() #' session_info("sessioninfo") session_info <- function(pkgs = NULL, include_base = FALSE) { structure( list( platform = platform_info(), packages = package_info(pkgs, include_base = include_base) ), class = "session_info" ) } #' @export as.character.session_info <- function(x, ...) { c(rule("Session info"), as.character(x$platform), "", # empty line rule("Packages"), as.character(x$packages) ) } #' @export print.session_info <- function(x, ...) { cat(as.character(x), sep = "\n") } sessioninfo/R/printing.R0000644000176200001440000000066513352372170015001 0ustar liggesusers #' @importFrom cli symbol rule <- function (..., pad = NULL) { if (is.null(pad)) pad <- symbol$line title <- if (length(list(...))) paste0(" ", ..., " ") else "" width <- max(getOption("width") - nchar(title) - 3, 0) paste(pad, title, paste(rep(pad, width), collapse = ""), sep = "") } dash <- function(n = 2) { paste(rep(symbol$line, n), collapse = "") } cat_ln <- function(..., sep = "") { cat(..., "\n", sep = sep) } sessioninfo/R/platform-info.R0000644000176200001440000000320313351537617015723 0ustar liggesusers #' Information about the current platform #' #' @return A list with elements: #' * `version`: the R version string. #' * `os`: the OS name in human readable format, see [os_name()]. #' * `system`: CPU, and machine readable OS name, separated by a comma. #' * `ui`: the user interface, e.g. `Rgui`, `RTerm`, etc. see `GUI` #' in [base::.Platform]. #' * `language`: The current language setting. The `LANGUAGE` environment #' variable, if set, or `(EN)` if unset. #' * `collate`: Collation rule, from the current locale. #' * `ctype`: Native character encoding, from the current locale. #' * `tz`: The current time zone. #' * `date`: The current date. #' #' @seealso Similar functions and objects in the base packages: #' [base::R.version.string], [utils::sessionInfo()], [base::version], #' [base::.Platform], [base::Sys.getlocale()], [base::Sys.timezone()]. #' #' @export #' @examples #' platform_info() platform_info <- function() { structure(list( version = R.version.string, os = os_name(), system = version$system, ui = .Platform$GUI, language = Sys.getenv("LANGUAGE", "(EN)"), collate = Sys.getlocale("LC_COLLATE"), ctype = Sys.getlocale("LC_CTYPE"), tz = Sys.timezone(), date = format(Sys.Date()) ), class = "platform_info") } #' @export print.platform_info <- function(x, ...) { df <- data.frame(setting = names(x), value = unlist(x), stringsAsFactors = FALSE) withr::local_options(list(max.print = 99999)) print(df, right = FALSE, row.names = FALSE) } #' @export #' @importFrom utils capture.output as.character.platform_info <- function(x, ...) { capture.output(print(x)) } sessioninfo/R/loaded-packages.R0000644000176200001440000000264113364455771016163 0ustar liggesusers #' @importFrom utils packageVersion loaded_packages <- function() { ## 'base' is special, because getNamespaceInfo does not work on it. ## Luckily, the path for 'base' is just system.file() spackageVersion <- function(pkg) { ## Error may happen if the package was loaded, and then removed from ## the disk. In this case we'll have NA tryCatch( as.character(packageVersion(pkg, lib.loc = .libPaths())), error = function(e) NA_character_) } packages <- setdiff(loadedNamespaces(), "base") loadedversion <- vapply(packages, getNamespaceVersion, "") ondiskversion <- vapply(packages, spackageVersion, "") path <- vapply( packages, function(p) system.file(package = p, lib.loc = .libPaths()), character(1)) ## If we can't fine the package on disk, have NA instead of "" path[path == ""] <- NA_character_ loadedpath <- vapply(packages, getNamespaceInfo, "", which = "path") attached <- paste0("package:", packages) %in% search() res <- data.frame( package = c(packages, "base"), ondiskversion = c(ondiskversion, spackageVersion("base")), loadedversion = c(loadedversion, getNamespaceVersion("base")), path = c(path, system.file()), loadedpath = c(loadedpath, NA_character_), attached = c(attached, TRUE), stringsAsFactors = FALSE, row.names = NULL ) res <- res[match(sort_ci(res$package), res$package), ] row.names(res) <- NULL res } sessioninfo/R/dependent-packages.R0000644000176200001440000000476213364455771016707 0ustar liggesusers dependent_packages <- function(pkgs, dependencies) { ideps <- interpret_dependencies(dependencies) pkgs <- find_deps(pkgs, utils::installed.packages(), ideps[[1]], ideps[[2]]) desc <- lapply(pkgs, pkg_desc) loaded_pkgs <- pkgs %in% setdiff(loadedNamespaces(), "base") ondiskversion <- vapply( desc, function(x) x$Version %||% NA_character_, character(1)) loadedversion <- rep(NA_character_, length(pkgs)) loadedversion[loaded_pkgs] <- vapply(pkgs[loaded_pkgs], getNamespaceVersion, "") loadedpath <- rep(NA_character_, length(pkgs)) loadedpath[loaded_pkgs] <- vapply(pkgs[loaded_pkgs], getNamespaceInfo, "", which = "path") res <- data.frame( package = pkgs, ondiskversion = ondiskversion, loadedversion = loadedversion, path = vapply(desc, pkg_path_disk, character(1)), loadedpath = loadedpath, attached = paste0("package:", pkgs) %in% search(), stringsAsFactors = FALSE, row.names = NULL ) res <- res[match(sort_ci(res$package), res$package), ] row.names(res) <- NULL res } pkg_path_disk <- function(desc) { if (is.null(desc)) { NA_character_ } else { system.file(package = desc$Package, lib.loc = .libPaths()) } } find_deps <- function(pkgs, available = utils::available.packages(), top_dep = c(dep_types_hard(), "Suggests"), rec_dep = dep_types_hard(), include_pkgs = TRUE) { if (length(pkgs) == 0 || identical(top_dep, FALSE)) return(character()) if (length(top_dep) > 0) { top <- tools::package_dependencies(pkgs, db = available, which = top_dep) top_flat <- unlist(top, use.names = FALSE) } else { top_flat <- character() } if (length(rec_dep) != 0 && length(top_flat) > 0) { rec <- tools::package_dependencies( top_flat, db = available, which = rec_dep, recursive = TRUE) rec_flat <- unlist(rec, use.names = FALSE) } else { rec_flat <- character() } unique(c(if (include_pkgs) pkgs, top_flat, rec_flat)) } dep_types_hard <- function() c("Depends", "Imports", "LinkingTo") dep_types_soft <- function() c("Suggests", "Enhances") dep_types <- function() c(dep_types_hard(), dep_types_soft()) is_na_scalar <- function(x) length(x) == 1 && is.na(x) interpret_dependencies <- function(dp) { hard <- dep_types_hard() if (isTRUE(dp)) { list(c(hard, "Suggests"), hard) } else if (identical(dp, FALSE)) { list(character(), character()) } else if (is_na_scalar(dp)) { list(hard, hard) } else { list(dp, dp) } } sessioninfo/MD50000644000176200001440000000436613370075702013136 0ustar liggesusers8d237e4bdb446a1737c35a29cf5f2e95 *DESCRIPTION 65844bf3fab792d71a5d48a4518dcb7e *NAMESPACE b6d327669f7fc0abd85dd85a9e572f7e *NEWS.md 94bd6140788030074319ff1c3c08bad3 *R/dependent-packages.R 8fa298f3bc1f2d3514dfc2ea4d8bb8d8 *R/loaded-packages.R b794c187feeba01c067c1918a1be9b85 *R/osname.R ba1fc7b1c6bf7a09b12d53ebd2d9570d *R/package-info.R 253dae4f24594297a04b17810f8b7a22 *R/platform-info.R 68d9d0d3dde3eadf208f309e3030863e *R/printing.R 713e6d94a71fa310c62c301db7bbeca3 *R/session-info.R 30f0033b11b2d461dd8c47e403bb0e2d *R/utils.R ffee55ad792a13659a9fc493fd6b241f *inst/README.markdown f013297d5c2f3006735392a759a84b9e *man/os_name.Rd d4df5742b5b748850b7c47afcdc172ad *man/package_info.Rd 7cdabdb9c8d75895717b0cf22d16a8d3 *man/platform_info.Rd 2f8bf6687e46b5d2cfff98700a44df3f *man/session_info.Rd 0e823279172bfb7590ddf30053becad9 *tests/testthat.R d1570db3da339a5bb3db7c85673f984f *tests/testthat/fixtures/MD5 ed4e99dfc45e8190839ec97ee3bbd655 *tests/testthat/fixtures/biobase.rda 23aa7627516d2e036556771d4e444e84 *tests/testthat/fixtures/descs.rda 2ec46780c0a6b9b42f84b87fec7aac43 *tests/testthat/fixtures/devtools-deps.rda acee540744c47931277cb134843d24cb *tests/testthat/fixtures/devtools-info-unix.rda a81dff53b5eb30e1edf8f4193a924bd3 *tests/testthat/fixtures/devtools-info-windows.rda b0297cc88f9e44fb164a4d74e5f7c650 *tests/testthat/fixtures/devtools.rda bcef3a0e2f95c7ee4e5dce665d0ce603 *tests/testthat/fixtures/fsdfgwetdhsdfhq4yqh_0.0.0.9000.tar.gz e33873feb91bc7e55254cb0163048920 *tests/testthat/fixtures/installed.rda 19bee1c35412de7d79c770fd0c3b03dd *tests/testthat/fixtures/memoise.rda 8b73286945f1227d87894c240d55debf *tests/testthat/fixtures/no-remote-repo.rda 2b97d22ff72bfb169197214a58f0dc0e *tests/testthat/fixtures/no-sha.rda d7911c4462fe42bf6ccefbb2a8843c9b *tests/testthat/test-dependent-packages.R be5b070b0cde648978436e9acdab5f08 *tests/testthat/test-loaded-packages.R 338d4ac245ca3248da5de716d54c4999 *tests/testthat/test-package-info.R da22ea0f764cf242db2d09a9ea4c3dfe *tests/testthat/test-platform-info.R 691f38098564b2bfe0776e057b3c9238 *tests/testthat/test-printing.R a18e58497994cfd38ea135fbf2fd98f2 *tests/testthat/test-session-info.R d361c38f2b5f6df4068e0bf35112fca0 *tests/testthat/test-utils.R f1da9635cdf39d8e9ec52e8a55376478 *tests/testthat/test-warnings.R sessioninfo/DESCRIPTION0000644000176200001440000000144113370075702014323 0ustar liggesusersPackage: sessioninfo Title: R Session Information Version: 1.1.1 Author: Gábor Csárdi, R core, Hadley Wickham, Winston Chang, Robert M Flight, Kirill Müller, Jim Hester Maintainer: Gábor Csárdi Description: Query and print information about the current R session. It is similar to 'utils::sessionInfo()', but includes more information about packages, and where they were installed from. License: GPL-2 LazyData: true URL: https://github.com/r-lib/sessioninfo#readme BugReports: https://github.com/r-lib/sessioninfo/issues RoxygenNote: 6.1.0 Suggests: callr, covr, mockery, testthat Imports: cli, tools, utils, withr Encoding: UTF-8 NeedsCompilation: no Packaged: 2018-11-05 16:32:45 UTC; gaborcsardi Repository: CRAN Date/Publication: 2018-11-05 17:20:02 UTC sessioninfo/man/0000755000176200001440000000000013352422704013366 5ustar liggesuserssessioninfo/man/platform_info.Rd0000644000176200001440000000255313333006545016521 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/platform-info.R \name{platform_info} \alias{platform_info} \title{Information about the current platform} \usage{ platform_info() } \value{ A list with elements: \itemize{ \item \code{version}: the R version string. \item \code{os}: the OS name in human readable format, see \code{\link[=os_name]{os_name()}}. \item \code{system}: CPU, and machine readable OS name, separated by a comma. \item \code{ui}: the user interface, e.g. \code{Rgui}, \code{RTerm}, etc. see \code{GUI} in \link[base:.Platform]{base::.Platform}. \item \code{language}: The current language setting. The \code{LANGUAGE} environment variable, if set, or \code{(EN)} if unset. \item \code{collate}: Collation rule, from the current locale. \item \code{ctype}: Native character encoding, from the current locale. \item \code{tz}: The current time zone. \item \code{date}: The current date. } } \description{ Information about the current platform } \examples{ platform_info() } \seealso{ Similar functions and objects in the base packages: \link[base:R.version.string]{base::R.version.string}, \code{\link[utils:sessionInfo]{utils::sessionInfo()}}, \link[base:version]{base::version}, \link[base:.Platform]{base::.Platform}, \code{\link[base:Sys.getlocale]{base::Sys.getlocale()}}, \code{\link[base:Sys.timezone]{base::Sys.timezone()}}. } sessioninfo/man/package_info.Rd0000644000176200001440000000437713352422704016276 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package-info.R \name{package_info} \alias{package_info} \title{Information about the currently loaded packages, or about a chosen set} \usage{ package_info(pkgs = NULL, include_base = FALSE, dependencies = NA) } \arguments{ \item{pkgs}{Either a vector of package names or NULL. If \code{NULL}, displays all loaded packages. If a character vector, also, includes all dependencies of the package.} \item{include_base}{Include base packages in summary? By default this is false since base packages should always match the R version.} \item{dependencies}{Whether to include the (recursive) dependencies as well. See the \code{dependencies} argument of \code{\link[utils:install.packages]{utils::install.packages()}}.} } \value{ A data frame with columns: \itemize{ \item \code{package}: package name. \item \code{ondiskversion}: package version (on the disk, which is sometimes not the same as the loaded version). \item \code{loadedversion}: package version. This is the version of the loaded namespace if \code{pkgs} is \code{NULL}, and it is the version of the package on disk otherwise. The two of them are almost always the same, though. \item \code{path}: path to the package on disk. \item \code{loadedpath}: the path the package was originally loaded from. \item \code{attached}: logical, whether the package is attached to the search path. \item \code{is_base}: logical, whether the package is a base package. \item \code{date}: the date the package was installed or built. \item \code{source}: where the package was installed from. E.g. \code{CRAN}, \code{GitHub}, \code{local} (from the local machine), etc. \item \code{md5ok}: Whether MD5 hashes for package DLL files match, on Windows. \code{NA} on other platforms. \item \code{library}: factor, which package library the package was loaded from. For loaded packages, this is (the factor representation of) \code{loadedpath}, for others \code{path}. } See \code{\link[=session_info]{session_info()}} for the description of the \emph{printed} columns by \code{package_info} (as opposed to the \emph{returned} columns). } \description{ Information about the currently loaded packages, or about a chosen set } \examples{ package_info() package_info("sessioninfo") } sessioninfo/man/os_name.Rd0000644000176200001440000000106013164511375015277 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/osname.R \name{os_name} \alias{os_name} \title{Human readable name of the current operating system} \usage{ os_name() } \value{ A character scalar. } \description{ For example Windows 8.1 instead of Windows version 6.3.9600. On macOS it includes the code names, on Linux it includes the distribution names and codenames if appropriate. } \details{ It uses \code{\link[utils:sessionInfo]{utils::sessionInfo()}}, but simplifies its output a bit on Windows, to make it more concise. } sessioninfo/man/session_info.Rd0000644000176200001440000000344313164511375016363 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/session-info.R \name{session_info} \alias{session_info} \title{Print session information} \usage{ session_info(pkgs = NULL, include_base = FALSE) } \arguments{ \item{pkgs}{Either a vector of package names or NULL. If \code{NULL}, displays all loaded packages. If a character vector, also, includes all dependencies of the package.} \item{include_base}{Include base packages in summary? By default this is false since base packages should always match the R version.} } \description{ This is \code{\link[utils:sessionInfo]{utils::sessionInfo()}} re-written from scratch to both exclude data that's rarely useful (e.g., the full collate string or base packages loaded) and include stuff you'd like to know (e.g., where a package was installed from). } \details{ Columns in the \emph{printed} package list: \itemize{ \item \code{package}: package name \item \code{*}: whether the package is attached to the search path \item \code{version}: package version. If the version is marked with \code{(!)} that means that the loaded and the on-disk version of the package are different. \item \code{date}: when the package was built, if this information is available. This is the \code{Date/Publication} or the \code{Built} field from \code{DESCRIPTION}. (These are usually added automatically by R.) Sometimes this data is not available, then it is \code{NA}. \item \code{source}: where the package was built or installed from, if available. Examples: \code{CRAN (R 3.3.2)}, \code{Github (r-lib/pkgbuild@8aab60b)}, \code{Bioconductor}, \code{local}. } See \code{\link[=package_info]{package_info()}} for the list of columns in the data frame that is \emph{returned} (as opposed to \emph{printed}). } \examples{ session_info() session_info("sessioninfo") }