Fix issues found testing stage 5 in a VM
- Calamares branding takes the version from VERSION at ISO build time - das-update tray hides its icon when updates were installed elsewhere (watches the xbps package database) - Installer removes guest tools of other hypervisors; the live image starts VBoxClient only inside VirtualBox - Live session no longer locks the screen while the installer runs - das-tools 0.2.0, das-installer 0.2.0, das-settings 0.4.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,9 @@ const (
|
||||
firstCheck = 2 * time.Minute
|
||||
checkInterval = 6 * time.Hour
|
||||
checkTimeout = 5 * time.Minute
|
||||
// How often to look for updates installed outside the tray: from a
|
||||
// separately started window, das-update --cli or xbps-install.
|
||||
pkgdbInterval = time.Minute
|
||||
)
|
||||
|
||||
type trayApp struct {
|
||||
@@ -29,6 +32,7 @@ type trayApp struct {
|
||||
checking bool
|
||||
notified []string // the updates the last notification was about
|
||||
window *exec.Cmd
|
||||
pkgdb time.Time // package database time at the last check
|
||||
}
|
||||
|
||||
func runTray() int {
|
||||
@@ -69,6 +73,12 @@ func runTray() int {
|
||||
})
|
||||
return false
|
||||
})
|
||||
glib.TimeoutSecondsAdd(uint(pkgdbInterval.Seconds()), func() bool {
|
||||
if t.notified != nil && !xbps.PkgdbTime().Equal(t.pkgdb) {
|
||||
t.check()
|
||||
}
|
||||
return true
|
||||
})
|
||||
gtk.Main()
|
||||
return 0
|
||||
}
|
||||
@@ -78,6 +88,7 @@ func (t *trayApp) check() {
|
||||
return
|
||||
}
|
||||
t.checking = true
|
||||
t.pkgdb = xbps.PkgdbTime()
|
||||
go func() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), checkTimeout)
|
||||
defer cancel()
|
||||
|
||||
@@ -4,11 +4,17 @@ package xbps
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// pkgdbGlob matches the package database, which xbps rewrites on every transaction.
|
||||
const pkgdbGlob = "/var/db/xbps/pkgdb-*.plist"
|
||||
|
||||
// Update is one package that a full system update would change.
|
||||
type Update struct {
|
||||
Name string
|
||||
@@ -46,6 +52,19 @@ func Check(ctx context.Context) ([]Update, error) {
|
||||
return updates, nil
|
||||
}
|
||||
|
||||
// PkgdbTime tells when the installed packages last changed: the modification
|
||||
// time of the package database, zero when it can't be read.
|
||||
func PkgdbTime() time.Time {
|
||||
paths, _ := filepath.Glob(pkgdbGlob)
|
||||
var latest time.Time
|
||||
for _, p := range paths {
|
||||
if fi, err := os.Stat(p); err == nil && fi.ModTime().After(latest) {
|
||||
latest = fi.ModTime()
|
||||
}
|
||||
}
|
||||
return latest
|
||||
}
|
||||
|
||||
// ParseDryRun parses "xbps-install -un" output: one transaction entry per
|
||||
// line, "<pkgver> <action> <arch> <repository> [sizes]". Other lines are skipped.
|
||||
func ParseDryRun(out string) []Update {
|
||||
|
||||
Reference in New Issue
Block a user