Skip to content

Commit

Permalink
dep_pkg: drop support for Cpv attrs with Dep objects
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Jul 3, 2024
1 parent 92668c4 commit 591008c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
44 changes: 0 additions & 44 deletions dep_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,50 +208,6 @@ func (self *Dep) Repo() string {
return C.GoString(s)
}

// Return a package dependency's package and version.
func (self *Dep) P() string {
c_str := C.pkgcraft_dep_p(self.ptr)
defer C.pkgcraft_str_free(c_str)
return C.GoString(c_str)
}

// Return a package dependency's package, version, and revision.
func (self *Dep) Pf() string {
c_str := C.pkgcraft_dep_pf(self.ptr)
defer C.pkgcraft_str_free(c_str)
return C.GoString(c_str)
}

// Return a package dependency's revision.
func (self *Dep) Pr() string {
c_str := C.pkgcraft_dep_pr(self.ptr)
if c_str != nil {
defer C.pkgcraft_str_free(c_str)
return C.GoString(c_str)
}
return ""
}

// Return a package dependency's version.
func (self *Dep) Pv() string {
c_str := C.pkgcraft_dep_pv(self.ptr)
if c_str != nil {
defer C.pkgcraft_str_free(c_str)
return C.GoString(c_str)
}
return ""
}

// Return a package dependency's version and revision.
func (self *Dep) Pvr() string {
c_str := C.pkgcraft_dep_pvr(self.ptr)
if c_str != nil {
defer C.pkgcraft_str_free(c_str)
return C.GoString(c_str)
}
return ""
}

// Return a package dependency's Cpn.
func (self *Dep) Cpn() *Cpn {
ptr := C.pkgcraft_dep_cpn(self.ptr)
Expand Down
15 changes: 0 additions & 15 deletions dep_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ func TestDepAttrs(t *testing.T) {
assert.Equal(t, dep.Package(), "pkg")
assert.Equal(t, dep.Version(), &Version{})
assert.Equal(t, dep.Revision(), &Revision{})
assert.Equal(t, dep.P(), "pkg")
assert.Equal(t, dep.Pf(), "pkg")
assert.Equal(t, dep.Pr(), "")
assert.Equal(t, dep.Pv(), "")
assert.Equal(t, dep.Pvr(), "")
cpn, _ = NewCpn("cat/pkg")
assert.Equal(t, dep.Cpn(), cpn)
assert.Nil(t, dep.Cpv())
Expand All @@ -81,11 +76,6 @@ func TestDepAttrs(t *testing.T) {
assert.True(t, dep.Version().Cmp(ver) == 0)
rev, _ = NewRevision("2")
assert.Equal(t, dep.Revision(), rev)
assert.Equal(t, dep.P(), "pkg-1")
assert.Equal(t, dep.Pf(), "pkg-1-r2")
assert.Equal(t, dep.Pr(), "r2")
assert.Equal(t, dep.Pv(), "1")
assert.Equal(t, dep.Pvr(), "1-r2")
assert.Equal(t, dep.Cpn(), cpn)
cpv, _ = NewCpv("cat/pkg-1-r2")
assert.Equal(t, dep.Cpv(), cpv)
Expand Down Expand Up @@ -137,11 +127,6 @@ func TestDepAttrs(t *testing.T) {
assert.Equal(t, dep.SlotOp(), SlotOpEqual)
assert.Equal(t, dep.Use(), []string{"a", "b", "c"})
assert.Equal(t, dep.Repo(), "repo")
assert.Equal(t, dep.P(), "pkg-1")
assert.Equal(t, dep.Pf(), "pkg-1-r2")
assert.Equal(t, dep.Pr(), "r2")
assert.Equal(t, dep.Pv(), "1")
assert.Equal(t, dep.Pvr(), "1-r2")
assert.Equal(t, dep.Cpn(), cpn)
assert.Equal(t, dep.Cpv(), cpv)
assert.Equal(t, dep.String(), "!!=cat/pkg-1-r2:3/4=::repo[a,b,c]")
Expand Down

0 comments on commit 591008c

Please sign in to comment.