adjust the pkg/main.rkt exports to be of the form

pkt-<X>-command to avoid conflicting with pkg/lib
This commit is contained in:
Robby Findler 2013-07-03 03:22:18 -05:00
parent 902869dcf1
commit 964e1382f4
8 changed files with 23 additions and 22 deletions

View File

@ -8,7 +8,7 @@
(define s (url->string url)) (define s (url->string url))
(define l (pkg-config-catalogs)) (define l (pkg-config-catalogs))
(unless (member s l) (unless (member s l)
(apply pkg-config #:set #t (apply pkg-config-command #:set #t
"catalogs" "catalogs"
(append l (list s))))) (append l (list s)))))

View File

@ -450,7 +450,7 @@
(parameterize ([current-output-port pkg-info-sp]) (parameterize ([current-output-port pkg-info-sp])
(with-handlers ([exn:fail? (lambda (exn) (with-handlers ([exn:fail? (lambda (exn)
(printf "ERROR:\n~a" (exn-message exn)))]) (printf "ERROR:\n~a" (exn-message exn)))])
(pkg-show))) (pkg-show-command)))
(send (send pkg-info get-editor) (send (send pkg-info get-editor)
insert insert
(get-output-string pkg-info-sp)) (get-output-string pkg-info-sp))

View File

@ -87,7 +87,7 @@
(string-constant install-pkg-abort-remove) (string-constant install-pkg-abort-remove)
(lambda () (lambda ()
(apply (apply
pkg-remove pkg-remove-command
#:scope scope #:scope scope
names))) names)))
(reset-installed-list!)))])) (reset-installed-list!)))]))
@ -104,7 +104,7 @@
(string-constant install-pkg-abort-update) (string-constant install-pkg-abort-update)
(lambda () (lambda ()
(apply (apply
pkg-update pkg-update-command
#:scope scope #:scope scope
names))) names)))
(reset-installed-list!))])) (reset-installed-list!))]))

View File

@ -180,7 +180,7 @@
(string-constant install-pkg-abort-install)) (string-constant install-pkg-abort-install))
(lambda () (lambda ()
(apply (apply
(if first-inst pkg-update pkg-install) (if first-inst pkg-update-command pkg-install-command)
#:scope (and first-inst #:scope (and first-inst
(car first-inst)) (car first-inst))
names))) names)))

View File

@ -120,8 +120,8 @@
[(update) (string-constant install-pkg-abort-update)]) [(update) (string-constant install-pkg-abort-update)])
(lambda () (lambda ()
(define action (case (car res) (define action (case (car res)
[(install) pkg-install] [(install) pkg-install-command]
[(update) pkg-update])) [(update) pkg-update-command]))
(apply action (cdr res)))) (apply action (cdr res))))
(reset-installed-pkgs!))])) (reset-installed-pkgs!))]))
@ -199,7 +199,7 @@
(in-terminal (in-terminal
(lambda () (lambda ()
(define scope (selected-scope)) (define scope (selected-scope))
(pkg-config #:scope 'installation #:set #t "default-scope" (~a scope)) (pkg-config-command #:scope 'installation #:set #t "default-scope" (~a scope))
(printf "Default scope successfully changed to ~a" scope))) (printf "Default scope successfully changed to ~a" scope)))
(adjust-all))])) (adjust-all))]))
(define inferred-scope-msg-parent (new horizontal-panel% (define inferred-scope-msg-parent (new horizontal-panel%

View File

@ -521,14 +521,14 @@ The @racketmodname[pkg] module provides a programmatic interface
to the command sub-sub-commands. to the command sub-sub-commands.
@deftogether[ @deftogether[
(@defthing[pkg-install procedure?] (@defthing[pkg-install-command procedure?]
@defthing[pkg-update procedure?] @defthing[pkg-update-command procedure?]
@defthing[pkg-remove procedure?] @defthing[pkg-remove-command procedure?]
@defthing[pkg-show procedure?] @defthing[pkg-show-command procedure?]
@defthing[pkg-config procedure?] @defthing[pkg-config-command procedure?]
@defthing[pkg-create procedure?] @defthing[pkg-create-command procedure?]
@defthing[pkg-catalog-show procedure?] @defthing[pkg-catalog-show-command procedure?]
@defthing[pkg-catalog-copy procedure?]) @defthing[pkg-catalog-copy-command procedure?])
]{ ]{
Duplicates the @seclink["cmdline"]{command line interface}. Duplicates the @seclink["cmdline"]{command line interface}.

View File

@ -117,16 +117,17 @@
(define-syntax (commands stx) (define-syntax (commands stx)
(syntax-parse stx (syntax-parse stx
[(_ main-doc:expr export-prefix:id c:command ...) [(_ main-doc:expr export-format:str c:command ...)
(with-syntax ([(export-names ...) (with-syntax ([(export-names ...)
(map (λ (x) (string->symbol (format "~a~a" (map (λ (x)
(syntax-e #'export-prefix) #`[#,x
(syntax-e x)))) #,(string->symbol (format (syntax-e #'export-format)
(syntax-e x)))])
(syntax->list #'(c.name ...)))]) (syntax->list #'(c.name ...)))])
(syntax/loc stx (syntax/loc stx
(begin (begin
c.function ... c.function ...
(provide export-names ...) (provide (rename-out export-names ...))
(module+ main (module+ main
c.variables ... c.variables ...
(svn-style-command-line (svn-style-command-line

View File

@ -51,7 +51,7 @@
(commands (commands
"This tool is used for managing installed packages." "This tool is used for managing installed packages."
pkg- "pkg-~a-command"
[install [install
"Install packages" "Install packages"
#:once-each #:once-each