commit ff15764

hovercats  ·  2026-09-09 19:37:58 +0000 UTC
parent e91ff0f
improve checking for submodule.
we also want to clear out src/ on builds, but we cant do that if a submodule is being used.
1 files changed,  +12, -3
M rcpm
M rcpm
+12, -3
 1@@ -23,10 +23,12 @@ if (~ $#rcpm_cache 0) {
 2 	}
 3 }
 4 
 5+fn is_module {grep -q pkg/$pkg/src ../../.gitmodules}
 6+
 7 fn dl_pkg {
 8 	cd $rcpm_path/$pkg
 9 	srcs=()
10-	if (test -f .submodule) {
11+	if (is_module) {
12 		git submodule update --init --checkout src
13 		git -C src clean -xfdq
14 		git -C src reset --hard
15@@ -127,9 +129,16 @@ fn install_pkg {
16 
17 fn build_pkg {
18 	chksum_pkg $pkg
19-	if (test -f url) unpack_pkg $archive
20+	if (test -f url) {
21+		if (is_module) unpack_pkg $archive
22+		if not {
23+			rm -rf src/
24+			unpack_pkg $archive
25+		}
26+	}
27 	if (test -d files/) {
28-		mkdir -p src/ && cp -Rf files/* src/
29+			mkdir -p src/
30+			cp -Rf files/* src/
31 	}
32 	cd src
33 	destdir=/tmp/$pid/$pkg/inn