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 @@
"ext/cl-syntax/cl-syntax-interpol.asd"
"ext/cl-syntax/cl-syntax-markup.asd"
"ext/cl-syntax/cl-syntax.asd"
"ext/cl-tar/tar.asd"
"ext/cl-tar/tar-extract.asd"
"ext/cl-tar/tar-common-extract.asd"
"ext/cl-tar/tar-simple-extract.asd"
"ext/cl-tar-file/tar-file.asd"
"ext/cl-unicode/cl-unicode.asd"
"ext/cl-utilities-1.2.4/cl-utilities.asd"
"ext/closer-mop/closer-mop.asd"
......@@ -68,6 +73,7 @@
"ext/dexador/dexador-test.asd"
"ext/dexador/dexador.asd"
"ext/do-urlencode/do-urlencode.asd"
"ext/doc/40ants-doc.asd"
"ext/documentation-utils/documentation-utils.asd"
"ext/documentation-utils/multilang-documentation-utils.asd"
"ext/drakma/drakma-test.asd"
......@@ -121,6 +127,7 @@
"ext/proc-parse/proc-parse-test.asd"
"ext/proc-parse/proc-parse.asd"
"ext/puri/puri.asd"
"ext/pythonic-string-reader/pythonic-string-reader.asd"
"ext/ql-clpi/ql-clpi.asd"
"ext/quri/quri-test.asd"
"ext/quri/quri.asd"
......
......@@ -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
# https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019
# Needed for lib.exe (used by cffi-toolchain to make a static library).
- Invoke-WebRequest -Uri 'https://aka.ms/vs/16/release/vs_buildtools.exe' -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
# $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME and $CI_COMMIT_BRANCH will ever be
......
......@@ -295,3 +295,15 @@
[submodule "ext/form-fiddle"]
path = ext/form-fiddle
url = https://github.com/Shinmera/form-fiddle
[submodule "ext/cl-tar-file"]
path = ext/cl-tar-file
url = https://gitlab.common-lisp.net/cl-tar/cl-tar-file.git
[submodule "ext/cl-tar"]
path = ext/cl-tar
url = https://gitlab.common-lisp.net/cl-tar/cl-tar.git
[submodule "ext/doc"]
path = ext/doc
url = https://github.com/40ants/doc.git
[submodule "ext/pythonic-string-reader"]
path = ext/pythonic-string-reader
url = https://github.com/smithzvk/pythonic-string-reader.git
......@@ -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] https://github.com/osicat/osicat/pull/39
- [X] https://github.com/osicat/osicat/pull/54
- [X] https://github.com/osicat/osicat/pull/55
- dexador ::
- [ ] https://github.com/fukamachi/dexador/pull/86
- [ ] https://github.com/fukamachi/dexador/issues/87
......
......@@ -57,7 +57,6 @@ appropriate tag or see [[http://www.clpm.dev]].
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.~%~%")
"fare-quasiquote-extras"
"fare-quasiquote-optima"
"fare-quasiquote-readtable"
;; Covered by tar
"tar-extract"
"tar-common-extract"
"tar-simple-extract"
;; Covered by trivia
"trivia.balland2006"
"trivia.level0"
......
......@@ -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
#:clpm/archives/defs
#:clpm/archives/chipz
#:clpm/archives/cl-tar
#:clpm/archives/tar)
(:reexport #:clpm/archives/defs))
......
;;;; Support for extracting archives using the cl-tar project.
;;;;
;;;; This software is part of CLPM. See README.org for more information. See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/archives/cl-tar
(:use #:cl
#:clpm/archives/defs)
(:import-from #:tar)
(:import-from #:tar-extract))
(in-package #:clpm/archives/cl-tar)
(defclass cl-tar-client ()
()
(:documentation
"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."
t)
(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
devices."
(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)
:dereference
t)
:hard-links (if (uiop:os-windows-p)
:dereference
t)
:fifos (if (uiop:os-windows-p)
:skip
t)
: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
again."
(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
:documentation
"The tar implementation to use.")
......@@ -233,6 +233,9 @@
:documentation
"The default logging level of the application.")
((:cl-tar)
:type hash-table)
((:tar)
: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=.
=: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