aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/packages/descriptor.go3
-rw-r--r--models/packages/package.go6
-rw-r--r--models/packages/package_file.go2
3 files changed, 10 insertions, 1 deletions
diff --git a/models/packages/descriptor.go b/models/packages/descriptor.go
index 9256dd5630..1cac2eb022 100644
--- a/models/packages/descriptor.go
+++ b/models/packages/descriptor.go
@@ -25,6 +25,7 @@ import (
"code.gitea.io/gitea/modules/packages/nuget"
"code.gitea.io/gitea/modules/packages/pub"
"code.gitea.io/gitea/modules/packages/pypi"
+ "code.gitea.io/gitea/modules/packages/rpm"
"code.gitea.io/gitea/modules/packages/rubygems"
"code.gitea.io/gitea/modules/packages/swift"
"code.gitea.io/gitea/modules/packages/vagrant"
@@ -163,6 +164,8 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc
metadata = &pub.Metadata{}
case TypePyPI:
metadata = &pypi.Metadata{}
+ case TypeRpm:
+ metadata = &rpm.VersionMetadata{}
case TypeRubyGems:
metadata = &rubygems.Metadata{}
case TypeSwift:
diff --git a/models/packages/package.go b/models/packages/package.go
index cc860b9a90..a817ab6ff1 100644
--- a/models/packages/package.go
+++ b/models/packages/package.go
@@ -44,6 +44,7 @@ const (
TypeNuGet Type = "nuget"
TypePub Type = "pub"
TypePyPI Type = "pypi"
+ TypeRpm Type = "rpm"
TypeRubyGems Type = "rubygems"
TypeSwift Type = "swift"
TypeVagrant Type = "vagrant"
@@ -64,6 +65,7 @@ var TypeList = []Type{
TypeNuGet,
TypePub,
TypePyPI,
+ TypeRpm,
TypeRubyGems,
TypeSwift,
TypeVagrant,
@@ -100,6 +102,8 @@ func (pt Type) Name() string {
return "Pub"
case TypePyPI:
return "PyPI"
+ case TypeRpm:
+ return "RPM"
case TypeRubyGems:
return "RubyGems"
case TypeSwift:
@@ -141,6 +145,8 @@ func (pt Type) SVGName() string {
return "gitea-pub"
case TypePyPI:
return "gitea-python"
+ case TypeRpm:
+ return "gitea-rpm"
case TypeRubyGems:
return "gitea-rubygems"
case TypeSwift:
diff --git a/models/packages/package_file.go b/models/packages/package_file.go
index 28e2a0111a..1c2c9ac072 100644
--- a/models/packages/package_file.go
+++ b/models/packages/package_file.go
@@ -118,7 +118,7 @@ func DeleteFileByID(ctx context.Context, fileID int64) error {
// PackageFileSearchOptions are options for SearchXXX methods
type PackageFileSearchOptions struct {
OwnerID int64
- PackageType string
+ PackageType Type
VersionID int64
Query string
CompositeKey string