Commit 2d810852 authored by Eric Timmons's avatar Eric Timmons
Browse files

Merge branch 'cl-tar' into 'main'

Add cl-tar for a pure CL solution to extracting tar archives

See merge request !13
parents b0a43541 a0c4d092
Pipeline #5143 passed with stages
in 31 minutes and 15 seconds
......@@ -56,6 +56,11 @@
......@@ -68,6 +73,7 @@
......@@ -121,6 +127,7 @@
......@@ -155,6 +155,15 @@ dynamic-release:windows:amd64:
- $env:WIX = "C:\wix"
# Install deps!
- "& $BASH -lc 'pacman --noconfirm -S git mingw-w64-x86_64-gcc make tar diffutils'"
# Install Visual Studio Buildtools. See
# Needed for lib.exe (used by cffi-toolchain to make a static library).
- Invoke-WebRequest -Uri '' -OutFile 'C:\vs_buildtools.exe'
- Start-Process -Wait -FilePath 'C:\vs_buildtools.exe' -ArgumentList "--quiet --wait --norestart --nocache --installPath `"C:\BuildTools`" --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 --remove Microsoft.VisualStudio.Component.Windows81SDK"
# TODO: Figure out how to find this path automatically. I have a nasty
# feeling the 14.29.30133 folder will change names frequently.
- $env:PATH = "C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64;$env:PATH"
- "echo $env:PATH"
# Get the repo
# This looks a little funky, but only one of
......@@ -295,3 +295,15 @@
[submodule "ext/form-fiddle"]
path = ext/form-fiddle
url =
[submodule "ext/cl-tar-file"]
path = ext/cl-tar-file
url =
[submodule "ext/cl-tar"]
path = ext/cl-tar
url =
[submodule "ext/doc"]
path = ext/doc
url =
[submodule "ext/pythonic-string-reader"]
path = ext/pythonic-string-reader
url =
......@@ -12,7 +12,6 @@ install the dependencies:
dependencies from .asd files (necessary if you are installing a development
version of a project).
+ git :: If you want to use development versions of your dependencies.
+ tar :: Required.
* Prebuilt binaries
......@@ -36,6 +36,8 @@ don't typically have to worry about.
by us, but needed by us)
- osicat ::
- [X]
- [X]
- [X]
- dexador ::
- [ ]
- [ ]
......@@ -57,7 +57,6 @@ appropriate tag or see [[]].
dependencies from .asd files (necessary if you are installing a development
version of a project).
* git :: If you want to use development versions of your dependencies.
* tar :: Required.
** Prebuilt binaries
To install CLPM in binary form, download the appropriate file from
......@@ -5,7 +5,7 @@
(in-package #:clpm-asdf)
(ops:define-build-op bundled-licenses-file-op (asdf:selfward-operation)
(ops:define-op bundled-licenses-file-op (asdf:selfward-operation)
(defmethod asdf:selfward-operation ((o bundled-licenses-file-op))
......@@ -71,6 +71,10 @@ This file lists the bundled dependencies and their licenses.~%~%")
;; Covered by tar
;; Covered by trivia
......@@ -5,7 +5,7 @@
(in-package #:clpm-asdf)
(defclass clpm-system (ops:release-system-inferred-system)
(defclass clpm-system (ops:package-inferred-release-system)
(defmethod ops:program-image-features (o (s clpm-system))
......@@ -6,7 +6,7 @@
(in-package #:clpm-client)
;; If the location of this changes, the asd file must be updated!
(defvar *version* "0.4.2"
(defvar *version* "0.5.0"
"The client's version.")
(defun clpm-client-version ()
......@@ -7,6 +7,7 @@
(:use #:cl
(:reexport #:clpm/archives/defs))
;;;; Support for extracting archives using the cl-tar project.
;;;; This software is part of CLPM. See for more information. See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/archives/cl-tar
(:use #:cl
(:import-from #:tar)
(:import-from #:tar-extract))
(in-package #:clpm/archives/cl-tar)
(defclass cl-tar-client ()
"Describes an archive extractor that uses the cl-tar project."))
(register-tar-client :cl-tar 'cl-tar-client)
(defmethod tar-client-available-p ((client cl-tar-client))
"Always available."
(defmethod unarchive-tar ((client cl-tar-client) archive-stream destination-pathname
&key strip-components)
"Ensures ~destination-pathname~ exists and then uses CL-TAR to extract the
contents. Dereferences links on Windows and skips all block and character
(assert (uiop:directory-pathname-p destination-pathname))
(ensure-directories-exist destination-pathname)
(tar:with-open-archive (a archive-stream)
(tar-extract:extract-archive a
:directory destination-pathname
:strip-components strip-components
:if-exists :replace
:if-newer-exists :replace
:no-same-owner t
:symbolic-links (if (uiop:os-windows-p)
:hard-links (if (uiop:os-windows-p)
:fifos (if (uiop:os-windows-p)
:character-devices :skip
:block-devices :skip)))
......@@ -71,7 +71,7 @@ Instantiate all registered tar clients, then remove the ones where
(let* ((client-key (config-value :archives :tar :type))
(available-clients (available-tar-clients))
(client (if (eql :auto client-key)
(cdr (first available-clients))
(assoc-value available-clients :cl-tar)
(assoc-value available-clients client-key))))
(unless client
(error "Unable to find a tar client."))
......@@ -117,14 +117,14 @@ methods (this does *not* look at ~archive-stream~ to guess what the correct
archive type is)"))
(defmethod unarchive ((archive-type symbol) archive-stream destination-pathname
&key strip-components)
&key (strip-components 0))
"If ~archive-type~ is a symbol, instantiate the class it names and call
(unarchive (make-instance archive-type) archive-stream destination-pathname
:strip-components strip-components))
(defmethod unarchive ((archive-type tar-archive) archive-stream destination-pathname
&key strip-components)
&key (strip-components 0))
"If ~archive-type~ is a ~tar-archive~, dispatch to ~unarchive-tar~ using the
preferred tar client."
(unarchive-tar (get-preferred-tar-client) archive-stream destination-pathname
......@@ -25,7 +25,7 @@
((:archives :tar)
:type hash-table)
((:archives :tar :type)
:type (member :auto :tar)
:type (member :auto :cl-tar :tar)
:default :auto
"The tar implementation to use.")
......@@ -233,6 +233,9 @@
"The default logging level of the application.")
:type hash-table)
:type hash-table)
((:tar :path)
......@@ -482,7 +482,7 @@ include it."
(multiple-value-bind (stream archive-type)
(repo-archive-stream repo `(:commit ,(vcs-release-commit release)))
(with-open-stream (stream stream)
(unarchive archive-type stream install-root))))))
(unarchive archive-type stream install-root :strip-components 0))))))
(setf (vcs-release-installed-p release) t)))
......@@ -76,7 +76,8 @@ The current configuration can be printed by running =clpm config info=.
This table contains configuration for dealing with archives in tar format.
+ =:type= :: A keyword specifying which tar implementation use. Defaults to
=:auto=. =:cl-tar= specifies that the CL-TAR project should be
used. =:tar= specifies that an external tar executable should be used.
* =(:bundle)=
This table contains all configuration for operating with bundles.
Subproject commit dbc0c5cb9dc3b7332c44420ecfded9869381b954
Subproject commit 4b5fafccd6768692ae385024ca053e0b7af961f6
Subproject commit 8369f16b51dfe04dc68c2ebf146c769d4bc7d471
Subproject commit 485f071df3d1c7043092e0db7fdd05166f11bb7d
Subproject commit 1f089c62e9e9498e29b031e7178e3f2c5fe24333
Subproject commit 10a70d1595784a88ab0c31558cdf1cd4aa4c3d1f
Subproject commit eab6b8cabd71b59e894b51dc555e171683ec3387
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment