Skip to content

Commit

Permalink
linux-package-analyzer: disable RPM reading
Browse files Browse the repository at this point in the history
It saddens me that it has come to this. But the rpm-rs crate doesn't
appear to have an active maintainer. Its old dependencies are making
it difficult to keep our dependencies fresh. So we have little choice
but to cut our ties so we can modernize.

Issue #619 tracks restoring the functionality. And we keep the code
around to remind us of the sadness.
  • Loading branch information
indygreg committed Aug 6, 2022
1 parent 1911b4d commit ab012f1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 91 deletions.
85 changes: 0 additions & 85 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions linux-package-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ path = "../debian-packaging"
version = "0.2.0-pre"
path = "../rpm-repository"

[dependencies.rpm-rs]
git = "https://github.com/indygreg/rpm-rs"
rev = "d6623c68a85e3a14f4260c2161c348fa697131c0"
# rpm-rs seems to be unmaintained and its old dependencies are holding us back.
# Disabled until we figure out a path forward.
#[dependencies.rpm-rs]
#git = "https://github.com/indygreg/rpm-rs"
#rev = "d6623c68a85e3a14f4260c2161c348fa697131c0"
10 changes: 8 additions & 2 deletions linux-package-analyzer/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use {
anyhow::{anyhow, Result},
clap::{Arg, ArgMatches, Command},
rpm_repository::RepositoryRootReader,
std::collections::{HashMap, HashSet},
};

Expand Down Expand Up @@ -329,7 +328,12 @@ async fn command_import_debian_repository(args: &ArgMatches) -> Result<()> {
Ok(())
}

async fn command_import_rpm_repository(args: &ArgMatches) -> Result<()> {
async fn command_import_rpm_repository(_: &ArgMatches) -> Result<()> {
eprintln!("RPM functionality has been disabled because the rpm-rs crate is not maintained.");
eprintln!("See https://github.com/indygreg/PyOxidizer/issues/619 for more");
Err(anyhow!("functionality disabled"))

/*
let threads = args.value_of_t::<usize>("threads")?;
let db_path = args.value_of("db_path").expect("database path is required");
let url = args.value_of("url").expect("url argument is required");
Expand All @@ -353,6 +357,8 @@ async fn command_import_rpm_repository(args: &ArgMatches) -> Result<()> {
.await?;
Ok(())
*/
}

fn command_elf_files(args: &ArgMatches) -> Result<()> {
Expand Down
8 changes: 7 additions & 1 deletion linux-package-analyzer/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use {
repository::{BinaryPackageFetch, RepositoryRootReader},
},
futures_util::{AsyncReadExt, StreamExt, TryFutureExt},
std::{io::Read, path::PathBuf},
std::path::PathBuf,
};

/// Import a collection of Debian packages given a root reader and iterable of fetches.
Expand Down Expand Up @@ -80,6 +80,7 @@ pub async fn import_debian_packages<'fetch>(
Ok(())
}

/*
pub async fn import_rpm_packages(
repo: &(impl rpm_repository::RepositoryRootReader + ?Sized),
packages: impl Iterator<Item = rpm_repository::metadata::primary::Package>,
Expand Down Expand Up @@ -129,6 +130,8 @@ pub async fn import_rpm_packages(
Ok(())
}
*/

/// Import a Debian package given its `.deb` archive data.
pub async fn import_debian_package_from_data(
url: &str,
Expand Down Expand Up @@ -274,6 +277,7 @@ async fn process_debian_package<'cf>(
})
}

/*
async fn fetch_rpm_package(
repo: &(impl rpm_repository::RepositoryRootReader + ?Sized),
package: rpm_repository::metadata::primary::Package,
Expand Down Expand Up @@ -388,6 +392,8 @@ async fn process_rpm_package(
})
}
*/

/// Perform SQLite operations to store metadata for an indexed package.
fn store_indexed_package(db: &mut DatabaseConnection, package: IndexedPackage) -> Result<()> {
db.with_transaction(|txn| {
Expand Down

0 comments on commit ab012f1

Please sign in to comment.