Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for finding projects in tarballs #57

Closed
wants to merge 1 commit into from

2 participants

@vseloved

Hi Xach,

For deployment of my internal projects I needed a way to distribute custom libraries as a single file a la java jars (the obvious choice being tarballs). As quicklisp has all the pieces needed for that, I've just re-used them and added a separate searcher function, that searches in ASDF:CENTRAL-REGISTRY dirs for tarballs and unpacks them in the same dir.

I though that this may be an interesting addition to quicklisp-client. The current implementation is more of a proof-of-concept sort, as it doesn't involve ASDF source registry (should it?) and unpacks the tarballs in-place (probably, there should be a more robust variant). If you have any ideas, how to improve that, I'm ready to implement them.

Vsevolod

@quicklisp
Owner

I don't quite understand the use-case. Is this for when the tarballs are local rather than available via HTTP?

And there's no formal index, just an ad-hoc contents-of-a-directory thing?

@vseloved

Yes, when the tarballs are local: as the user doesn't have control over what's in the repository, this can be one of the ways to override some system from upstream. For example, if you have local changes, but you don't want to distribute them as source tree.

It may also be similar to local projects, but I understand (or, maybe, misunderstand) local projects as more suited for development environment, not for production deployment.

Yes, no index.

@quicklisp
Owner

This is an interesting idea, but I don't think it should be part of Quicklisp. It would be better as a separate project.

@quicklisp quicklisp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2012
  1. @vseloved
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 0 deletions.
  1. +26 −0 packed.lisp
  2. +1 −0  setup.lisp
View
26 packed.lisp
@@ -0,0 +1,26 @@
+;;;; packed.lisp
+
+;;;
+;;; Support for finding systems inside tarballs
+;;;
+
+(in-package #:quicklisp-client)
+
+(defun packed-projects-searcher (system-name)
+ "This function is added to ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*
+to use the packed projects anywhere in ASDF:*CENTRAL-REGISTRY*."
+ (let ((tar (qmerge "tmp/release-install.tar")))
+ (dolist (dir asdf:*central-registry*)
+ (dolist (archive (merge-pathnames "*.tar.gz" dir))
+ (unless (probe-directory (subseq (namestring archive) 0
+ (- (length (namestring archive)) 7)))
+ (ensure-directories-exist tar)
+ (gunzip archive tar)
+ (pushnew (unpack-tarball tar :directory dir)
+ asdf:*central-registry*
+ :test #'string=
+ :key (lambda (path)
+ (etypecase path
+ (stringp path)
+ (pathname (namestring path)))))
+ (asdf:find-system system-name))))))
View
1  setup.lisp
@@ -200,6 +200,7 @@
(setf asdf:*system-definition-search-functions*
(append asdf:*system-definition-search-functions*
(list 'local-projects-searcher
+ 'packed-projects-searcher
'system-definition-searcher))))
(let ((files (nconc (directory (qmerge "local-init/*.lisp"))
(directory (qmerge "local-init/*.cl")))))
Something went wrong with that request. Please try again.