summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-22 11:14:55 -0600
committerJeff Carr <[email protected]>2024-11-22 11:14:55 -0600
commit5f65e4f4bed438ae30ba90ab334e0e0ab9bfdefa (patch)
tree40f84150f475ee802b2a650c4b00f2a47f074783
parent3ba652743c8f73dffb645ae574c2549f1b000466 (diff)
name fixups
-rw-r--r--repo.proto2
-rw-r--r--sampleConfig.go4
-rw-r--r--settings.go22
3 files changed, 25 insertions, 3 deletions
diff --git a/repo.proto b/repo.proto
index cef8607..9a966e4 100644
--- a/repo.proto
+++ b/repo.proto
@@ -24,7 +24,7 @@ message Repo {
string develBranch = 9; // whatever the git 'devel' branch name is
string userBranch = 10; // whatever your username branch is
- string debname = 11; // the actual name used with 'apt install' (or distro apt equivalent.
+ string debName = 11; // the actual name used with 'apt install' (or distro apt equivalent.
// todo: appeal to everyone to alias 'apt' on rhat, gentoo, arch, etc to alias 'apt install'
// so we can make easier instructions for new linux users. KISS
diff --git a/sampleConfig.go b/sampleConfig.go
index 39e47bf..fc83f6f 100644
--- a/sampleConfig.go
+++ b/sampleConfig.go
@@ -19,7 +19,7 @@ func (all *Repos) SampleConfig() {
new1 = new(Repo)
new1.GoPath = "go.wit.com/apps/zookeeper"
- new1.Debname = "zookeeper-go"
+ new1.DebName = "zookeeper-go"
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
} else {
@@ -37,7 +37,7 @@ func (all *Repos) SampleConfig() {
new1 = new(Repo)
new1.GoPath = "go.wit.com/apps/networkQuality"
- new1.Debname = "networkquality"
+ new1.DebName = "networkquality"
new1.ReadOnly = true
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
diff --git a/settings.go b/settings.go
index afe5e8a..0e23764 100644
--- a/settings.go
+++ b/settings.go
@@ -10,6 +10,7 @@ package forgepb
*/
import (
+ "path/filepath"
"strings"
)
@@ -108,3 +109,24 @@ func (all *Repos) IsPrivate(gopath string) bool {
// otherwise, assume not private
return match.Private
}
+
+// returns the deb package
+func (all *Repos) DebName(gopath string) string {
+
+ normalBase := filepath.Base(gopath)
+
+ loop := all.SortByPath()
+ for loop.Scan() {
+ r := loop.Repo()
+ if r.GoPath == gopath {
+ // if private is set here, then ok, otherwise
+ // still check if a Directory match exists
+ if r.DebName == "" {
+ return r.DebName
+ } else {
+ return normalBase
+ }
+ }
+ }
+ return normalBase
+}