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

Some AUR packages are in to update instead of previous section #31

Closed
kepi opened this issue Jul 23, 2020 · 4 comments · Fixed by #39
Closed

Some AUR packages are in to update instead of previous section #31

kepi opened this issue Jul 23, 2020 · 4 comments · Fixed by #39
Assignees
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest

Comments

@kepi
Copy link

kepi commented Jul 23, 2020

I have multiple packages installed from AUR which are offered for update every time I run yup but IMHO they shouldn't.

I.e. in todays output:

==> Checking for AUR updates...

==> Found 2 local package(s) that are newer than their AUR package
    numix-icon-theme-pack-git  r6767-1 has AUR version r6086-1
    ttf-consolas-with-yahei-powerline-git  r.-1 has AUR version r14.b6e9163-1

==> Found 7 AUR package(s) to update:
    1   mbsync-git 946.cab1460-1 -> 912.95d18e2-1
    2   mu-git 1.4.7.119.g6cea9fcd-1 -> 1.3.6.114.g0dced59c-1
    3   qutebrowser-git 1.13.1.r269.gcee5d0b0d-1 -> 1.13.0.r2.gcb15192cd-1
    4   screenkey-git 1.1.r12.ge812693-1 -> 1.1.r5.g467662b-1
    5   ttf-iosevka-ss05 3.3.0-1 -> 3.3.1-1
    6   ttf-iosevka-term-ss05 3.2.2-1 -> 3.3.1-1
    7   ttf-nerd-fonts-hack-complete-git 20200723-1 -> 20180330-1

I believe that 1, 2, 3, 4 and 7 are more recent then AUR versions and should be in "found X local pcakges that are newer" section.

If I'm right, it seems that newerVersion function might be to blame:

func newerVersion(oldVersion, newVersion string) bool {

I'm not really fluent in Go and I'm not sure if I'm correct so no pull request (at least for now).

Thanks

@kepi kepi changed the title Some AUR packages are in to update instead of Some AUR packages are in to update instead of previous section Jul 23, 2020
@ericm ericm added good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed labels Oct 10, 2020
@ericm ericm self-assigned this Oct 20, 2020
@yochananmarqos
Copy link

yochananmarqos commented Oct 16, 2021

Bumping this as yup is completely useless for updating AUR VCS (devel) packages. It thinks the version in the AUR is newer no matter what version is installed.

@ericm ericm added bug Something isn't working and removed help wanted Extra attention is needed labels Oct 17, 2021
@ericm
Copy link
Owner

ericm commented Oct 17, 2021

Ok I'll get working on this

Ballasi added a commit to fourchettes/yup that referenced this issue Mar 17, 2022
The function sometimes accepts version tags as newer versions even
though it is not the case, the whole function has been rewritten to work
as follows:

- checks every number between dots one by one
- if it is a number (or 'r' + number) and it is different, then it
  returns the comparaison of the number
- if it is the same number, then it ignores and iterate to the next
  number
- if it is not a number but a commit hash, it returns true if is
  different. In all cases, commit hashes must be placed at the end of
  version tags so a complete return would work as intended

A series of tests has been done on this function and can be run online,
with comparaison with the previous implementation:
https://go.dev/play/p/QUm8zPl_Ngw

Fixes ericm#31
Ballasi added a commit to fourchettes/yup that referenced this issue Mar 17, 2022
The function sometimes accepts version tags as newer versions even
though it is not the case, the whole function has been rewritten to work
as follows:

- checks every number between dots one by one
- if it is a number (or 'r' + number) and it is different, then it
  returns the comparison of the number
- if it is the same number, then it ignores and iterate to the next
  number
- if it is not a number but a commit hash, it returns true if is
  different. In all cases, commit hashes must be placed at the end of
  version tags so a complete return would work as intended

A series of tests has been done on this function and can be run online,
with comparison with the previous implementation:
https://go.dev/play/p/QUm8zPl_Ngw

Fixes ericm#31
@Ballasi
Copy link
Contributor

Ballasi commented Mar 17, 2022

For some reason, there are values a and b that returns true for both newerVersion(a, b) and newerVersion(b, a) calls.

I have been working on an implementation that would solve this problem, I have rewritten the function entirely. I have done some tests to try out the implementation, you can find it here: https://go.dev/play/p/QUm8zPl_Ngw

Hope that helps!

@ericm
Copy link
Owner

ericm commented Mar 18, 2022

For some reason, there are values a and b that returns true for both newerVersion(a, b) and newerVersion(b, a) calls.

I have been working on an implementation that would solve this problem, I have rewritten the function entirely. I have done some tests to try out the implementation, you can find it here: https://go.dev/play/p/QUm8zPl_Ngw

Hope that helps!

This looks great! I'll get reviewing #39

@ericm ericm closed this as completed in #39 Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants