#3 Implement --dry-run functionality
Merged by clime. Opened by frostyx.
frostyx/prunerepo dry-run  into  master

Download 3.patch

Implementing a --dry-run functionality so we can work on prunerepo much easier.

[jkadlcik@chromie prunerepo]$ ./prunerepo /tmp/fedora-28-i386/ --dry-run 
Removing obsoleted packages...
Executing: dnf repoquery --repofrompath=prunerepo_query,/tmp/fedora-28-i386 --repo=prunerepo_query --refresh --queryformat="%{location}" --quiet -
Executing: dnf repoquery --repofrompath=prunerepo_query,/tmp/fedora-28-i386 --repo=prunerepo_query --refresh --queryformat="%{location}" --quiet
Removing: /tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.i686.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-2.8-1.fc28.i686.rpm
Removing: /tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003197-hello/hello-debuginfo-2.8-1.fc28.i686.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-debuginfo-2.8-1.fc28.i686.rpm
Removing: /tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003197-hello/hello-debugsource-2.8-1.fc28.i686.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-2.8-1.fc28.src.rpm
Removing: /tmp/fedora-28-i386/00003196-hello/hello-debugsource-2.8-1.fc28.i686.rpm
Recreating repository...
Executing: /usr/bin/createrepo_c --database --update --local-sqlite --cachedir /tmp/ --workers 8 /tmp/fedora-28-i386/
[jkadlcik@chromie prunerepo]$ ls /tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.src.rpm
/tmp/fedora-28-i386/00003197-hello/hello-2.8-1.fc28.src.rpm

While the mentioned files are not removed.

[jkadlcik@chromie prunerepo]$ ls /tmp/fedora-28-i386/00003197-hello/hello-debuginfo-2.8-1.fc28.i686.rpm
/tmp/fedora-28-i386/00003197-hello/hello-debuginfo-2.8-1.fc28.i686.rpm

What about using srpm_path here instead of evaluating the expression again.

rebased onto 1f4ecb9bbfc169f85dd06d6cca7b77c429e2bf54

What about using srpm_path here instead of evaluating the expression again.

I totally missed that. Thank you. Fixed.

Pull-Request has been merged by clime

This PR has been migrated to GitHub as a placeholder issue:
https://github.com/fedora-copr/prunerepo/issues/3

Metadata