summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-09 20:00:39 -0500
committerJeff Carr <[email protected]>2025-10-09 20:06:39 -0500
commit5cc996fb000749369a339b850c1f2f2218892537 (patch)
tree4e6818c93fd5d6257d7fdfae0d993acdaadef736
parent6910b06ff957337af42f89c1a19072cb75c0ae74 (diff)
nearing ability to create dists/v0.0.16
-rw-r--r--argv.go15
-rw-r--r--doMakeDists.go17
-rw-r--r--doWalk.go22
-rw-r--r--main.go4
-rw-r--r--structs.go2
5 files changed, 43 insertions, 17 deletions
diff --git a/argv.go b/argv.go
index 5f99c69..fc12907 100644
--- a/argv.go
+++ b/argv.go
@@ -17,13 +17,14 @@ import (
var argv args
type args struct {
- List *EmptyCmd `arg:"subcommand:list" help:"show the packages"`
- Walk *EmptyCmd `arg:"subcommand:walk" help:"walk the filesystem for new .deb files"`
- Update *EmptyCmd `arg:"subcommand:update" help:"update the apt repo"`
- Incoming *EmptyCmd `arg:"subcommand:incoming" help:"handle the incoming directory"`
- DryRun bool `arg:"--dry-run" help:"only show what would be packaged"`
- Verbose bool `arg:"--verbose" help:"be loud about it"`
- Force bool `arg:"--force" help:"rebuild everything"`
+ List *EmptyCmd `arg:"subcommand:list" help:"show the packages"`
+ Walk *EmptyCmd `arg:"subcommand:walk" help:"walk the filesystem for new .deb files"`
+ Update *EmptyCmd `arg:"subcommand:update" help:"update the apt repo"`
+ Incoming *EmptyCmd `arg:"subcommand:incoming" help:"handle the incoming directory"`
+ MakeDists *EmptyCmd `arg:"subcommand:makedists" help:"make debian mirrors/dists files for 'apt update'"`
+ DryRun bool `arg:"--dry-run" help:"only show what would be packaged"`
+ Verbose bool `arg:"--verbose" help:"be loud about it"`
+ Force bool `arg:"--force" help:"rebuild everything"`
}
type EmptyCmd struct {
diff --git a/doMakeDists.go b/doMakeDists.go
new file mode 100644
index 0000000..fa61227
--- /dev/null
+++ b/doMakeDists.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "go.wit.com/log"
+)
+
+// os.Chdir(me.mirrorsDir)
+// makes the dists/ for 'apt update'
+func doMakeDists(mirrorshome string) (string, error) {
+ if me.pb.BaseDir != mirrorshome {
+ log.Info("Changing mirrors base directory", me.pb.BaseDir, mirrorshome)
+ me.pb.BaseDir = mirrorshome
+ }
+
+ s, err := me.pb.MakeDists()
+ return s, err
+}
diff --git a/doWalk.go b/doWalk.go
index a72fc5a..ae8af51 100644
--- a/doWalk.go
+++ b/doWalk.go
@@ -24,10 +24,11 @@ func doWalk() (string, error) {
var counter int
for _, deb := range debInfos {
newdeb := new(zoopb.Package)
- newdeb.Filename = deb.Filename
- newdeb.MD5SUM = deb.MD5Sum
- newdeb.SHA1 = deb.SHA1Sum
- newdeb.SHA256 = deb.SHA256Sum
+ newdeb.DebInfo = new(zoopb.DebInfo)
+ newdeb.DebInfo.Filename = deb.Filename
+ newdeb.DebInfo.MD5SUM = deb.MD5Sum
+ newdeb.DebInfo.SHA1 = deb.SHA1Sum
+ newdeb.DebInfo.SHA256 = deb.SHA256Sum
// log.Info("len(CONTROLDATA)", len(deb.ControlData))
// log.Sprintf("VAR='%s' VAL='%s'\n", varname, varvalue)
@@ -38,20 +39,21 @@ func doWalk() (string, error) {
newdeb.Package = varvalue
case "Version":
newdeb.Version = varvalue
+ case "Architecture":
+ newdeb.Architecture = varvalue
case "Git-Tag-Date":
log.Info("CONVERT THIS TO TIME", varname, varvalue)
case "Depends":
- newdeb.Depends = varvalue
+ newdeb.DebInfo.Depends = varvalue
case "Build-Depends":
- newdeb.BuildDepends = varvalue
- case "Architecture":
- newdeb.Architecture = varvalue
+ newdeb.DebInfo.BuildDepends = varvalue
case "Packager":
- newdeb.Packager = varvalue
+ newdeb.DebInfo.Packager = varvalue
case "Package-Build-Date":
varvalue = "PackageBuildDate"
+ log.Info("CONVERT THIS TO TIME", varname, varvalue)
case "URL":
- newdeb.URL = varvalue
+ newdeb.DebInfo.Homepage = varvalue
default:
if ok, err := debian.SetString(newdeb, varname, varvalue); ok {
continue
diff --git a/main.go b/main.go
index a1a5664..88a75f1 100644
--- a/main.go
+++ b/main.go
@@ -61,6 +61,10 @@ func main() {
err = doDistro()
}
+ if argv.MakeDists != nil {
+ s, err = doMakeDists("/home/mirrors/wit")
+ }
+
if err != nil {
me.sh.BadExit(s, err)
}
diff --git a/structs.go b/structs.go
index 7219b05..85083a6 100644
--- a/structs.go
+++ b/structs.go
@@ -3,6 +3,7 @@ package main
import (
"sync"
+ "go.wit.com/lib/config"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/zoopb"
)
@@ -37,4 +38,5 @@ type mainType struct {
sh *prep.Auto // more experiments for bash handling
pb *zoopb.Packages // the mirrors packages
mirrorsDir string // "/home/mirrors/wit")
+ config *config.Config // the mirrors packages
}