The quick-patch Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The quick-patch Reference Manual

This is the quick-patch Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 05:55:37 2022 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Quick-Patch

tdrhq

This is a really simply library to override sytems in Quicklisp, or to add libraries that are not available in Quicklisp.

The goal of this project is to make it easy for people to contribute to existing projects. Currently with Quicklisp, if somebody chooses to contribute, they'd have to wait a month before they can get the updated version, or they'd have to use git submodules to manage their patches. Submodules are super hard to maintain, especially across multiple developers or CI machines.

Quick-patch does one thing, and does it really simply: it checks out a repository at a commit that you specify, and adds it to asdf:*central-registry*. That's it. On subsequent runs if you set it up correctly it won't hit the network.

Usage

Currently Quick-patch isn't designed to be interactive. In theory it'll work, as long as you're adding new repos, but don't rely on it for removing patches interactively.

Usually your project has a top-level script that sets things up. Or maybe you're just using an init file. In either case, before you start loading other quicklisp projects, you want to do:

;; Sorry, not in quicklisp yet, but this is kind of proving the
;; point of why we need this, yeah?

(ql:quickload :quick-patch)

Currently we don't have any dependencies, so you can override just about any system in quicklisp.

Now you can set up an override. For example, I recently sent a pull request to cl+ssl. At this point, I needed to use my own patched version, so I added this to my loading script:

(quick-patch:register "https://github.com/tdrhq/cl-plus-ssl"
                      "4c614fc3f28017f5c5f4c72a8ce413dd042bfb09")

Notice I used the full git commit hash. A partial hash or a tag/branch name will work, but it will cause quick-patch to hit the network and do a fetch on every startup, and it can get really annoying. With the full SHA hash, we can quickly check on subsequent runs that the repo we checked-out is on the correct commit. So this is how I recommend you use it.

Finally, we need to tell quick-patch to do all the work required to fetch stuff.

(quick-patch:checkout-all "build/quick-patch/")

checkout-all takes one argument which is going to be your cache directory. If this is under a git repository, make sure your cache directory is in your .gitignore.

Now I can go ahead and (ql:quickload ...) or (asdf:load-system ...) any other project that depends on cl+ssl, and it'll correctly pick out my patched version.

Happy hacking!

License

Mozilla Public License, v2.

(No specific reason for the license, it's mostly arbitrarily chosen, but this is what it is at the moment.)

We have copy-pasted some code in quickpatch/util from other libraries to keep our dependencies minimal, and this code might be under a difference license:

directory-exists-p and catdir are taken from cl-fad which is Copyright Edmund Weitz and released under BSD 2 Clause.

trim is taken from cl-str which is Copyright @vindarel, and under the MIT License.

Authors

Arnold Noronha arnold@tdrhq.com. While you're here, may I recommend Screenshotbot?

wait wait, a real world example

Speaking of Screenshotbot, you can see how we use it quick-patch in the real-world: https://github.com/screenshotbot/screenshotbot-oss/blob/main/scripts/init.lisp

Roughly speaking, we build an image that we always work with, and the image has a hook that runs every time the image starts, and that hooks sets up quick-patch.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 quick-patch

Author

Arnold Noronha <arnold@jipr.io>

License

Mozilla Public License 2.0

Description

Easily override quicklisp projects without using git submodules

Version

0.0.1

Source

quick-patch.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 quick-patch.asd

Location

quick-patch.asd

Systems

quick-patch (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 quick-patch/util.lisp

Parent

quick-patch (system)

Location

util.lisp

Packages

quick-patch/util

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 quick-patch/impl.lisp

Dependency

util.lisp (file)

Parent

quick-patch (system)

Location

impl.lisp

Packages

quick-patch/impl

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 quick-patch/all.lisp

Dependency

impl.lisp (file)

Parent

quick-patch (system)

Location

all.lisp

Packages

quick-patch


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 quick-patch/util

Source

util.lisp (file)

Use List

common-lisp

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.2 quick-patch/impl

Source

impl.lisp (file)

Use List

common-lisp

Used By List

quick-patch

Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.3 quick-patch

Source

all.lisp (file)

Use List

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *cache-dir*
Package

quick-patch/impl

Source

impl.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: checkout-all CACHE-DIR
Package

quick-patch/impl

Source

impl.lisp (file)

Function: prepare-externals &rest ARGS
Package

quick-patch/impl

Source

impl.lisp (file)

Function: register REPO COMMIT &key SUBDIRS

Clone the repo specified by REPO, and checkout COMMIT. If SUBDIRS is provided, add each of the directories to asdf:*central-registry*

Package

quick-patch/impl

Source

impl.lisp (file)

Function: register-external &rest ARGS
Package

quick-patch/impl

Source

impl.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *externals*
Package

quick-patch/impl

Source

impl.lisp (file)

Special Variable: *whitespaces*
Package

quick-patch/util

Source

util.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: catdir X Y
Package

quick-patch/util

Source

util.lisp (file)

Function: directory-exists-p PATHSPEC

Checks whether the file named by the pathname designator PATHSPEC exists and if it is a directory. Returns its truename if this is the case, NIL otherwise. The truename is returned in directory form as if by PATHNAME-AS-DIRECTORY.

Package

quick-patch/util

Source

util.lisp (file)

Function: name-from-repo-name REPO-NAME
Package

quick-patch/impl

Source

impl.lisp (file)

Function: prepare-git-repo REPO COMMIT CACHE-DIR
Package

quick-patch/impl

Source

impl.lisp (file)

Function: run-program-with-errors CMD
Package

quick-patch/impl

Source

impl.lisp (file)

Function: trim VALUE
Package

quick-patch/util

Source

util.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   Q  
Index Entry  Section

F
File, Lisp, quick-patch.asd: The quick-patch․asd file
File, Lisp, quick-patch/all.lisp: The quick-patch/all․lisp file
File, Lisp, quick-patch/impl.lisp: The quick-patch/impl․lisp file
File, Lisp, quick-patch/util.lisp: The quick-patch/util․lisp file

L
Lisp File, quick-patch.asd: The quick-patch․asd file
Lisp File, quick-patch/all.lisp: The quick-patch/all․lisp file
Lisp File, quick-patch/impl.lisp: The quick-patch/impl․lisp file
Lisp File, quick-patch/util.lisp: The quick-patch/util․lisp file

Q
quick-patch.asd: The quick-patch․asd file
quick-patch/all.lisp: The quick-patch/all․lisp file
quick-patch/impl.lisp: The quick-patch/impl․lisp file
quick-patch/util.lisp: The quick-patch/util․lisp file

Jump to:   F   L   Q  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   F   N   P   R   T  
Index Entry  Section

C
catdir: Internal functions
checkout-all: Exported functions

D
directory-exists-p: Internal functions

F
Function, catdir: Internal functions
Function, checkout-all: Exported functions
Function, directory-exists-p: Internal functions
Function, name-from-repo-name: Internal functions
Function, prepare-externals: Exported functions
Function, prepare-git-repo: Internal functions
Function, register: Exported functions
Function, register-external: Exported functions
Function, run-program-with-errors: Internal functions
Function, trim: Internal functions

N
name-from-repo-name: Internal functions

P
prepare-externals: Exported functions
prepare-git-repo: Internal functions

R
register: Exported functions
register-external: Exported functions
run-program-with-errors: Internal functions

T
trim: Internal functions

Jump to:   C   D   F   N   P   R   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*cache-dir*: Exported special variables
*externals*: Internal special variables
*whitespaces*: Internal special variables

S
Special Variable, *cache-dir*: Exported special variables
Special Variable, *externals*: Internal special variables
Special Variable, *whitespaces*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   Q   S  
Index Entry  Section

P
Package, quick-patch: The quick-patch package
Package, quick-patch/impl: The quick-patch/impl package
Package, quick-patch/util: The quick-patch/util package

Q
quick-patch: The quick-patch system
quick-patch: The quick-patch package
quick-patch/impl: The quick-patch/impl package
quick-patch/util: The quick-patch/util package

S
System, quick-patch: The quick-patch system

Jump to:   P   Q   S