commit 2d37ae2

hovercats  ·  2026-02-12 00:50:38 +0000 UTC
parent cb58252
improve how we fetch/reset submodules. submodules wasnt being properly reset and could potentially give us a dirty worktree when rebuilding.
1 files changed,  +10, -10
M rcpm
M rcpm
+10, -10
 1@@ -25,8 +25,15 @@ if (~ $#RCPM_CACHE 0) {
 2 
 3 fn rcpm_help log {'Usage: rcpm b|c|d||h|i|l|m|s'}
 4 
 5+fn fetch_git {
 6+	git submodule --quite update --init --checkout src
 7+	git -C src clean -xfdq
 8+	git -C src reset --hard
 9+}
10+
11 fn dl_pkg {
12 	cd $RCPM_PATH/$pkg
13+	if (test -f .submodule) fetch_git
14 	if (test -f url) {
15 		if (test -f sha256) {
16 			if (test ! -f `{awk '{print $2}' sha256}) curl -LK url -O
17@@ -101,17 +108,10 @@ fn install_pkg {
18 
19 fn build_pkg {
20 	cd $RCPM_PATH/$pkg
21-	if (test ! -f url) {
22-		git submodule update --init --checkout src
23-		git -C src clean -xfdq
24-	}
25-	if not {
26+	if (test -f .submodule) fetch_git
27+	if (test -f url) {
28 		chksum_pkg $pkg
29-		rm -rf src
30-		if (test -f fetch.rc) {
31-			./fetch.rc
32-		}
33-		if not unpack_pkg $archive
34+		unpack_pkg $archive
35 	}
36 	cd src
37 	destdir=/tmp/$pid/$pkg