* Added an unpack w/o installation option to the command-line tool

* Misc. fixes

svn: r7337
This commit is contained in:
Jacob Matthews 2007-09-14 20:26:47 +00:00
parent f293528155
commit 56e74bf7e1
4 changed files with 33 additions and 8 deletions

View File

@ -20,14 +20,13 @@ The structure of user PLaneT invocations is listed below.
PLANET-REQUEST ::= (planet FILE-NAME PKG-SPEC [PATH ...])
FILE-NAME ::= string
PKG-SPEC ::= (FILE-PATH ... PKG-NAME) | (FILE-PATH ... PKG-NAME VER-SPEC)
VER-SPEC ::= Nat | (Nat MINOR)
PKG-SPEC ::= (OWNER-NAME PKG-NAME) | (OWNER PKG-NAME . VER-SPEC)
VER-SPEC ::= (Nat) | (Nat MINOR)
MINOR ::= Nat ; the specified revision or above
| (Nat Nat) ; a revision between the two specified numbers (inclusive)
| (= Nat) ; exactly the revision specified
| (+ Nat) ; the specified revision or above
| (- Nat) ; the specified revision or below
FILE-PATH ::= string ; the path to the given package in the repository
PKG-NAME ::= string
OWNER-NAME ::= string
PATH ::= string ; the subdirectory path to the specified file within the package
@ -167,6 +166,11 @@ files in the given directory and returns that file's name. If the
optional filename argument is provided, that filename will be used as
the output file's name.
> (unpack-planet-archive filename pathname) -> void
Unpacks the PLaneT archive with the given filename, placing its contents
into the given directory (creating that path if necessary).
> (remove-pkg owner name major-version minor-version) -> void
Removes the specified package from the local planet cache. Owner and
@ -317,6 +321,11 @@ of what development links are.)
Remove any development links from the given package specifier.
--unpack <plt-file> <path>
Unpack the given PLaneT archive into the given path, which is
created if necessary.
_Development links_
-------------------

View File

@ -106,6 +106,11 @@ PLANNED FEATURES:
"Get a URL for the given package"
(set! actions (cons (lambda () (get-download-url owner pkg maj min)) actions)))
(("--unpack")
plt-file target
"Unpack the contents of the given package into the given directory without installing"
(set! actions (cons (lambda () (do-unpack plt-file target)) actions)))
;; unimplemented so far:
#;(("-u" "--unlink")
module
@ -252,6 +257,11 @@ PLANNED FEATURES:
(let ([fps (params->full-pkg-spec ownerstr pkgstr majstr minstr)])
(printf "~a\n" (url->string (pkg->download-url fps)))))
(define (do-unpack plt-file target)
(unless (file-exists? plt-file)
(fail (format "The specified file (~a) does not exist" plt-file)))
(let ([file (normalize-path plt-file)])
(unpack-planet-archive file target)))
;; ------------------------------------------------------------
;; Utility

View File

@ -265,8 +265,8 @@ an appropriate subdirectory.
(for-each
(lambda (already-loaded-pkg-record)
(let* ([already-loaded-pkg (car already-loaded-pkg-record)]
[stx (cadr already-loaded-pkg-record)]
[stx-origin-string (stx->origin-string stx)])
[prior-stx (cadr already-loaded-pkg-record)]
[prior-stx-origin-string (stx->origin-string prior-stx)])
(unless (can-be-loaded-together? pkg already-loaded-pkg)
(set!
all-violations
@ -283,7 +283,7 @@ an appropriate subdirectory.
(pkg-min pkg)
(pkg-maj already-loaded-pkg)
(pkg-min already-loaded-pkg)
stx-origin-string)
prior-stx-origin-string)
(current-continuation-marks)))
all-violations)))))
loaded-packages)])

View File

@ -13,7 +13,8 @@
(lib "list.ss")
(lib "pack.ss" "setup")
(lib "plt-single-installer.ss" "setup")
(lib "getinfo.ss" "setup"))
(lib "getinfo.ss" "setup")
(lib "unpack.ss" "setup"))
#| The util collection provides a number of useful functions for interacting with the PLaneT system. |#
@ -22,6 +23,7 @@
current-cache-contents
current-linkage
make-planet-archive
unpack-planet-archive
force-package-building?
get-installed-planet-archives
get-hard-linked-packages
@ -260,6 +262,10 @@
(normalize-path archive-name))]))
(define (unpack-planet-archive plt-file target)
(parameterize ([current-directory target])
(unpack plt-file)))
;; check-info.ss-sanity : path (string -> void) (string -> void) (string -> void) -> void
;; gets all the info.ss fields that planet will use (using the info.ss file
;; from the current directory) and calls the announce, warn, and fail functions with strings