aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-13 12:19:39 +0200
committerGitHub <noreply@github.com>2022-10-13 18:19:39 +0800
commit0e58201d1a8247561809d832eb8f576e05e5d26d (patch)
treed179aa644701a97f5a0a4ae7bcf5e78d52768387 /modules
parentc35531dd118ad8fe8ff0c7aa27bb925fb46f09af (diff)
downloadgitea-0e58201d1a8247561809d832eb8f576e05e5d26d.tar.gz
gitea-0e58201d1a8247561809d832eb8f576e05e5d26d.zip
Add support for Chocolatey/NuGet v2 API (#21393)
Fixes #21294 This PR adds support for NuGet v2 API. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/packages/nuget/metadata.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/packages/nuget/metadata.go b/modules/packages/nuget/metadata.go
index 797bff45ac..2b555e47e9 100644
--- a/modules/packages/nuget/metadata.go
+++ b/modules/packages/nuget/metadata.go
@@ -55,12 +55,13 @@ type Package struct {
// Metadata represents the metadata of a Nuget package
type Metadata struct {
- Description string `json:"description,omitempty"`
- ReleaseNotes string `json:"release_notes,omitempty"`
- Authors string `json:"authors,omitempty"`
- ProjectURL string `json:"project_url,omitempty"`
- RepositoryURL string `json:"repository_url,omitempty"`
- Dependencies map[string][]Dependency `json:"dependencies,omitempty"`
+ Description string `json:"description,omitempty"`
+ ReleaseNotes string `json:"release_notes,omitempty"`
+ Authors string `json:"authors,omitempty"`
+ ProjectURL string `json:"project_url,omitempty"`
+ RepositoryURL string `json:"repository_url,omitempty"`
+ RequireLicenseAcceptance bool `json:"require_license_acceptance"`
+ Dependencies map[string][]Dependency `json:"dependencies,omitempty"`
}
// Dependency represents a dependency of a Nuget package
@@ -155,12 +156,13 @@ func ParseNuspecMetaData(r io.Reader) (*Package, error) {
}
m := &Metadata{
- Description: p.Metadata.Description,
- ReleaseNotes: p.Metadata.ReleaseNotes,
- Authors: p.Metadata.Authors,
- ProjectURL: p.Metadata.ProjectURL,
- RepositoryURL: p.Metadata.Repository.URL,
- Dependencies: make(map[string][]Dependency),
+ Description: p.Metadata.Description,
+ ReleaseNotes: p.Metadata.ReleaseNotes,
+ Authors: p.Metadata.Authors,
+ ProjectURL: p.Metadata.ProjectURL,
+ RepositoryURL: p.Metadata.Repository.URL,
+ RequireLicenseAcceptance: p.Metadata.RequireLicenseAcceptance,
+ Dependencies: make(map[string][]Dependency),
}
for _, group := range p.Metadata.Dependencies.Group {