diff --git a/libips/src/repository/file_backend.rs b/libips/src/repository/file_backend.rs index 6c587f2..1d011c6 100644 --- a/libips/src/repository/file_backend.rs +++ b/libips/src/repository/file_backend.rs @@ -482,6 +482,12 @@ impl Transaction { let pkg_manifest_path = publisher_dir.join(format!("{}.manifest", package_name)); debug!("Manifest path: {}", pkg_manifest_path.display()); + // Create parent directories if they don't exist + if let Some(parent) = pkg_manifest_path.parent() { + debug!("Creating parent directories: {}", parent.display()); + fs::create_dir_all(parent)?; + } + // Copy to pkg directory debug!("Copying manifest from {} to {}", manifest_path.display(), pkg_manifest_path.display()); fs::copy(&manifest_path, &pkg_manifest_path)?; diff --git a/run_local_import_test.sh b/run_local_import_test.sh new file mode 100755 index 0000000..9164e79 --- /dev/null +++ b/run_local_import_test.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -ex + +export RUST_LOG=debug +PKG6REPO_PATH="sample_data/pkg6-repo" +PKG5REPO_PATH="sample_data/sample-repo.p5p" +PKG6REPO_BIN="./target/debug/pkg6repo" + +if [ -d "$PKG6REPO_PATH" ]; then + rm -rf $PKG6REPO_PATH +fi + +cargo build + +$PKG6REPO_BIN create $PKG6REPO_PATH +$PKG6REPO_BIN add-publisher -s $PKG6REPO_PATH openindiana.org +$PKG6REPO_BIN import-pkg5 -s $PKG5REPO_PATH -d $PKG6REPO_PATH