-
Notifications
You must be signed in to change notification settings - Fork 0
/
paths_linux_test.go
58 lines (47 loc) · 2.22 KB
/
paths_linux_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// +build linux
package xdg_test
import (
"fmt"
"os"
"strconv"
)
var (
testUserHome = os.Getenv("HOME")
testDataHome = testUserHome + "/.local/share"
testDataDirs = "/usr/local/share:/usr/share"
testConfigHome = testUserHome + "/.config"
testConfigDirs = "/etc/xdg"
testCacheHome = testUserHome + "/.local/cache"
testRuntime = "/run/user/" + strconv.Itoa(os.Getuid())
testDesktop = testUserHome + "/Desktop"
testDownload = testUserHome + "/Downloads"
testDocuments = testUserHome + "/Documents"
testMusic = testUserHome + "/Music"
testPictures = testUserHome + "/Pictures"
testVideos = testUserHome + "/Videos"
testTemplates = testUserHome + "/Templates"
testPublic = testUserHome + "/Public"
testApplications = testUserHome + "/.local/share/applications:/usr/local/share/applications:/usr/share/applications"
testFonts = testUserHome + "/.fonts:" + testUserHome + "/.local/share/fonts:/usr/local/share/fonts:/usr/share/fonts"
testXDGDataHome = "/xdg/data"
testXDGDataDirs = "/xdg/data:/xdg/opt/data"
testXDGConfigHome = "/xdg/config"
testXDGConfigDirs = "/xdg/config:/xdg/opt/config"
testXDGCacheHome = "/xdg/cache"
testXDGRuntime = "/xdg/run"
testXDGDesktop = "/xdg/desktop"
testXDGDownload = "/xdg/download"
testXDGDocuments = "/xdg/documents"
testXDGMusic = "/xdg/music"
testXDGPictures = "/xdg/pictures"
testXDGVideos = "/xdg/videos"
testXDGTemplates = "/xdg/templates"
testXDGPublic = "/xdg/public"
testXDGApplications = "/xdg/data/applications:" + testUserHome + "/.local/share/applications:/usr/local/share/applications:/usr/share/applications:/xdg/data/applications:/xdg/opt/data/applications"
testXDGFonts = "/xdg/data/fonts:" + testUserHome + "/.fonts:" + testUserHome + "/.local/share/fonts:/usr/local/share/fonts:/usr/share/fonts:/xdg/data/fonts:/xdg/opt/data/fonts"
)
func init() {
os.Setenv("UID", fmt.Sprint(os.Getuid()))
}
// /xdg/data/applications:/root/.local/share/applications:/usr/local/share/applications:/usr/share/applications:/xdg/data/applications:/xdg/opt/data/applications !=
// /xdg/data/applications: /.local/share/applications:/usr/local/share/applications:/usr/share/applications:/xdg/data/applications:/xdg/opt/data/applications