Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide unchanged option does not hide moved unchanged files #53

Open
locobastos opened this issue Oct 10, 2022 · 1 comment
Open

Hide unchanged option does not hide moved unchanged files #53

locobastos opened this issue Oct 10, 2022 · 1 comment

Comments

@locobastos
Copy link

Hello,

Your program is very useful is almost all cases but in some rare cases, where the package are built unconventionally, the diff report is not usable.

Let me explain:

In my company, we are building our software/web services "unconventionally", and we are installing each version in a separate folder:

/opt/my_company/my_product/1.0.0/all_my_files...
/opt/my_company/my_product/1.1.0/all_my_files...
/opt/my_company/my_product/1.2.0/all_my_files...
/opt/my_company/my_product/1.3.0/all_my_files...

Between version 1.2.0 and version 1.3.0, it may have few changes.

When I'm running pkgdiff on both RPM (we are using RPM-based Linux servers), ALL files are reported as moved (yes, it's true) with a Delta = 0%

My RFE is to hide these results when we are using the -hide-unchanged option to keep only files with real delta, even if they are moved.

To reach this point, I've changed this part of code:

https://github.com/lvc/pkgdiff/blob/master/pkgdiff.pl#L2171

2169    if($HideUnchanged)
2170    {
2171        if($Info{"Status"} eq "unchanged")
2172        {  # do not show unchanged files
2173            next;
2174        }
2175    }

to add:

2169    if($HideUnchanged)
2170    {
2171        if($Info{"Status"} eq "unchanged" or show_number($Info{"Rate"}*100) eq 0)
2172        {  # do not show unchanged files
2173            next;
2174        }
2175    }

This let me know which files are modified between two packages ignoring moved file without any modification.

Thank you!

@locobastos
Copy link
Author

locobastos commented Dec 6, 2022

Let's take a real example with Java JDK which installs multiple versions of the same package at different directory:

  • /usr/java/jdk-17.0.1/
  • /usr/java/jdk-17.0.2/
  • /usr/java/jdk-17.0.3/
  • ...

You can download these versions here thanks to the WayBackMachine

With this kind of package, I would like an option to ignore install folder. It means that with this option, files '/usr/java/jdk-17.0.1/conf/logging.properties' and '/usr/java/jdk-17.0.2/conf/logging.properties' should show the same result as if both packages install their files on the same folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant