diff options
| author | Jeff Carr <[email protected]> | 2025-10-14 06:18:38 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-14 06:33:14 -0500 |
| commit | 37e10c58d67cb1abb15c2f345f4e6800ab7065b2 (patch) | |
| tree | e5676c7c5bc20c09dce2c31a72fc01174175da02 /doDistro.go | |
| parent | a7d9ba18a64d53010c08285c14804c07b4e8c8fb (diff) | |
hammering it into form
Diffstat (limited to 'doDistro.go')
| -rw-r--r-- | doDistro.go | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/doDistro.go b/doDistro.go deleted file mode 100644 index f8034cd..0000000 --- a/doDistro.go +++ /dev/null @@ -1,87 +0,0 @@ -package main - -/* -func doDistro() error { - log.Println("--- Starting Debian repository generation in Go ---") - - // 1. Clean and create directory structure - distPath := filepath.Join(distsDir, dist) - log.Printf("Cleaning up old dists directory: %s\n", distPath) - if err := os.RemoveAll(distPath); err != nil { - return err - } - - log.Println("Creating new directory structure...") - for _, arch := range architectures { - binPath := filepath.Join(distPath, component, "binary-"+arch) - if err := os.MkdirAll(binPath, 0755); err != nil { - log.Printf("Failed to create directory %s: %v\n", binPath, err) - return err - } - } - - // 2. Scan pool directory for .deb files and gather info - log.Printf("Scanning for .deb files in %s\n", poolDir) - debInfos, err := scanDebs(poolDir, -1) - if err != nil { - log.Printf("Failed to scan .deb files: %v\n", err) - return err - } - log.Printf("Found %d total .deb packages.", len(debInfos)) - - // 3. Group packages by architecture - debsByArch := make(map[string][]DebInfo) - for _, deb := range debInfos { - arch := deb.ControlData["Architecture"] - debsByArch[arch] = append(debsByArch[arch], deb) - } - // Add the 'all' packages to each specific architecture list as well, as is standard. - for _, arch := range architectures { - if arch != "all" { - debsByArch[arch] = append(debsByArch[arch], debsByArch["all"]...) - } - } - - // 4. Generate Packages files - log.Println("Generating Packages files...") - for _, arch := range architectures { - binPath := filepath.Join(distPath, component, "binary-"+arch) - packagesFile := filepath.Join(binPath, "Packages") - - var content strings.Builder - for _, deb := range debsByArch[arch] { - for key, val := range deb.ControlData { - fmt.Fprintf(&content, "%s: %s\n", key, val) - } - fmt.Fprintf(&content, "Filename: %s\n", deb.Filename) - fmt.Fprintf(&content, "Size: %d\n", deb.Size) - fmt.Fprintf(&content, "MD5sum: %s\n", deb.MD5Sum) - fmt.Fprintf(&content, "SHA1: %s\n", deb.SHA1Sum) - fmt.Fprintf(&content, "SHA256: %s\n", deb.SHA256Sum) - fmt.Fprintln(&content) - } - - if err := os.WriteFile(packagesFile, []byte(content.String()), 0644); err != nil { - return err - } - - // Compress the Packages file - if err := compressFile(packagesFile, "gz"); err != nil { - return err - } - if err := compressFile(packagesFile, "bz2"); err != nil { - return err - } - } - - // 5. Generate and sign the Release file - log.Println("Generating and signing Release file...") - if err := generateAndSignReleaseFile(distPath); err != nil { - log.Printf("Failed to generate or sign Release file: %v\n", err) - return err - } - - log.Println("--- Repository generation complete! ---") - return nil -} -*/ |
