#cargo-command #command-line #cargo #patch #command #dependencies

app dependencies-patch

A simple tool to patch cargo dependencies with command line commands

5 releases (3 breaking)

0.4.1 Oct 17, 2024
0.4.0 Oct 17, 2024
0.3.0 Jun 3, 2024
0.2.0 May 19, 2024
0.1.0 May 19, 2024

#154 in Cargo plugins

Download history 521/week @ 2024-10-13 38/week @ 2024-10-20 34/week @ 2024-10-27 15/week @ 2024-11-03 2/week @ 2024-11-10 7/week @ 2024-12-08 1/week @ 2024-12-15

361 downloads per month

MIT license

27KB
475 lines

dependencies-patch

A simple tool to patch cargo dependencies with command line commands.

Todo List

  • Support for packages from github
  • Support for packages from other URL
  • Support for packages from crates-io
  • Support for packages from other registries

Installation

$ cargo install dependencies-patch

Usage

The Cargo.toml for example_project looks like this:

[package]
edition = "2021"
name = "project1"
version = "0.1.0"

[workspace]

[dependencies]
log = "0.4"

Then run following commands to patch the log dependency to a git repository:

$ dependencies-patch --help
$ dependencies-patch -c /path/to/example_project -n log -t git --git-repo rust-lang/log

After running the command, the Cargo.toml will be updated to:

[package]
edition = "2021"
name = "project1"
version = "0.1.0"

[workspace]

[dependencies]
log = "0.4"

[patch.crates-io.log]
git = "https://github.com/rust-lang//log.git"

We can also patch the package to the local path by running the following commands:

$ dependencies-patch -c . -n log -t path --patch-path ../log

And the Cargo.toml will be updated to:

[package]
name = "helloworld"
version = "0.1.0"
edition = "2021"

[dependencies]
log = "0.4"

[patch.crates-io.log]
path = "../log"

More usages can be known by running dependencies --help command.

Notes

The tool can only add patches to the Cargo.toml file. It don't support removing patches.

Dependencies

~2.2–3MB
~59K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy