diff --git a/.gitignore b/.gitignore index d81f12e..b1d4ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /.idea +/dump \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index fce12b6..1819503 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,7 +46,6 @@ dependencies = [ "blake2", "chrono", "clap", - "ctrlc", "digest", "env_logger", "hex", @@ -59,6 +58,7 @@ dependencies = [ "snafu", "strum", "strum_macros", + "trycmd", "walkdir", ] @@ -87,10 +87,10 @@ dependencies = [ ] [[package]] -name = "cc" -version = "1.0.72" +name = "bytes" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cfg-if" @@ -141,6 +141,42 @@ dependencies = [ "syn", ] +[[package]] +name = "combine" +version = "4.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concolor" +version = "0.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "015267563b1df20adccdd00cb05257b1dfbea70a04928e9cf88ffb850c1a40af" +dependencies = [ + "atty", + "bitflags", + "concolor-query", +] + +[[package]] +name = "concolor-query" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6417fe6fc03a8b533fd2177742eeb39a90c7233eedec7bac96d4d6b69a09449" + +[[package]] +name = "content_inspector" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.1" @@ -150,6 +186,50 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +dependencies = [ + "cfg-if", + "lazy_static", +] + [[package]] name = "crypto-common" version = "0.1.2" @@ -160,14 +240,10 @@ dependencies = [ ] [[package]] -name = "ctrlc" -version = "3.2.1" +name = "difflib" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19c6cedffdc8c03a3346d723eb20bd85a13362bb96dc2ac000842c6381ec7bf" -dependencies = [ - "nix", - "winapi", -] +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" @@ -186,6 +262,18 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "dunce" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + [[package]] name = "env_logger" version = "0.9.0" @@ -199,6 +287,15 @@ dependencies = [ "termcolor", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "generic-array" version = "0.14.5" @@ -209,6 +306,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + [[package]] name = "hashbrown" version = "0.11.2" @@ -251,6 +354,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "humantime-serde" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac34a56cfd4acddb469cc7fff187ed5ac36f498ba085caf8bbc725e3ff474058" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "indexmap" version = "1.8.0" @@ -261,6 +374,33 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "kstring" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526" +dependencies = [ + "serde", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -307,17 +447,10 @@ dependencies = [ ] [[package]] -name = "nix" -version = "0.23.1" +name = "normalize-line-endings" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "memoffset", -] +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-integer" @@ -338,12 +471,32 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "once_cell" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +[[package]] +name = "os_pipe" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e3492ebca331b895fe23ed427dce2013d9b2e00c45964f12040b0db38b8ab27" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "os_str_bytes" version = "6.0.0" @@ -395,6 +548,40 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rayon" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.5.4" @@ -412,6 +599,15 @@ version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + [[package]] name = "rustversion" version = "1.0.6" @@ -427,6 +623,32 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sha-1" version = "0.10.0" @@ -449,6 +671,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + [[package]] name = "snafu" version = "0.7.0" @@ -513,6 +741,20 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.2" @@ -539,6 +781,44 @@ dependencies = [ "winapi", ] +[[package]] +name = "toml_edit" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94217a6d6a89fb646cbc9f28283cf4745f77eb0b04c4f680c4b3ae4450e3a473" +dependencies = [ + "combine", + "indexmap", + "itertools", + "kstring", + "serde", +] + +[[package]] +name = "trycmd" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170d4db4fe81231f42ba55a50675f72590153d3c6ede8ae979bf3084bf2d8ae7" +dependencies = [ + "concolor", + "content_inspector", + "difflib", + "dunce", + "glob", + "humantime", + "humantime-serde", + "normalize-line-endings", + "os_pipe", + "rayon", + "serde", + "shlex", + "tempfile", + "toml_edit", + "wait-timeout", + "walkdir", + "yansi", +] + [[package]] name = "typenum" version = "1.15.0" @@ -563,6 +843,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.3.2" @@ -610,3 +899,9 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" diff --git a/Cargo.toml b/Cargo.toml index d7ea1b3..df61fac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,11 @@ sha2 = "0.10" # CLI clap = { version = "3", features = ["derive"] } ansi_term = "0.12" -ctrlc = "3" atty = "0.2" # Logging log = "0.4" env_logger = "0.9" + +[dev-dependencies] +trycmd = "0.12" diff --git a/src/bagit/bag.rs b/src/bagit/bag.rs index 7710e87..eed5434 100644 --- a/src/bagit/bag.rs +++ b/src/bagit/bag.rs @@ -64,6 +64,7 @@ struct FileMeta { pub fn create_bag, D: AsRef>( src_dir: S, dst_dir: D, + mut bag_info: BagInfo, algorithms: &[DigestAlgorithm], ) -> Result { let src_dir = src_dir.as_ref(); @@ -96,12 +97,16 @@ pub fn create_bag, D: AsRef>( rename(temp_dir, &data_dir)?; add_data_prefix(&mut payload_meta); - write_payload_manifests(algorithms, &payload_meta, dst_dir)?; + write_payload_manifests(algorithms, &mut payload_meta, dst_dir)?; let declaration = BagDeclaration::new(); write_bag_declaration(&declaration, dst_dir)?; - let bag_info = BagInfo::with_generated(current_date_str(), build_payload_oxum(&payload_meta))?; + if bag_info.bagging_date().is_none() { + bag_info.add_bagging_date(current_date_str())?; + } + + bag_info.add_payload_oxum(build_payload_oxum(&payload_meta))?; write_bag_info(&bag_info, dst_dir)?; @@ -327,7 +332,7 @@ fn update_payload_manifests>( let mut meta = calculate_digests(base_dir.join(DATA), algorithms, |_| true)?; add_data_prefix(&mut meta); - write_payload_manifests(algorithms, &meta, base_dir)?; + write_payload_manifests(algorithms, &mut meta, base_dir)?; Ok(meta) } @@ -344,7 +349,7 @@ fn add_data_prefix(file_meta: &mut [FileMeta]) { /// Calculates the digests for all of the tag files in the bag and writes the tag manifests fn update_tag_manifests>(base_dir: P, algorithms: &[DigestAlgorithm]) -> Result<()> { let base_dir = base_dir.as_ref(); - let meta = calculate_digests(base_dir, algorithms, |f| { + let mut meta = calculate_digests(base_dir, algorithms, |f| { // Skip the data directory and all tag manifests f.file_name() != DATA && f.file_name() @@ -352,7 +357,7 @@ fn update_tag_manifests>(base_dir: P, algorithms: &[DigestAlgorit .map(|n| !TAG_MANIFEST_MATCHER.is_match(n)) .unwrap_or(true) })?; - write_tag_manifests(algorithms, &meta, base_dir) + write_tag_manifests(algorithms, &mut meta, base_dir) } /// Calculates the digests for all of the files under the `base_dir` @@ -394,7 +399,7 @@ where fn write_payload_manifests>( algorithms: &[DigestAlgorithm], - file_meta: &[FileMeta], + file_meta: &mut [FileMeta], base_dir: P, ) -> Result<()> { // TODO this is currently not taking into account fetch.txt @@ -403,7 +408,7 @@ fn write_payload_manifests>( fn write_tag_manifests>( algorithms: &[DigestAlgorithm], - file_meta: &[FileMeta], + file_meta: &mut [FileMeta], base_dir: P, ) -> Result<()> { write_manifests(algorithms, file_meta, TAG_MANIFEST_PREFIX, base_dir) @@ -413,7 +418,7 @@ fn write_tag_manifests>( // TODO note when reading these files that `./data/` is ALLOWED fn write_manifests>( algorithms: &[DigestAlgorithm], - file_meta: &[FileMeta], + file_meta: &mut [FileMeta], prefix: &str, base_dir: P, ) -> Result<()> { @@ -428,6 +433,9 @@ fn write_manifests>( manifests.insert(algorithm, BufWriter::new(file)); } + // Sort files so that they're written to the manifest deterministically + file_meta.sort_by(|a, b| a.path.cmp(&b.path)); + for meta in file_meta { // TODO LF, CR, and % must be % encoded -- however! existing clients do NOT do this! // TODO on windows, `\` must be converted to `/` diff --git a/src/bagit/digest.rs b/src/bagit/digest.rs index 5fe9b70..b000628 100644 --- a/src/bagit/digest.rs +++ b/src/bagit/digest.rs @@ -279,7 +279,6 @@ mod tests { use crate::bagit::digest::DigestAlgorithm; use crate::bagit::digest::MultiDigestWriter; - use crate::bagit::error::*; #[test] fn calculate_digest_while_reading() { diff --git a/src/bagit/mod.rs b/src/bagit/mod.rs index d72c3ea..9b42d93 100644 --- a/src/bagit/mod.rs +++ b/src/bagit/mod.rs @@ -1,6 +1,7 @@ -pub use crate::bagit::bag::{create_bag, open_bag, Bag}; +pub use crate::bagit::bag::{create_bag, open_bag, Bag, BagItVersion}; pub use crate::bagit::digest::DigestAlgorithm; pub use crate::bagit::error::*; +pub use crate::bagit::tag::{BagDeclaration, BagInfo}; mod bag; mod consts; diff --git a/src/bagit/tag.rs b/src/bagit/tag.rs index b3c5b9e..a6c6408 100644 --- a/src/bagit/tag.rs +++ b/src/bagit/tag.rs @@ -143,17 +143,6 @@ impl BagInfo { } } - pub fn with_generated, O: AsRef>( - bagging_date: D, - payload_oxum: O, - ) -> Result { - let mut info = Self::with_capacity(2); - info.add_bagging_date(bagging_date)?; - info.add_payload_oxum(payload_oxum)?; - // TODO add bagging agent - Ok(info) - } - pub fn with_tags(tags: TagList) -> Self { Self { tags } } @@ -163,10 +152,22 @@ impl BagInfo { self.tags.add_tag(LABEL_BAGGING_DATE, value) } + pub fn bagging_date(&self) -> Option<&str> { + self.tags + .get_tag(LABEL_BAGGING_DATE) + .map(|t| t.value.as_ref()) + } + pub fn add_payload_oxum>(&mut self, value: S) -> Result<()> { self.tags.remove_tags(LABEL_PAYLOAD_OXUM); self.tags.add_tag(LABEL_PAYLOAD_OXUM, value) } + + pub fn payload_oxum(&self) -> Option<&str> { + self.tags + .get_tag(LABEL_PAYLOAD_OXUM) + .map(|t| t.value.as_ref()) + } } impl Default for BagInfo { diff --git a/src/bin/bagr.rs b/src/bin/bagr.rs index 26fd772..4076bbb 100644 --- a/src/bin/bagr.rs +++ b/src/bin/bagr.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use std::process::exit; -use bagr::bagit::{create_bag, open_bag, DigestAlgorithm}; +use bagr::bagit::{create_bag, open_bag, BagInfo, DigestAlgorithm}; use clap::AppSettings::UseLongFormatForHelpSubcommand; use clap::{Args, Parser, Subcommand}; use log::{error, info, LevelFilter}; @@ -53,6 +53,12 @@ pub struct BagCmd { /// a different directory. By default, bags are created in place. #[clap(short, long, value_name = "SRC_DIR")] pub source: Option, + + /// Set the Bagging-Date tag + /// + /// Defaults to the current date. Should be in YYYY-MM-DD format. + #[clap(long, value_name = "YYYY-MM-DD")] + pub bagging_date: Option, } /// Update BagIt manifests to match the current state on disk @@ -93,9 +99,17 @@ fn main() { Command::Bag(sub_args) => { let algorithms = &[DigestAlgorithm::Md5, DigestAlgorithm::Sha256]; + let mut bag_info = BagInfo::new(); + + if let Some(date) = sub_args.bagging_date { + // TODO error + bag_info.add_bagging_date(date).unwrap(); + } + if let Err(e) = create_bag( defaulted_path(sub_args.source), defaulted_path(sub_args.destination), + bag_info, algorithms, ) { error!("Failed to create bag: {}", e); diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs new file mode 100644 index 0000000..1a0973a --- /dev/null +++ b/tests/cli_tests.rs @@ -0,0 +1,4 @@ +#[test] +fn bag_cli_tests() { + trycmd::TestCases::new().case("tests/cmd/bag/*.trycmd"); +} diff --git a/tests/cmd/bag/default.in/dir/file2.txt b/tests/cmd/bag/default.in/dir/file2.txt new file mode 100644 index 0000000..fac580e --- /dev/null +++ b/tests/cmd/bag/default.in/dir/file2.txt @@ -0,0 +1 @@ +file 2 diff --git a/tests/cmd/bag/default.in/file1.txt b/tests/cmd/bag/default.in/file1.txt new file mode 100644 index 0000000..366f17f --- /dev/null +++ b/tests/cmd/bag/default.in/file1.txt @@ -0,0 +1 @@ +file 1 diff --git a/tests/cmd/bag/default.out/bag-info.txt b/tests/cmd/bag/default.out/bag-info.txt new file mode 100644 index 0000000..4f3d2a2 --- /dev/null +++ b/tests/cmd/bag/default.out/bag-info.txt @@ -0,0 +1,2 @@ +Bagging-Date: 2022-02-16 +Payload-Oxum: 14.2 diff --git a/tests/cmd/bag/default.out/bagit.txt b/tests/cmd/bag/default.out/bagit.txt new file mode 100644 index 0000000..7bfcaec --- /dev/null +++ b/tests/cmd/bag/default.out/bagit.txt @@ -0,0 +1,2 @@ +BagIt-Version: 1.0 +Tag-File-Character-Encoding: UTF-8 diff --git a/tests/cmd/bag/default.out/data/dir/file2.txt b/tests/cmd/bag/default.out/data/dir/file2.txt new file mode 100644 index 0000000..fac580e --- /dev/null +++ b/tests/cmd/bag/default.out/data/dir/file2.txt @@ -0,0 +1 @@ +file 2 diff --git a/tests/cmd/bag/default.out/data/file1.txt b/tests/cmd/bag/default.out/data/file1.txt new file mode 100644 index 0000000..366f17f --- /dev/null +++ b/tests/cmd/bag/default.out/data/file1.txt @@ -0,0 +1 @@ +file 1 diff --git a/tests/cmd/bag/default.out/manifest-md5.txt b/tests/cmd/bag/default.out/manifest-md5.txt new file mode 100644 index 0000000..e318d27 --- /dev/null +++ b/tests/cmd/bag/default.out/manifest-md5.txt @@ -0,0 +1,2 @@ +4349cfeff8e2eb74dffc369bb5fd084e data/dir/file2.txt +e243bb39c844b3543a7726576c869caf data/file1.txt diff --git a/tests/cmd/bag/default.out/manifest-sha256.txt b/tests/cmd/bag/default.out/manifest-sha256.txt new file mode 100644 index 0000000..eda4ecc --- /dev/null +++ b/tests/cmd/bag/default.out/manifest-sha256.txt @@ -0,0 +1,2 @@ +0b7e1391e807365614c548fd10a4a543cf0654268529f3fe768ed7042624c006 data/dir/file2.txt +5f5d584c5857d85af911ade1b2ae7cb593c17654282091f3ace31efd9e951360 data/file1.txt diff --git a/tests/cmd/bag/default.out/tagmanifest-md5.txt b/tests/cmd/bag/default.out/tagmanifest-md5.txt new file mode 100644 index 0000000..1aa836c --- /dev/null +++ b/tests/cmd/bag/default.out/tagmanifest-md5.txt @@ -0,0 +1,4 @@ +745761ecfcc5a6c71d447f97c35f3366 bag-info.txt +eaa2c609ff6371712f623f5531945b44 bagit.txt +3f380469d3061ae331051622e48d9910 manifest-md5.txt +fabb0483f17c0eb84f01769c62cb67a8 manifest-sha256.txt diff --git a/tests/cmd/bag/default.out/tagmanifest-sha256.txt b/tests/cmd/bag/default.out/tagmanifest-sha256.txt new file mode 100644 index 0000000..c338f4b --- /dev/null +++ b/tests/cmd/bag/default.out/tagmanifest-sha256.txt @@ -0,0 +1,4 @@ +7a484822131a0fd640a56954353923f98d4edade11393ce5dff0e9a9e09e40e4 bag-info.txt +1712ecfb074bf29c4188ad3421032509159a09739fd604f8fe57038b4ddefcc9 bagit.txt +34f871136d28857edafe0b59bfc708ef18eb44a05d87e8374c7952cb17a80259 manifest-md5.txt +71dd116c77785566afd33650737cc84e950e4b976e63ef31d4975a3e4a596963 manifest-sha256.txt diff --git a/tests/cmd/bag/default.trycmd b/tests/cmd/bag/default.trycmd new file mode 100644 index 0000000..9f0c98e --- /dev/null +++ b/tests/cmd/bag/default.trycmd @@ -0,0 +1,4 @@ +``` +$ bagr bag --bagging-date 2022-02-16 +? 0 +``` \ No newline at end of file