zbrateam / Zebra

🦓 A Useful Package Manager for iOS
https://getzbra.com
GNU General Public License v3.0
1.18k stars 191 forks source link

repos with both rootful & rootless pkgs may make Zebra select a rootless pkg for upgrade on rootful jbs #2032

Closed blanxd closed 1 year ago

blanxd commented 1 year ago

Describe the bug If in the Packages file, rootful (iphoneos-arm) is 1st and rootless (iphoneos-arm64) is below it then everything seems to work just fine.

If it's the other way around and the iphoneos-arm64 one is 1st in Packages, then swiping and clicking Upgrade works, but going to the depiction view and clicking Modify > Upgrade selects the rootless one although the device has an older rootful version installed.

Also, if the repo serves the previous versions for a package, also both types, then clicking on Downgrade (both from the swipe or the Modify button), lists two rows of the previous version. They are ordered the way they are in the Packages file, whichever is 1st is on top in the "Select Version" modal view.

To Reproduce Put 5 or 6 "Package:" blocks in a Packages file, 3 versions of the same package, 2 different architectures for the newer versions (iphoneos-arm and iphoneos-arm64), the oldest version doesn't need the rootless version listed. The blocks for the same version should be identical except for the fields "Architecture:", "Filename:", and the hashes (and maybe the "Size:" and "Installed-Size:"). On a device with a rootful jb, have the oldest version or the middle version installed and try upgrading it while having the 2 different architecture blocks of the newest version one after the other and vice versa in the Packages file.

For the downgrade issue to occur just get the package upgraded and click on Downgrade to see the list of the available versions, it lists all of them, 3 or 4 rows depending if you had the oldest version also listed as rootless.

Expected behavior For upgrades, it should select the same "Architecture" of the package, as the one currently installed (from the Modify button). For downgrades, it could also only list the corresponding ones, based on what's already installed.

Device Information:

Additional context The blocks in the Packages file don't really need to be one right after the other for this nuicance to occur, I mean if other packages are in between or whatever, it acts on the particular package obviously but the order does matter. Also, at the moment I'm working with package version numbers containing tildes denoting alphas/betas, like eg. "1.1.0\~a15" vs "1.1.0\~a16" vs "1.1.0\~a18" "1.6\~b3" vs "1.6\~b4"

AronL commented 1 year ago

Can confirm I'm having the same issue.

blanxd commented 1 year ago

looks like 1.1.31 mends this, at least at 1st glance.