"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/code.gitea.io/sdk/gitea/version.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

version.go  (gitea-1.13.1):version.go  (gitea-1.13.2)
skipping to change at line 45 skipping to change at line 45
check, err := version.NewConstraint(constraint) check, err := version.NewConstraint(constraint)
if err != nil { if err != nil {
return err return err
} }
if !check.Check(c.serverVersion) { if !check.Check(c.serverVersion) {
return fmt.Errorf("gitea server at %s does not satisfy version co nstraint %s", c.url, constraint) return fmt.Errorf("gitea server at %s does not satisfy version co nstraint %s", c.url, constraint)
} }
return nil return nil
} }
// predefined versions only have to be parsed by library once
var (
version1_10_0, _ = version.NewVersion("1.10.0")
version1_11_0, _ = version.NewVersion("1.11.0")
version1_12_0, _ = version.NewVersion("1.12.0")
version1_13_0, _ = version.NewVersion("1.13.0")
)
// checkServerVersionGreaterThanOrEqual is internally used to speed up things an
d ignore issues with prerelease
func (c *Client) checkServerVersionGreaterThanOrEqual(v *version.Version) error
{
c.versionLock.RLock()
if c.serverVersion == nil {
c.versionLock.RUnlock()
if err := c.loadClientServerVersion(); err != nil {
return err
}
} else {
c.versionLock.RUnlock()
}
if !c.serverVersion.GreaterThanOrEqual(v) {
return fmt.Errorf("gitea server at %s is older than %s", c.url, v
.Original())
}
return nil
}
// loadClientServerVersion init the serverVersion variable // loadClientServerVersion init the serverVersion variable
func (c *Client) loadClientServerVersion() error { func (c *Client) loadClientServerVersion() error {
c.versionLock.Lock() c.versionLock.Lock()
defer c.versionLock.Unlock() defer c.versionLock.Unlock()
raw, _, err := c.ServerVersion() raw, _, err := c.ServerVersion()
if err != nil { if err != nil {
return err return err
} }
if c.serverVersion, err = version.NewVersion(raw); err != nil { if c.serverVersion, err = version.NewVersion(raw); err != nil {
 End of changes. 1 change blocks. 
0 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)