Make 'raco pkg install' with no arguments install the current directory.
This is useful for telling people how to install a new pkg, from GitHub or elsewhere: just get the files, and then do `raco pkg install` in the relevant directory. Also, both cabal (the Haskell package manager) and npm (the node.js package manager) behave this way. To explicitly get the old behavior, specify the sources as `--pkgs pkg-srcs ...`. This is useful in scripts, when `pkg-srcs` might be empty.
This commit is contained in:
parent
eca9e16b96
commit
4a542969c7
2
Makefile
2
Makefile
|
@ -199,7 +199,7 @@ RACKET = racket/bin/racket $(USER_CONFIG)
|
|||
RACO = racket/bin/racket $(USER_CONFIG) -N raco -l- raco
|
||||
WIN32_RACKET = racket\racket $(USER_CONFIG)
|
||||
WIN32_RACO = racket\racket $(USER_CONFIG) -N raco -l- raco
|
||||
X_AUTO_OPTIONS = --skip-installed --deps search-auto $(JOB_OPTIONS)
|
||||
X_AUTO_OPTIONS = --skip-installed --deps search-auto --pkgs $(JOB_OPTIONS)
|
||||
USER_AUTO_OPTIONS = --scope user $(X_AUTO_OPTIONS)
|
||||
LOCAL_USER_AUTO = --catalog build/local/catalog $(USER_AUTO_OPTIONS)
|
||||
SOURCE_USER_AUTO_q = --catalog "$(SRC_CATALOG)" $(USER_AUTO_OPTIONS)
|
||||
|
|
|
@ -300,10 +300,9 @@ get started.
|
|||
Whether creating a @tech{single-collection package} or a
|
||||
@tech{multi-collection package}, the next step is to link your
|
||||
development directory as a locally installed package. Use
|
||||
@command-ref{install} in the directory where you created the
|
||||
@nonterm{pkg-name} directory:
|
||||
@command-ref{install} in the @nonterm{pkg-name} directory:
|
||||
|
||||
@commandline{raco pkg install --link @nonterm{pkg-name}}
|
||||
@commandline{raco pkg install}
|
||||
|
||||
If you use @command-ref{show} at this point, you'll see a line for
|
||||
@nonterm{pkg-name}. The ``Source'' column will show that it's a
|
||||
|
|
|
@ -322,6 +322,9 @@ sub-commands.
|
|||
If a given @nonterm{pkg-source} is ``auto-installed'' (to satisfy some other package's
|
||||
dependency), then it is promoted to explicitly installed.
|
||||
|
||||
If no @nonterm{pkg-source}s are supplied, the current directory is
|
||||
installed as a link. See the @DFlag{link} flag below for more details.
|
||||
|
||||
The @exec{install} sub-command accepts
|
||||
the following @nonterm{option}s:
|
||||
|
||||
|
@ -377,6 +380,9 @@ sub-commands.
|
|||
of the given directory will not change for each given directory that implements a
|
||||
@tech{multi-collection package}.}
|
||||
|
||||
@item{@DFlag{pkgs} --- Disables default installation of the current directory when no @nonterm{pkg-source}s
|
||||
are supplied.}
|
||||
|
||||
@item{@DFlag{copy} --- Disables default handling of directory @tech{package sources} as links,
|
||||
and instead treats them like other sources: package content is copied to install.}
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@
|
|||
#:once-each
|
||||
catalog-flags ...
|
||||
[#:bool skip-installed () ("Skip a <pkg-source> if already installed")]
|
||||
[#:bool pkgs () ("Install only the specified packages, even when none are provided")]
|
||||
install-force-flags ...
|
||||
job-flags ...
|
||||
#:args pkg-source
|
||||
|
@ -159,8 +160,18 @@
|
|||
'install
|
||||
scope scope-dir installation user #f a-type
|
||||
(lambda ()
|
||||
(when (and name (> (length pkg-source) 1))
|
||||
((current-pkg-error) (format "the --name flag only makes sense with a single package source")))
|
||||
(unless (or (not name) (package-source->name name))
|
||||
((current-pkg-error) (format "~e is an invalid package name" name)))
|
||||
;; if no sources were supplied, and `--pkgs` was not
|
||||
;; explicitly specified, install the current directory
|
||||
;; as a linked directory
|
||||
(define-values (sources a-type*)
|
||||
(if (and (not pkgs) (null? pkg-source))
|
||||
(values (list (path->string (current-directory)))
|
||||
'link)
|
||||
(values pkg-source a-type)))
|
||||
(define setup-collects
|
||||
(with-pkg-lock
|
||||
(parameterize ([current-pkg-catalogs (and catalog
|
||||
|
@ -173,8 +184,8 @@
|
|||
#:update-deps? update-deps
|
||||
#:strip (or (and source 'source) (and binary 'binary))
|
||||
#:link-dirs? link-dirs?
|
||||
(for/list ([p (in-list pkg-source)])
|
||||
(pkg-desc p a-type name checksum #f))))))
|
||||
(for/list ([p (in-list sources)])
|
||||
(pkg-desc p a-type* name checksum #f))))))
|
||||
(setup no-setup setup-collects jobs)))]
|
||||
;; ----------------------------------------
|
||||
[update
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
Version 5.90.0.9
|
||||
Allow hash table chaperones and impersonators to Support efficient
|
||||
Allow hash table chaperones and impersonators to support efficient
|
||||
hash-clear and hash-clear!
|
||||
setup/collection-name: added
|
||||
syntax/unsafe/for-transform: added
|
||||
raco pkg install with no arguments installs the current directory.
|
||||
|
||||
Version 5.90.0.6
|
||||
Added path<?, symbol<?
|
||||
|
|
Loading…
Reference in New Issue
Block a user