nixpkgs/pkgs/by-name/au/autorandr/0001-don-t-use-sys.executable.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

34 lines
1.2 KiB
Diff

From fdcc2f01441ec25104456022e6f8d3120709cede Mon Sep 17 00:00:00 2001
From: Romanos Skiadas <rom.skiad@gmail.com>
Date: Tue, 28 Jun 2022 06:16:10 +0300
Subject: [PATCH] don't use sys.executable
This is required for forking self in a nixpkgs environment,
where arandr might be wrapped. In that case, the actual arandr command
will be a bash script, not python.
There is no real reason to keep this around, nixpkgs properly sets the
interpreter in the shebang anyway.
---
autorandr.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git autorandr.py autorandr.py
index 35c15f6..1e84a2f 100755
--- a/autorandr.py
+++ b/autorandr.py
@@ -1192,10 +1192,7 @@ def dispatch_call_to_sessions(argv):
os.chdir(pwent.pw_dir)
os.environ.clear()
os.environ.update(process_environ)
- if sys.executable != "" and sys.executable != None:
- os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:])
- else:
- os.execl(autorandr_binary, autorandr_binary, *argv[1:])
+ os.execl(autorandr_binary, autorandr_binary, *argv[1:])
sys.exit(1)
os.waitpid(child_pid, 0)
--
2.36.1