nixpkgs/pkgs/by-name/de/deer/realpath.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

29 lines
711 B
Diff

From ceadb2f11119143af4f590ea6b05a531483219b5 Mon Sep 17 00:00:00 2001
From: xd1le <elisp.vim@gmail.com>
Date: Wed, 30 Aug 2017 17:27:20 +1000
Subject: [PATCH] use realpath instead of python to calculate relative path
---
deer | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/deer b/deer
index 3d89dea..804a871 100644
--- a/deer
+++ b/deer
@@ -259,10 +259,7 @@ deer-get-relative()
{
local TMP
TMP=${1:-${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]}
- TMP="`python -c '
-import sys, os
-print(os.path.relpath(sys.argv[1], sys.argv[2]))
-' $TMP ${DEER_STARTDIR:-$PWD}`"
+ TMP="`realpath --relative-to=${DEER_STARTDIR:-$PWD} $TMP`"
print -R $TMP:q
}
--
2.14.1