Skip to content

Commit

Permalink
fix(-A): detect uncompressed package tarballs
Browse files Browse the repository at this point in the history
Fixes #908
  • Loading branch information
fosskers committed Aug 15, 2024
1 parent 2de3fd8 commit 109ce67
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `-A`: a bug involving incorrect build order which would occasionally lead to
top-level packages being marked as dependencies and subsequently being removed
via the effects of `-a`.
- `-A`: tarballs built without compression (i.e. that end in `pkg.tar`) will be properly detected.

## 4.0.2 (2024-08-10)

Expand Down
5 changes: 4 additions & 1 deletion rust/aura-core/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@ pub fn missing_tarballs<'a>(
///
/// assert!(is_package(Path::new("libebml-1.3.10-1-x86_64.pkg.tar.xz")));
/// assert!(is_package(Path::new("libebml-1.4.0-1-x86_64.pkg.tar.zst")));
/// assert!(is_package(Path::new("libebml-1.4.0-1-x86_64.pkg.tar")));
/// ```
pub fn is_package(path: &Path) -> bool {
path.to_str()
.map(|p| p.ends_with(".pkg.tar.zst") || p.ends_with(".pkg.tar.xz"))
.map(|p| {
p.ends_with(".pkg.tar.zst") || p.ends_with(".pkg.tar.xz") || p.ends_with(".pkg.tar")
})
.unwrap_or(false)
}

Expand Down
5 changes: 5 additions & 0 deletions rust/aura-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ impl<'a> Package<'a> {
/// let pkg = Package::from_path(simple).unwrap();
/// assert_eq!("aura-bin", pkg.name);
/// assert_eq!("3.2.1-1", pkg.version.to_string());
///
/// let uncompressed = Path::new("aura-bin-3.2.1-1-x86_64.pkg.tar");
/// let pkg = Package::from_path(uncompressed).unwrap();
/// assert_eq!("aura-bin", pkg.name);
/// assert_eq!("3.2.1-1", pkg.version.to_string());
/// ```
pub fn from_path(path: &Path) -> Option<Package<'static>> {
path.file_name()
Expand Down
1 change: 0 additions & 1 deletion rust/aura-pm/src/command/aur/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ fn build_one(
}
});

// FIXME 2024-07-06 I suspect this doesn't account for "debug" packages.
let tars_to_copy = match special {
None => tarballs,
Some(s) => tarballs
Expand Down

0 comments on commit 109ce67

Please sign in to comment.