Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
update 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Jun 9, 2018
1 parent 70d0c4f commit 2e67ad1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions depends_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func findBinaryData(dir string) []string {
err := filepath.Walk(dir, func(p string, i os.FileInfo, e error) error {
pInfo, err := os.Stat(p)
checkError(err)
// skip zero-bit file
if pInfo.Size() == 0 { return nil }
// skip non-execuatable file
if !strings.Contains(pInfo.Mode().String(), "x") { return nil }

if !i.IsDir() {
if !(pInfo.Mode()&os.ModeSymlink != 0) {
Expand Down
24 changes: 20 additions & 4 deletions wps-installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ func main() {
panic("Must be root to exectuate this program")
}

wpsVer := "10.1.0.5707"
wpsAlpha := "a21"
wpsVer := "10.1.0.6634"
//wpsAlpha := "a21"
wpsArch := getArch()
wpsTar := "wps-office_" + wpsVer + "~" + wpsAlpha + "_" + wpsArch + ".tar.xz"
wpsURL := "http://kdl1.cache.wps.com/ksodl/download/linux/" + wpsAlpha + "//" + wpsTar
// http://kdl.cc.ksosoft.com/wps-community/download/6634/wps-office_10.1.0.6634_x86_64.tar.xz
wpsTar := "wps-office_" + wpsVer + "_" + wpsArch + ".tar.xz"
wpsURL := "http://kdl.cc.ksosoft.com/wps-community/download/6634/" + wpsTar
wpsTmp := "/tmp/"
wpsDir := "wps-office_" + wpsVer + "_" + wpsArch
wpsPrefix := wpsTmp + wpsDir
Expand Down Expand Up @@ -409,6 +410,21 @@ func main() {
_, err = exec.Command("/usr/bin/update-mime-database", "/usr/share/mime").Output()
checkError(err)

// install desktop-directories
createDir("/usr/share/desktop-directories")
dirs := findFilesByExt(wpsPrefix+"/resource/desktop-directories", ".directory")
for _, d := range dirs {
copyFile(d, "/usr/share/desktop-directories/"+filepath.Base(d))
}

// install templates
createDir("/usr/share/templates")
createDir("/usr/share/templates/.source")
templates := findFilesByExt(wpsPrefix+"/resource/templates", ".desktop")
for _, t := range templates {
copyFile(t, "/usr/share/templates/"+filepath.Base(t))
}

os.RemoveAll(wpsPrefix)

log.Println("Congratulations! Installation succeed!")
Expand Down

0 comments on commit 2e67ad1

Please sign in to comment.