Update Vendors (#337)
* update & migrate gitea sdk (Fix Delete Tag Issue) * upgraded github.com/AlecAivazis/survey v2.2.7 => v2.2.8 * upgraded github.com/adrg/xdg v0.2.3 => v0.3.1 * upgraded github.com/araddon/dateparse * upgraded github.com/olekukonko/tablewriter v0.0.4 => v0.0.5 * upgraded gopkg.in/yaml.v2 v2.3.0 => v2.4.0 Reviewed-on: https://gitea.com/gitea/tea/pulls/337 Reviewed-by: Norwin <noerw@noreply.gitea.io> Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de>
This commit is contained in:
32
vendor/github.com/adrg/xdg/base_dirs.go
generated
vendored
32
vendor/github.com/adrg/xdg/base_dirs.go
generated
vendored
@@ -1,7 +1,5 @@
|
||||
package xdg
|
||||
|
||||
import "os"
|
||||
|
||||
// XDG Base Directory environment variables.
|
||||
const (
|
||||
envDataHome = "XDG_DATA_HOME"
|
||||
@@ -10,6 +8,7 @@ const (
|
||||
envConfigDirs = "XDG_CONFIG_DIRS"
|
||||
envCacheHome = "XDG_CACHE_HOME"
|
||||
envRuntimeDir = "XDG_RUNTIME_DIR"
|
||||
envStateHome = "XDG_STATE_HOME"
|
||||
)
|
||||
|
||||
type baseDirectories struct {
|
||||
@@ -21,6 +20,7 @@ type baseDirectories struct {
|
||||
runtime string
|
||||
|
||||
// Non-standard directories.
|
||||
stateHome string
|
||||
fonts []string
|
||||
applications []string
|
||||
}
|
||||
@@ -38,29 +38,13 @@ func (bd baseDirectories) cacheFile(relPath string) (string, error) {
|
||||
}
|
||||
|
||||
func (bd baseDirectories) runtimeFile(relPath string) (string, error) {
|
||||
fi, err := os.Lstat(bd.runtime)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return createPath(relPath, []string{bd.runtime})
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
|
||||
if fi.IsDir() {
|
||||
// The runtime directory must be owned by the user.
|
||||
if err = chown(bd.runtime, os.Getuid(), os.Getgid()); err != nil {
|
||||
return "", err
|
||||
}
|
||||
} else {
|
||||
// For security reasons, the runtime directory cannot be a symlink.
|
||||
if err = os.Remove(bd.runtime); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
return createPath(relPath, []string{bd.runtime})
|
||||
}
|
||||
|
||||
func (bd baseDirectories) stateFile(relPath string) (string, error) {
|
||||
return createPath(relPath, []string{bd.stateHome})
|
||||
}
|
||||
|
||||
func (bd baseDirectories) searchDataFile(relPath string) (string, error) {
|
||||
return searchFile(relPath, append([]string{bd.dataHome}, bd.data...))
|
||||
}
|
||||
@@ -76,3 +60,7 @@ func (bd baseDirectories) searchCacheFile(relPath string) (string, error) {
|
||||
func (bd baseDirectories) searchRuntimeFile(relPath string) (string, error) {
|
||||
return searchFile(relPath, []string{bd.runtime})
|
||||
}
|
||||
|
||||
func (bd baseDirectories) searchStateFile(relPath string) (string, error) {
|
||||
return searchFile(relPath, []string{bd.stateHome})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user