This PR adds support for the backup packaging function.
rationale
Additional files can be included, which may be user-modified configuration files. As-is, a package build using cargo-aur will overwrite any user-made changes to files that are contained in the package.
With this feature, files can be defined which may be user-modified. If a file is user-modified, the packaged file will be added as .pacnew and not overwrite any changes made by the user.
If a package is removed, and any packaged file is user-modified, a .pacsave file will be retained.
implementation
I extended the existing [package.metadata.aur] approach as to not get in the way of Cargo's default [package] and took a similar approach as to how the package() section is built up. This does duplicate that logic somewhat, but I suspect there may be other package functions that could piggy back of this approach in the future should there be a need for them.
I added relevant information in terms of usage in the README.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/fosskers/cargo-aur/pull/31
**Author:** [@sjugge](https://github.com/sjugge)
**Created:** 9/3/2024
**Status:** 🔄 Open
**Base:** `master` ← **Head:** `pkg-meta-backup`
---
### 📝 Commits (1)
- [`ee732cd`](https://github.com/fosskers/cargo-aur/commit/ee732cdf2dbba9065cfcc7feb15f2331ee9bf12f) feat: support `backup` packaging function
### 📊 Changes
**3 files changed** (+35 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `README.md` (+18 -1)
📝 `src/lib.rs` (+2 -0)
📝 `src/main.rs` (+15 -0)
</details>
### 📄 Description
This PR adds support for the [`backup`](https://wiki.archlinux.org/title/PKGBUILD#backup) packaging function.
**rationale**
Additional files can be included, which may be user-modified configuration files. As-is, a package build using `cargo-aur` will overwrite any user-made changes to files that are contained in the package.
With this feature, files can be defined which may be user-modified. If a file is user-modified, the packaged file will be added as [.pacnew](https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#.pacnew) and not overwrite any changes made by the user.
If a package is removed, and any packaged file is user-modified, a [.pacsave file](https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#.pacsave) will be retained.
**implementation**
I extended the existing `[package.metadata.aur]` approach as to not get in the way of Cargo's default `[package]` and took a similar approach as to how the `package()` section is built up. This does duplicate that logic somewhat, but I suspect there may be other package functions that could piggy back of this approach in the future should there be a need for them.
I added relevant information in terms of usage in the README.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosskers/cargo-aur/pull/31
Author: @sjugge
Created: 9/3/2024
Status: 🔄 Open
Base:
master← Head:pkg-meta-backup📝 Commits (1)
ee732cdfeat: supportbackuppackaging function📊 Changes
3 files changed (+35 additions, -1 deletions)
View changed files
📝
README.md(+18 -1)📝
src/lib.rs(+2 -0)📝
src/main.rs(+15 -0)📄 Description
This PR adds support for the
backuppackaging function.rationale
Additional files can be included, which may be user-modified configuration files. As-is, a package build using
cargo-aurwill overwrite any user-made changes to files that are contained in the package.With this feature, files can be defined which may be user-modified. If a file is user-modified, the packaged file will be added as .pacnew and not overwrite any changes made by the user.
If a package is removed, and any packaged file is user-modified, a .pacsave file will be retained.
implementation
I extended the existing
[package.metadata.aur]approach as to not get in the way of Cargo's default[package]and took a similar approach as to how thepackage()section is built up. This does duplicate that logic somewhat, but I suspect there may be other package functions that could piggy back of this approach in the future should there be a need for them.I added relevant information in terms of usage in the README.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.