@@ -40,7 +40,7 @@ type Platform struct {
4040Architecture string // The name of the architecture of this package.
4141Releases map [semver.NormalizedString ]* PlatformRelease // The Releases of this platform, labeled by version.
4242Package * Package `json:"-"`
43- ManuallyInstalled bool // true if the Platformhas been installed without the CLI
43+ ManuallyInstalled bool // true if the Platformexists due to a manually installed release
4444Deprecated bool // true if the latest PlatformRelease of this Platform has been deprecated
4545Indexed bool // true if the Platform has been indexed from additional-urls
4646Latest * semver.Version `json:"-"`
@@ -238,10 +238,10 @@ func (d *MonitorDependency) String() string {
238238// GetOrCreateRelease returns the specified release corresponding the provided version,
239239// or creates a new one if not found.
240240func (platform * Platform )GetOrCreateRelease (version * semver.Version )* PlatformRelease {
241- var tag semver.NormalizedString
242- if version != nil {
243- tag = version .NormalizedString ()
241+ if version == nil {
242+ version = semver .MustParse ("" )
244243}
244+ tag := version .NormalizedString ()
245245if release ,ok := platform .Releases [tag ];ok {
246246return release
247247}
@@ -257,6 +257,13 @@ func (platform *Platform) GetOrCreateRelease(version *semver.Version) *PlatformR
257257return release
258258}
259259
260+ // GetManuallyInstalledRelease returns (*PlatformRelease, true) if the Platform has
261+ // a manually installed release or (nil, false) otherwise.
262+ func (platform * Platform )GetManuallyInstalledRelease () (* PlatformRelease ,bool ) {
263+ res ,ok := platform .Releases [semver .MustParse ("" ).NormalizedString ()]
264+ return res ,ok
265+ }
266+
260267// FindReleaseWithVersion returns the specified release corresponding the provided version,
261268// or nil if not found.
262269func (platform * Platform )FindReleaseWithVersion (version * semver.Version )* PlatformRelease {