Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pakPublic

Commit8413821

Browse files
committed
Repo: remove rc, make it a link to stable, dev as well
* To save space we remove the `rc` tag, and make it a "link" to `stable`.* Similarly, to save space, we remove the `dev` symlink and make it a repo "link" to `stable`. (Symlinks are expanded then the files are deployed to GH Pages.)[ci skip]
1 parente8f6e53 commit8413821

File tree

1 file changed

+70
-14
lines changed

1 file changed

+70
-14
lines changed

‎R/push-packages.R‎

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -615,17 +615,10 @@ push_packages <- local({
615615
version<- unclass(package_version(
616616
desc::desc_get(file=paths[1],"Version")
617617
))[[1]]
618-
if (length(version)>=4&&version[4]==9999) {
619-
# rc is also pushed to devel, as devel should be the latest
620-
p1<- push_packages(paths,"rc",keep_old,dry_run,cleanup)
621-
p2<- push_packages(paths,"devel",keep_old,dry_run,cleanup)
622-
return(invisible(rbind(p1,p2)))
623-
}elseif (length(version)>=4&&version[4]>=9000) {
618+
if (length(version)>=4&&version[4]>=9000) {
624619
tag<-"devel"
625620
}else {
626-
# stable is also pushed to rc
627621
p1<- push_packages(paths,"stable",keep_old,dry_run,cleanup)
628-
p2<- push_packages(paths,"rc",keep_old,dry_run,cleanup)
629622
return(invisible(rbind(p1,p2)))
630623
}
631624
}
@@ -682,7 +675,8 @@ create_pak_repo <- local({
682675
read_metadata<- import_from("push_packages","read_metadata")
683676
sha256<- import_from("push_packages","sha256")
684677

685-
tags<- c("stable","rc","devel")
678+
tags<- c("stable","devel")
679+
tag_aliases<-list(stable= c("rc","dev"),devel=character())
686680

687681
cpu_map<- c(
688682
"arm64"="aarch64",
@@ -1045,7 +1039,13 @@ create_pak_repo <- local({
10451039
}
10461040
}
10471041

1048-
create_package_repo_tag<-function(root,workdir,tag,dry_run=FALSE) {
1042+
create_package_repo_tag<-function(
1043+
root,
1044+
workdir,
1045+
tag,
1046+
tag_aliases,
1047+
dry_run=FALSE
1048+
) {
10491049
data<- read_metadata(workdir,tag)
10501050
plat<- parse_platform(data$r.platform)
10511051
cpu<-cpu_map[plat$cpu] %NA%plat$cpu
@@ -1096,9 +1096,61 @@ create_pak_repo <- local({
10961096
create_packages_files(data,root,tag)
10971097

10981098
add_repo_links(root,tag)
1099+
for (aliasintag_aliases) {
1100+
add_repo_tag_alias(root,tag,alias)
1101+
}
1102+
}
1103+
1104+
add_repo_tag_alias<-function(root,tag,alias) {
1105+
pkg_files<- dir(
1106+
file.path(root,tag),
1107+
pattern="^PACKAGES$",
1108+
recursive=TRUE
1109+
)
1110+
pkg_dirs<- dirname(pkg_files)
1111+
for (pkg_dirinpkg_dirs) {
1112+
link<- file.path(root,alias,pkg_dir)
1113+
mkdirp(link)
1114+
origfile<- file.path(root,tag,pkg_dir,"PACKAGES")
1115+
linkfile<- file.path(link,"PACKAGES")
1116+
file.copy(origfile,linkfile,overwrite=TRUE)
1117+
lines<- readLines(origfile)
1118+
paths<- grepl("^Path:",lines)
1119+
if (sum(paths)>0) {
1120+
lines[paths]<- sub(
1121+
"[.][.]/(?=[a-z])",
1122+
paste0("../../",tag,"/"),
1123+
lines[paths],
1124+
perl=TRUE
1125+
)
1126+
}else {
1127+
lines<- c(lines,"")
1128+
entry<- paste0(
1129+
"Path:",
1130+
strrep("../", str_count(pkg_dir,"/")+2),
1131+
tag,
1132+
"/",
1133+
pkg_dir,
1134+
"\n"
1135+
)
1136+
lines[nchar(lines)==0]<-entry
1137+
}
1138+
writeLines(lines,linkfile)
1139+
tab<- read.dcf(linkfile,all=TRUE)
1140+
write_dcf(tab,linkfile,quiet=TRUE)
1141+
}
10991142
}
11001143

1101-
create_pak_repo<-function(path="repo",dry_run=FALSE,cleanup=TRUE) {
1144+
str_count<-function(str,chr) {
1145+
sum(charToRaw(str)== charToRaw(chr))
1146+
}
1147+
1148+
create_pak_repo<-function(
1149+
path="repo",
1150+
aliases=NULL,
1151+
dry_run=FALSE,
1152+
cleanup=TRUE
1153+
) {
11021154
workdir<- package_dir()
11031155
if (!file.exists(workdir)) {
11041156
init_package_dir(workdir,dry_run=dry_run)
@@ -1114,9 +1166,13 @@ create_pak_repo <- local({
11141166
cat("\n",file= file.path(path,".nojekyll"))
11151167

11161168
for (tagintags) {
1117-
create_package_repo_tag(root,workdir,tag=tag,dry_run=dry_run)
1169+
create_package_repo_tag(
1170+
root,
1171+
workdir,
1172+
tag=tag,
1173+
tag_aliases=tag_aliases[[tag]],
1174+
dry_run=dry_run
1175+
)
11181176
}
1119-
1120-
file.symlink("stable", file.path(root,"dev"))
11211177
}
11221178
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp