| 1 | # RUST-APT |
| 2 | |
| 3 | `rust-apt` provides bindings to `libapt-pkg`. |
| 4 | |
| 5 | Currently `rust-apt` has most functionality available such as basic querying of package information, |
| 6 | Installing and removing packages, updating the package lists and upgrading the system. |
| 7 | |
| 8 | If you find something missing, please make an Issue to request the feature. |
| 9 | |
| 10 | ### *This API is subject to change at any time* |
| 11 | |
| 12 | `rust-apt` is stable for use, but breaking changes are possible. |
| 13 | Breaking changes will be on the minor, never on the patch. |
| 14 | |
| 15 | `src/raw` contains the direct C++ bindings to `libapt-pkg` that are defined in `apt-pkg-c` |
| 16 | |
| 17 | These are generally considered safe, but may cause segfaults if you do something wrong. |
| 18 | We offer no safety guarantees for using the `raw` bindings directly. |
| 19 | |
| 20 | If you find a way to segfault without using the `raw` bindings directly, please report this as a bug. |
| 21 | |
| 22 | # Documentation and Examples |
| 23 | |
| 24 | For more instructions on how to use `rust-apt` see our [docs.rs](https://docs.rs/rust-apt/latest/rust_apt) page. |
| 25 | |
| 26 | # License Note |
| 27 | |
| 28 | This crate is licensed under the GPLv3 or later. |
| 29 | |
| 30 | # Building |
| 31 | |
| 32 | `libapt-pkg-dev` must be installed. Minimum supported version is `2.0.2`. |
| 33 | |
| 34 | # Thread safety |
| 35 | |
| 36 | It is not advised to use this crate in multiple threads. |
| 37 | |
| 38 | You're free to try it but development will not be focused on making this crate thread safe. |
| 39 | |
| 40 | # Development |
| 41 | |
| 42 | Make sure `cargo` and `rustup` are installed before you run the following commands. |
| 43 | |
| 44 | You will need the stable and nightly toolchain. Nightly is only used for `rustfmt`. |
| 45 | |
| 46 | Install `just`, a command runner we use to simplify some tasks. |
| 47 | |
| 48 | ```console |
| 49 | cargo install just |
| 50 | ``` |
| 51 | |
| 52 | Now that `cargo` and `just` are installed, You can setup your dev environment. |
| 53 | |
| 54 | `setup-dev` will: |
| 55 | |
| 56 | * Install the necessary dependencies with `apt`. |
| 57 | |
| 58 | * Ensure the proper toolchains are installed with `rustup`. |
| 59 | |
| 60 | * Create `compile_commands.json` with `bear` for better c++ linting |
| 61 | |
| 62 | ```console |
| 63 | just setup-dev |
| 64 | ``` |
| 65 | |
| 66 | Before you commit, check formatting and basic code QA. |
| 67 | |
| 68 | ```console |
| 69 | just fmt |
| 70 | just check |
| 71 | ``` |