commit d66f755

chld  ·  2026-02-07 19:36:23 +0000 UTC
parent a4ccc26
m|mi|mic conventions
2 files changed,  +52, -23
+1, -7
 1@@ -29,7 +29,7 @@ i want it to be simple as possible for *my* personal use, doing things like
 2 - dependency handling
 3 - uhh basic package manager things
 4    
 5-for clarification `dgr` is **mostly NOT compatible** with any other [derive](https://derivelinux.org) package manager
 6+for clarification `dgr` is only **basically compatible** with any other [derive](https://derivelinux.org) package manager
 7 due to things like convenience my personal preference.
 8 
 9 some important points of differing:
10@@ -38,12 +38,6 @@ some important points of differing:
11 
12 but, some variables *are* set to ensure compatibility with `libdmake.sh`
13 
14-## faq
15-
16-### why just `m` to compile and install a package? isnt it supposed to be `mi`?
17-when building a package, you need to iwnstall dependencies to support the package.   
18-i figured it would kinda be useless to install everything but the main package, so i put `mi` out of favor.
19-   
20 ### inspirations
21 some mechanisms of `dgr` were inspired from the following package managers:
22 - [kiss](https://codeberg.org/kiss-community/kiss)
+51, -16
 1@@ -21,7 +21,7 @@ func help() {
 2 	// package mamagement
 3 	fmt.Printf("\t")
 4 	fmt.Printf("\033[m\033[1m%s \033[m\033[32m", filepath.Base(os.Args[0]))
 5-	fmt.Printf("[m|i|c|r]")
 6+	fmt.Printf("[m|mi|mic] [i|c|r]")
 7 	fmt.Printf("\033[m\t\tmanage ports\n")
 8 
 9 	// package management without compiling
10@@ -46,6 +46,34 @@ func cr(a string, b string) {
11 	}
12 }
13 
14+/*
15+	we gotta functionize (case "m")
16+
17+	due to compatibility to the bare minimum
18+	o_o
19+*/
20+
21+func dobuild(pkg string) {
22+	// get first level deps of pkg
23+	deps := dgrb.DepRes(pkg)
24+
25+	for i := range len(deps) {
26+		// second level deps
27+		sd := dgrb.DepRes(deps[i])
28+		for n := range len(sd) {
29+			dgrb.Build(sd[n], "make")
30+			dgrb.Inst(sd[n])
31+		}
32+
33+		dgrb.Build(deps[i], "make")
34+		dgrb.Inst(deps[i])
35+	}
36+
37+	// finally build the package itself
38+	dgrb.Build(pkg, "make")
39+	//dgrb.Inst(pkg)
40+}
41+
42 func main() {
43 	if len(os.Args) < 2 {
44 		help()
45@@ -172,26 +200,33 @@ func main() {
46 		dgre.VC("DTR_DIR")
47 
48 		for i := range pkgs {
49-			// get first level deps of pkg
50-			deps := dgrb.DepRes(pkgs[i])
51-
52-			for _, dep := range deps {
53-				// second level deps
54-				sd := dgrb.DepRes(dep)
55-				for n := range len(sd) {
56-					dgrb.Build(sd[n], "make")
57-					dgrb.Inst(sd[n])
58-				}
59+			dobuild(pkgs[i])
60+		}
61+	case "mi":
62+		if len(pkgs) < 1 {
63+			help()
64+			os.Exit(1)
65+		}
66 
67-				dgrb.Build(dep, "make")
68-				dgrb.Inst(dep)
69-			}
70+		dgre.VC("DTR_DIR")
71 
72-			// finally build the package itself
73-			dgrb.Build(pkgs[i], "make")
74+		for i := range pkgs {
75+			dobuild(pkgs[i])
76 			dgrb.Inst(pkgs[i])
77 		}
78+	case "mic":
79+		if len(pkgs) < 1 {
80+			help()
81+			os.Exit(1)
82+		}
83+
84+		dgre.VC("DTR_DIR")
85 
86+		for i := range pkgs {
87+			dobuild(pkgs[i])
88+			dgrb.Inst(pkgs[i])
89+			dgrb.Build(pkgs[i], "clean")
90+		}
91 	case "i":
92 		if len(pkgs) < 1 {
93 			help()