https://bugzilla.redhat.com/show_bug.cgi?id=2103367 Benson Muite <benson_muite@xxxxxxxxxxxxx> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |benson_muite@xxxxxxxxxxxxx --- Comment #2 from Benson Muite <benson_muite@xxxxxxxxxxxxx> --- Unofficial Review: Package Review ============== Legend: [x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated [ ] = Manual review needed Issues: ======= - Package does not contain duplicates in %files. Note: warning: File listed twice: /usr/share/cargo/registry/gag-1.0.0/LICENSE See: https://docs.fedoraproject.org/en-US/packaging- guidelines/#_duplicate_files ===== MUST items ===== Generic: [x]: Package is licensed with an open-source compatible license and meets other legal requirements as defined in the legal section of Packaging Guidelines. [x]: License field in the package spec file matches the actual license. Note: Checking patched sources after %prep for licenses. Licenses found: "Unknown or generated", "MIT License". 11 files have unknown license. Detailed output of licensecheck in /home/FedoraPackaging/rust-gag/2103367-rust- gag/licensecheck.txt [x]: License file installed when any subpackage combination is installed. [x]: %build honors applicable compiler flags or justifies otherwise. [x]: Package contains no bundled libraries without FPC exception. [x]: Changelog in prescribed format. [x]: Sources contain only permissible code or content. [-]: Package contains desktop file if it is a GUI application. [x]: Development files must be in a -devel package [x]: Package uses nothing in %doc for runtime. [x]: Package consistently uses macros (instead of hard-coded directory names). [x]: Package is named according to the Package Naming Guidelines. [x]: Package does not generate any conflict. [x]: Package obeys FHS, except libexecdir and /usr/target. [-]: If the package is a rename of another package, proper Obsoletes and Provides are present. [x]: Requires correct, justified where necessary. [x]: Spec file is legible and written in American English. [-]: Package contains systemd file(s) if in need. [x]: Package is not known to require an ExcludeArch tag. [?]: Package complies to the Packaging Guidelines [x]: Package successfully compiles and builds into binary rpms on at least one supported primary architecture. [x]: Package installs properly. [x]: Rpmlint is run on all rpms the build produces. Note: There are rpmlint messages (see attachment). [x]: If (and only if) the source package includes the text of the license(s) in its own file, then that file, containing the text of the license(s) for the package is included in %license. [x]: Package requires other packages for directories it uses. [x]: Package must own all directories that it creates. [x]: Package does not own files or directories owned by other packages. [x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT [x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the beginning of %install. [x]: Macros in Summary, %description expandable at SRPM build time. [x]: Dist tag is present. [x]: Permissions on files are set properly. [x]: Package must not depend on deprecated() packages. [x]: Package use %makeinstall only when make install DESTDIR=... doesn't work. [x]: Package is named using only allowed ASCII characters. [x]: Package does not use a name that already exists. [x]: Package is not relocatable. [x]: Sources used to build the package match the upstream source, as provided in the spec URL. [x]: Spec file name must match the spec package %{name}, in the format %{name}.spec. [x]: File names are valid UTF-8. [x]: Large documentation must go in a -doc subpackage. Large could be size (~1MB) or number of files. Note: Documentation size is 0 bytes in 0 files. [x]: Packages must not store files under /srv, /opt or /usr/local ===== SHOULD items ===== Generic: [-]: If the source package does not include license text(s) as a separate file from upstream, the packager SHOULD query upstream to include it. [x]: Final provides and requires are sane (see attachments). [?]: Fully versioned dependency in subpackages if applicable. Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in rust- gag-devel , rust-gag+default-devel [?]: Package functions as described. [x]: Latest version is packaged. [x]: Package does not include license text files separate from upstream. [-]: Sources are verified with gpgverify first in %prep if upstream publishes signatures. Note: gpgverify is not used. [x]: %check is present and all tests pass. [?]: Packages should try to preserve timestamps of original installed files. [x]: Reviewer should test that the package builds in mock. [x]: Buildroot is not present [x]: Package has no %clean section with rm -rf %{buildroot} (or $RPM_BUILD_ROOT) [x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin. [x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file [x]: Sources can be downloaded from URI in Source: tag [x]: SourceX is a working URL. [x]: Package should compile and build into binary rpms on all supported architectures. [x]: Spec use %global instead of %define unless justified. ===== EXTRA items ===== Generic: [x]: Rpmlint is run on all installed packages. Note: There are rpmlint messages (see attachment). [x]: Spec file according to URL is the same as in SRPM. Rpmlint ------- Cannot parse rpmlint output: Rpmlint (installed packages) ---------------------------- Cannot parse rpmlint output: Source checksums ---------------- https://crates.io/api/v1/crates/gag/1.0.0/download#/gag-1.0.0.crate : CHECKSUM(SHA256) this package : a713bee13966e9fbffdf7193af71d54a6b35a0bb34 997cd6c9519ebeb5005972 CHECKSUM(SHA256) upstream package : a713bee13966e9fbffdf7193af71d54a6b35a0bb34 997cd6c9519ebeb5005972 Requires -------- rust-gag-devel (rpmlib, GLIBC filtered): (crate(filedescriptor/default) >= 0.8.0 with crate(filedescriptor/default) < 0.9.0~) (crate(tempfile/default) >= 3.0.0 with crate(tempfile/default) < 4.0.0~) cargo rust-gag+default-devel (rpmlib, GLIBC filtered): cargo crate(gag) Provides -------- rust-gag-devel: crate(gag) rust-gag-devel rust-gag+default-devel: crate(gag/default) rust-gag+default-devel Generated by fedora-review 0.8.0 (e988316) last change: 2022-04-07 Command line :/usr/bin/fedora-review -b 2103367 Buildroot used: fedora-rawhide-x86_64 Active plugins: Shell-api, Generic Disabled plugins: Python, Ocaml, SugarActivity, Java, PHP, Perl, R, C/C++, fonts , Haskell Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH Comments: 1) The package has documentation, https://docs.rs/gag/latest/src/gag/lib.rs.html#1-131 is it possible to package this? Related issue https://github.com/Stebalien/gag-rs/issues/9 rustdoc seems to download from the internet and create a website with embedded javascript and fonts that are not great to package, though output of Json seems to be in progress. It seems possible to use pandoc to generate documentation that is suitable for the terminal https://github.com/brotzeit/rustic#rust-docs-in-org-mode . Using pandoc on html generated by rustdoc creates output that could be fed into https://github.com/rust-cli/man . For the current package, a pandoc generated markdown file contains the following Expand description ::: docblock Temporarily redirect stdout/stderr. For example, one can temporarily throw away stdout output: ::: example-wrap ``` {.rust .rust-example-rendered} use gag::Gag; println!("Hello world!"); { let print_gag = Gag::stdout().unwrap(); println!("No one will see this!"); println!("Or this!"); } println!("But they will see this!"); ``` ::: You can also temporarily un-gag by dropping the gag: ::: example-wrap ``` {.rust .rust-example-rendered} use gag::Gag; let mut print_gag = Gag::stdout().unwrap(); println!("No one will see this!"); if true { drop(print_gag); println!("They will see this..."); print_gag = Gag::stdout().unwrap(); println!("Not this..."); } println!("Nor this."); ``` ::: However, you can't open multiple Gags/Redirects/Holds for the same output at once: ::: example-wrap ``` {.rust .rust-example-rendered} use gag::Gag; // Multiple stdout gags let gag_a = Gag::stdout().unwrap(); let gag_b_result = Gag::stdout(); assert!(gag_b_result.is_err()); assert_eq!(gag_b_result.err().expect("Expected an error").kind(), std::io::ErrorKind::AlreadyExists); // However, you can still gag stderr: let gag_c = Gag::stderr().unwrap(); ``` ::: If you don't want to throw away stdout, you can write it to a file: ::: example-wrap ``` {.rust .rust-example-rendered} use std::fs::OpenOptions; use std::io::{Read, Write, Seek, SeekFrom}; use gag::Redirect; use dirs::data_local_dir; fn get_temp_filepath() -> String { #[cfg(windows)] return data_local_dir() .unwrap() .join("Temp") .join("my_log.log") .to_string_lossy() .into(); #[cfg(unix)] return "/tmp/my_log.log".into(); } println!("Displayed"); // Open a log let log = OpenOptions::new() .truncate(true) .read(true) .create(true) .write(true) .open(get_temp_filepath()) .unwrap(); let print_redirect = Redirect::stdout(log).unwrap(); println!("Hidden"); // Extract redirect let mut log = print_redirect.into_inner(); println!("Displayed"); let mut buf = String::new(); log.seek(SeekFrom::Start(0)).unwrap(); log.read_to_string(&mut buf).unwrap(); assert_eq!(&buf[..], "Hidden\n"); ``` ::: Alternatively, you can buffer stdout to a temporary file. On linux 3.11+, this file is guarenteed to be stored in-memory. ::: example-wrap ``` {.rust .rust-example-rendered} use std::io::Read; use gag::BufferRedirect; let mut buf = BufferRedirect::stdout().unwrap(); println!("Hello world!"); let mut output = String::new(); buf.read_to_string(&mut output).unwrap(); assert_eq!(&output[..], "Hello world!\n"); ``` ::: Finally, if you just want to temporarily hold std output, you can use `Hold` to hold the output until dropped: ::: example-wrap ``` {.rust .rust-example-rendered} use gag::Hold; let hold = Hold::stdout().unwrap(); println!("first"); println!("second"); drop(hold); // printing happens here! ``` ::: ::: ## [Structs](#structs) {#structs .section-header} ::: item-table ::: item-row ::: {.item-left .module-item} [Buffer](struct.Buffer.html "gag::Buffer struct"){.struct} ::: ::: {.item-right .docblock-short} An in-memory read-only buffer into which BufferRedirect buffers output. ::: ::: ::: item-row ::: {.item-left .module-item} [BufferRedirect](struct.BufferRedirect.html "gag::BufferRedirect struct"){.struc t} ::: ::: {.item-right .docblock-short} Buffer output in an in-memory buffer. ::: ::: ::: item-row ::: {.item-left .module-item} [Gag](struct.Gag.html "gag::Gag struct"){.struct} ::: ::: {.item-right .docblock-short} Discard output until dropped. ::: ::: ::: item-row ::: {.item-left .module-item} [Hold](struct.Hold.html "gag::Hold struct"){.struct} ::: ::: {.item-right .docblock-short} Hold output until dropped. On drop, the held output is sent to the stdout/stderr. ::: ::: ::: item-row ::: {.item-left .module-item} [Redirect](struct.Redirect.html "gag::Redirect struct"){.struct} ::: ::: {.item-right .docblock-short} Redirect stderr/stdout to a file. ::: ::: ::: item-row ::: {.item-left .module-item} [RedirectError](struct.RedirectError.html "gag::RedirectError struct"){.struct} ::: ::: {.item-right .docblock-short} 2) An empty package rust-gag+default-devel-1.0.0-1.fc37.noarch.rpm is created 3) File timestamps are 1 January 1970, probably due to how automated packaging from a crate works. 4) -- You are receiving this mail because: You are always notified about changes to this product and component You are on the CC list for the bug. https://bugzilla.redhat.com/show_bug.cgi?id=2103367 _______________________________________________ package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure