Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes from #235 #247

Merged
merged 9 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
module github.com/probonopd/go-appimage

go 1.19
go 1.20

require (
github.com/CalebQ42/squashfs v0.6.2
github.com/CalebQ42/squashfs v0.7.8
github.com/acobaugh/osrelease v0.1.0
github.com/adrg/xdg v0.4.0
github.com/alokmenghrajani/gpgeez v0.0.0-20161206084504-1a06f1c582f9
github.com/coreos/go-systemd/v22 v22.4.0
github.com/eclipse/paho.mqtt.golang v1.4.1
github.com/esiqveland/notify v0.11.1
github.com/fsnotify/fsnotify v1.6.0
github.com/godbus/dbus/v5 v5.1.0
github.com/google/go-github v17.0.0+incompatible
github.com/grandcat/zeroconf v1.0.0
Expand All @@ -19,7 +20,6 @@ require (
github.com/otiai10/copy v1.7.0
github.com/probonopd/go-zsyncmake v0.0.0-20181008012426-5db478ac2be7
github.com/prometheus/procfs v0.8.0
github.com/rjeczalik/notify v0.9.2
github.com/sabhiram/png-embed v0.0.0-20180421025336-149afe9a3ccb
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/shuheiktgw/go-travis v0.3.1
Expand All @@ -34,6 +34,7 @@ require (
)

require (
github.com/CalebQ42/fuse v0.1.0 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
Expand All @@ -43,16 +44,17 @@ require (
github.com/gorilla/websocket v1.4.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/compress v1.15.12 // indirect
github.com/miekg/dns v1.1.27 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/rustyoz/Mtransform v0.0.0-20190224104252-60c8c35a3681 // indirect
github.com/rustyoz/genericlexer v0.0.0-20190224115003-eb82fd2987bd // indirect
github.com/rustyoz/svg v0.0.0-20200706102315-fe1aeca2ba20 // indirect
github.com/sabhiram/pngr v0.0.0-20180419043407-2df49b015d4b // indirect
github.com/seaweedfs/fuse v1.2.2 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
Expand Down
22 changes: 13 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/CalebQ42/squashfs v0.6.2 h1:wGWLDxCMWI2CMrO5fZvw9qdBjM+mJaw/qa7gmqRcuOA=
github.com/CalebQ42/squashfs v0.6.2/go.mod h1:5qWmiXpaWlIxoqxpnFM21KsMecVXbBpQ8e5fgm1TToA=
github.com/CalebQ42/fuse v0.1.0 h1:KLCNjun7zcd2kBNVFfH+SWJyhuwJdE0nhw5/q8K8HGQ=
github.com/CalebQ42/fuse v0.1.0/go.mod h1:pJpoKG03HJKVhsp8o0YQYqmfbFsr3Eowt90yQGQVO+4=
github.com/CalebQ42/squashfs v0.7.8 h1:rXA2eS2RXogl1yEGDHrjXjKlYUESPeTp7kv0u1Kz/kE=
github.com/CalebQ42/squashfs v0.7.8/go.mod h1:b+/k1eXs5cc8m3BfXGf4tQyQPIsVSqJhhHzae1FpbhI=
github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE=
github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
Expand Down Expand Up @@ -31,6 +33,8 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3
github.com/esiqveland/notify v0.11.1 h1:bq6bHKiP9L2XcJDa2sWfIwgJ1Y5q6C4KtPDOsjPwTOQ=
github.com/esiqveland/notify v0.11.1/go.mod h1:63UbVSaeJwF0LVJARHFuPgUAoM7o1BEvCZyknsuonBc=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/gabriel-vasile/mimetype v1.4.1 h1:TRWk7se+TOjCYgRth7+1/OYLNiRNIotknkFtf/dnN7Q=
github.com/gabriel-vasile/mimetype v1.4.1/go.mod h1:05Vi0w3Y9c/lNvJOdmIwvrrAhX3rYhfQQCaf9VJcv7M=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
Expand Down Expand Up @@ -61,8 +65,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand All @@ -83,8 +87,8 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9
github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI=
github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand All @@ -96,8 +100,6 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e h1:dCWirM5F3wMY+cmRda/B1BiPsFtmzXqV9b0hLWtVBMs=
github.com/rasky/go-lzo v0.0.0-20200203143853-96a758eda86e/go.mod h1:9leZcVcItj6m9/CfHY5Em/iBrCz7js8LcRQGTKEEv2M=
github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/rustyoz/Mtransform v0.0.0-20190224104252-60c8c35a3681 h1:+MSiFc2Ocn6tXnJqPK6gD3gMlD/Ku878zak2apGUD0Y=
Expand All @@ -110,6 +112,8 @@ github.com/sabhiram/png-embed v0.0.0-20180421025336-149afe9a3ccb h1:AuqP2DCYGHIP
github.com/sabhiram/png-embed v0.0.0-20180421025336-149afe9a3ccb/go.mod h1:GwEonSgMIDQak3yZSNNKyrfVKJ23krN3Y/r51V8Ytr8=
github.com/sabhiram/pngr v0.0.0-20180419043407-2df49b015d4b h1:ks2d0TH6CtUISoThcRTP2jECmBMH3r/Dy1Q0GdfoD9E=
github.com/sabhiram/pngr v0.0.0-20180419043407-2df49b015d4b/go.mod h1:BzaQ/DolG+VD2GwnmGuSO5gx07vyW/CWNfkfVW71mSw=
github.com/seaweedfs/fuse v1.2.2 h1:01l8OjIdyATRNqVc/gDPgFobuC8ubQF3hRKOPColROw=
github.com/seaweedfs/fuse v1.2.2/go.mod h1:iwbDQv5BZACY54r6AO/6xsLNuMaYcBKSkLTZVfmK594=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
Expand Down Expand Up @@ -172,7 +176,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -186,6 +189,7 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
6 changes: 5 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ NoDisplay=true
EOF
fi
chmod +x $BUILDDIR/$PROG-$ARCH.AppDir/usr/bin/*
$BUILDDIR/appimagetool-x86_64.AppDir/usr/bin/appimagetool $BUILDDIR/$PROG-$ARCH.AppDir
if [ $PROG == "appimagetool" ]; then
$BUILDDIR/appimagetool-x86_64.AppDir/usr/bin/appimagetool $BUILDDIR/$PROG-$ARCH.AppDir
else
$BUILDDIR/appimagetool-$VERSION-x86_64.AppImage $BUILDDIR/$PROG-$ARCH.AppDir
fi
}

#############################################################
Expand Down
18 changes: 8 additions & 10 deletions src/appimaged/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is an experimental implementation of the optional AppImage daemon, `appimag

Assuming you are using a 64-bit Intel machine (amd64, also known as x86_64), you can use our pre-compiled binaries. To try it out, boot a Ubuntu, Debian, Fedora, openSUSE, elementary OS, KDE neon,... Live ISO and run:

```
```bash
# Remove pre-existing similar tools
systemctl --user stop appimaged.service || true
sudo apt-get -y remove appimagelauncher || true
Expand All @@ -27,28 +27,29 @@ chmod +x ~/Applications/appimaged-*.AppImage

## Removal

```
systemctl --user disable appimaged.service || true
systemctl --user stop appimaged.service || true
```bash
systemctl --user disable --now appimaged.service || true
rm ~/.config/systemd/user/appimaged.service
rm ~/.local/share/applications/appimagekit*.desktop
rm ~/Applications/appimaged-*-x86_64.AppImage
```

## Notes

Do not remove "~/Applications/appimaged*.AppImage". The service is running from this location (unless you want to do the uninstallation process)

The extension of AppImage files MUST be case-sensitive to be recognized by appimaged service.

Folders being watched for AppImage files:

* /usr/local/bin
* /opt
* ~/Applications
* ~/.local/bin
* ~/Downloads
* $PATH, which frequently includes /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, and other locations

https://github.com/probonopd/go-appimage/releases/tag/continuous has builds for 32-bit Intel, 32-bit ARM (e.g., Raspberry Pi), and 64-bit ARM.
<https://github.com/probonopd/go-appimage/releases/tag/continuous> has builds for 32-bit Intel, 32-bit ARM (e.g., Raspberry Pi), and 64-bit ARM.

## Features

Expand Down Expand Up @@ -79,9 +80,6 @@ Envisioned

If for whatever reason you would like to build from source:

```
sudo apt-get -y install gcc
if [ -z $GOPATH ] ; then export GOPATH=$HOME/go ; fi
go get github.com/probonopd/go-appimage/src/appimaged
go build -trimpath -ldflags="-s -w" github.com/probonopd/go-appimage/src/appimaged
```bash
scripts/build.sh appimaged
```
69 changes: 27 additions & 42 deletions src/appimaged/appimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"crypto/md5"
"encoding/hex"
"errors"
"net/url"

"gopkg.in/ini.v1"
Expand All @@ -30,7 +31,6 @@ type AppImage struct {
thumbnailfilename string
thumbnailfilepath string
updateinformation string
startup bool //used so we don't notify applications being added on startup
// offset int64
// rawcontents string
// niceName string
Expand All @@ -47,13 +47,9 @@ func NewAppImage(path string) (ai *AppImage, err error) {
ai.uri = strings.TrimSpace(string(uri.File(filepath.Clean(ai.Path))))
ai.md5 = ai.calculateMD5filenamepart() // Need this also for non-existing AppImages for removal
ai.desktopfilename = "appimagekit_" + ai.md5 + ".desktop"
ai.desktopfilepath = xdg.DataHome + "/applications/" + "appimagekit_" + ai.md5 + ".desktop"
ai.desktopfilepath = filepath.Join(xdg.DataHome, "applications", ai.desktopfilename)
ai.thumbnailfilename = ai.md5 + ".png"
if strings.HasSuffix(ThumbnailsDirNormal, "/") {
ai.thumbnailfilepath = ThumbnailsDirNormal + ai.thumbnailfilename
} else {
ai.thumbnailfilepath = ThumbnailsDirNormal + "/" + ai.thumbnailfilename
}
ai.thumbnailfilepath = filepath.Join(ThumbnailsDirNormal, ai.thumbnailfilename)
if err != nil {
return ai, err
}
Expand Down Expand Up @@ -98,17 +94,15 @@ func (ai AppImage) Validate() error {
return nil
}

// Do not call this directly. Instead, call IntegrateOrUnintegrate
// Integrate an AppImage into the system (put in menu, extract thumbnail)
// Can take a long time, hence run with "go"
func (ai AppImage) _integrate() {
// Do not call this directly. Instead, call AddIntegration
func (ai AppImage) _integrate() error {

// log.Println("integrate called on:", ai.path)

// Return immediately if the filename extension is not .AppImage or .app
if !strings.HasSuffix(strings.ToUpper(ai.Path), ".APPIMAGE") && !strings.HasSuffix(strings.ToUpper(ai.Path), ".APP") {
// log.Println("No .AppImage suffix:", ai.path)
return
return errors.New("incorrect extension")
}

ai.setExecBit()
Expand All @@ -127,7 +121,7 @@ func (ai AppImage) _integrate() {
if CheckIfConnectedToNetwork() {
go SubscribeMQTT(MQTTclient, ai.updateinformation)
}
return
return nil
}
}
}
Expand All @@ -140,7 +134,10 @@ func (ai AppImage) _integrate() {
// return
// }

writeDesktopFile(ai) // Do not run with "go" as it would interfere with extractDirIconAsThumbnail
err := writeDesktopFile(ai) // Do not run with "go" as it would interfere with extractDirIconAsThumbnail
if err != nil {
return err
}

// Subscribe to MQTT messages for this application
if ai.updateinformation != "" {
Expand All @@ -161,54 +158,42 @@ func (ai AppImage) _integrate() {
diff := thumbnailFileInfo.ModTime().Sub(appImageInfo.ModTime())
if diff > (time.Duration(0) * time.Second) {
// Do nothing if the thumbnail file is already newer than the AppImage file
return
return nil
}
}
}
// }

ai.extractDirIconAsThumbnail() // Do not run with "go" as it would interfere with writeDesktopFile

return ai.extractDirIconAsThumbnail() // Do not run with "go" as it would interfere with writeDesktopFile
}

// Do not call this directly. Instead, call IntegrateOrUnintegrate
func (ai AppImage) _removeIntegration() {
// Do not call this directly. Instead, call RemoveIntegration.
// We're simply trying to remove the files so we don't REALLY care about any errors that might or might not be returned.
func (ai AppImage) _unintegrate() {
log.Println("appimage: Remove integration", ai.Path)
err := os.Remove(ai.thumbnailfilepath)
if err == nil {
log.Println("appimage: Deleted", ai.thumbnailfilepath)
} else {
log.Println("appimage:", err, ai.thumbnailfilepath)
}

os.Remove(ai.thumbnailfilepath)
os.Remove(ai.desktopfilepath)
// Unsubscribe to MQTT messages for this application
if ai.updateinformation != "" {
go UnSubscribeMQTT(MQTTclient, ai.updateinformation)
}

err = os.Remove(ai.desktopfilepath)
if err == nil {
log.Println("appimage: Deleted", ai.desktopfilepath)
sendDesktopNotification("Removed", ai.Path, 3000)
} else {
log.Println("appimage:", err, ai.desktopfilename)
}
}

// IntegrateOrUnintegrate integrates or unintegrates
// (registers or unregisters) an AppImage from the system,
// depending on whether the file exists on disk. NEVER call this directly,
// ONLY have this called from a function that limits parallelism and ensures
// uniqueness of the AppImages to be processed
func (ai AppImage) IntegrateOrUnintegrate() bool {
if _, err := os.Stat(ai.Path); os.IsNotExist(err) {
ai._removeIntegration()
} else {
ai._integrate()
return true
}
return false
}
// func (ai AppImage) IntegrateOrUnintegrate() bool {
// if _, err := os.Stat(ai.Path); os.IsNotExist(err) {
// ai._removeIntegration()
// } else {
// ai._integrate()
// return true
// }
// return false
// }

// ReadUpdateInformation reads updateinformation from an AppImage
// Returns updateinformation string and error
Expand Down
Loading