@@ -72,13 +72,14 @@ libpath_touchstone <- function(ref) {
72
72
}
73
73
74
74
# ' When did the package sources change last?
75
- # '
75
+ # ' @inheritParams ref_install
76
76
# ' @keywords internal
77
- hash_pkg <- function () {
77
+ hash_pkg <- function (path_pkg ) {
78
+ withr :: local_dir(path_pkg )
78
79
list (
79
80
tools :: md5sum(c(
80
- fs :: dir_ls(" R" ),
81
- " DESCRIPTION" ,
81
+ if ( fs :: dir_exists( " R " )) fs :: dir_ls(" R" ),
82
+ if ( fs :: file_exists( " DESCRIPTION " )) " DESCRIPTION" ,
82
83
if (fs :: dir_exists(" scr" )) fs :: dir_info(" scr" )
83
84
))
84
85
)
@@ -91,15 +92,15 @@ hash_pkg <- function() {
91
92
# ' @inheritParams ref_install
92
93
# ' @keywords internal
93
94
cache_up_to_date <- function (ref , path_pkg ) {
94
- md5_hashes <- hash_pkg()
95
+ md5_hashes <- hash_pkg(path_pkg )
95
96
cache <- cache_get()
96
97
identical(md5_hashes , cache $ md5_hashes [cache $ ref == ref & cache $ path_pkg == path_pkg ])
97
98
}
98
99
99
100
# ' @rdname cache_up_to_date
100
101
# ' @keywords internal
101
102
cache_update <- function (ref , path_pkg ) {
102
- md5_hashes <- hash_pkg()
103
+ md5_hashes <- hash_pkg(path_pkg )
103
104
cache <- cache_get()
104
105
stopifnot(sum(cache $ ref [cache $ path_pkg == path_pkg ] == ref ) < = 1 )
105
106
cache <- cache [(! (cache $ ref == ref ) & (cache $ path_pkg == path_pkg )), ]
0 commit comments