-
-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raco pkg: change
--scope-dir
search-path handling
Formerly, `--scope-dir` would include only the specified directory in the search path for already installed packages, etc., which means that it would only work right as a kind of installation scope that is a step beyond "installation" on the "user"-to-"installation" spectrum. The `'pkgs-search-dirs` confiugration entry, meanwhile, provides more control over search ordering in installation scope. Make `--scope-dir` work more consistently with that search-path configration. This change also makes "instllation"-scope operations use the search path more consistently, since some actions used to use the whole search list while others pruned any prefix before the main installation directory in the search list.
- Loading branch information
Showing
5 changed files
with
88 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#lang racket/base | ||
(require racket/cmdline | ||
setup/dirs) | ||
|
||
;; This module is meant to be run via "tests-scope.rkt". It adds the | ||
;; given paths to the package-search list, and it adds "links.rktd" in | ||
;; those paths to the links-search list. | ||
|
||
(command-line | ||
#:args | ||
path | ||
(unless (null? path) | ||
(let ([paths path] | ||
[file (build-path (find-config-dir) "config.rktd")]) | ||
(define ht (call-with-input-file* file read)) | ||
(define new-ht | ||
(hash-set (hash-set ht | ||
'pkgs-search-dirs | ||
(append paths (hash-ref ht 'pkgs-search-dirs '(#f)))) | ||
'links-search-files | ||
(append (for/list ([path (in-list paths)]) | ||
(path->string (build-path path "links.rktd"))) | ||
(hash-ref ht 'links-search-files '(#f))))) | ||
(call-with-output-file* | ||
file | ||
#:exists 'truncate/replace | ||
(lambda (o) (write new-ht o)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters