deepin.dde-api: dont set PATH

This commit is contained in:
rewine 2023-04-12 11:36:43 +08:00
parent 136e1d9aa3
commit 03ec4a637a
No known key found for this signature in database
GPG key ID: AABB329787290824
3 changed files with 56 additions and 41 deletions

View file

@ -0,0 +1,54 @@
From 47952eb3dfeea945a070496ef6f77e8446d42f86 Mon Sep 17 00:00:00 2001
From: rewine <lhongxu@outlook.com>
Date: Tue, 21 Mar 2023 10:36:20 +0800
Subject: [PATCH] chore: dont set PATH env
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Log: dbus 环境缺失环境变量应该由 dbus-update-activation-environment 处理 ,不应该由 dde-api 设置 PATH
---
device/main.go | 2 --
locale-helper/main.go | 2 --
2 files changed, 4 deletions(-)
diff --git a/device/main.go b/device/main.go
index 6c5404c..261f109 100644
--- a/device/main.go
+++ b/device/main.go
@@ -5,7 +5,6 @@
package main
import (
- "os"
"time"
"github.com/linuxdeepin/go-lib/dbusutil"
@@ -15,7 +14,6 @@ import (
var logger = log.NewLogger(dbusServiceName)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
service, err := dbusutil.NewSystemService()
if err != nil {
logger.Fatal("failed to new system service:", err)
diff --git a/locale-helper/main.go b/locale-helper/main.go
index 92e1ddb..5e3a2ff 100644
--- a/locale-helper/main.go
+++ b/locale-helper/main.go
@@ -5,7 +5,6 @@
package main
import (
- "os"
"os/exec"
"sync"
"time"
@@ -45,7 +44,6 @@ var (
)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
logger.BeginTracing()
defer logger.EndTracing()

View file

@ -1,39 +0,0 @@
From c8f597bd7286a76e7ce371e4f7982d9d2700868a Mon Sep 17 00:00:00 2001
From: rewine <luhongxu@deepin.org>
Date: Wed, 28 Dec 2022 23:06:53 +0800
Subject: [PATCH] fix PATH for NixOS
---
device/main.go | 2 +-
locale-helper/main.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/device/main.go b/device/main.go
index 6c5404c..f79bcfc 100644
--- a/device/main.go
+++ b/device/main.go
@@ -15,7 +15,7 @@ import (
var logger = log.NewLogger(dbusServiceName)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
+ os.Setenv("PATH", "/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
service, err := dbusutil.NewSystemService()
if err != nil {
logger.Fatal("failed to new system service:", err)
diff --git a/locale-helper/main.go b/locale-helper/main.go
index 0866e48..ef000b5 100644
--- a/locale-helper/main.go
+++ b/locale-helper/main.go
@@ -45,7 +45,7 @@ var (
)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
+ os.Setenv("PATH", "/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
logger.BeginTracing()
defer logger.EndTracing()
--
2.38.1

View file

@ -35,7 +35,7 @@ buildGoPackage rec {
sha256 = "sha256-F+vEOSpysqVtjs8de5mCmeANuCbYUQ860ZHl5rwNYac=";
};
patches = [ ./0001-fix-PATH-for-NixOS.patch ];
patches = [ ./0001-dont-set-PATH.patch ];
postPatch = ''
substituteInPlace lang_info/lang_info.go \
@ -47,7 +47,7 @@ buildGoPackage rec {
substituteInPlace sound-theme-player/main.go \
--replace "/usr/sbin/alsactl" "alsactl"
substituteInPlace misc/scripts/deepin-boot-sound.sh
substituteInPlace misc/scripts/deepin-boot-sound.sh \
--replace "/usr/bin/dbus-send" "${dbus}/bin/dbus-send"
substituteInPlace lunar-calendar/huangli.go adjust-grub-theme/main.go \