tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

osxcross-macports doesn't check package version #301

Closed mite-user closed 2 years ago

mite-user commented 2 years ago

osxcross-macports fetches the list of available packages for a port from $MIRROR/$pkgname/?C=M;O=A Because of C=M part, links are sorted by compilation date. In some cases the most recent version is actually the wrong one.

icu was upgraded to v69.1 then downgraded to v67.1 https://github.com/macports/macports-ports/commit/11c3ad833b00321f30ac367635eead018b640cd5

there are still most recent builds which are v69.1 https://packages.macports.org/icu/?C=M;O=A

osxcross-macports downloads v69.1 of icu while other packages expect v67.1

Possible solutions
  1. Rewrite parts of osxcross-macports to use PortIndex and PortIndex.quick instead of generated index cache. PortIndex and PortIndex.quick can be retrieved from one of "Portfiles" mirrors.

link to PortIndex should be ${index_source}PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex

example rsync://rsync.macports.org/macports/release/tarballs/PortIndex_darwin_20_i386/PortIndex

Looks like the main mirror can be browsed so it's easy to figure out how to construct the needed links. https://rsync.macports.org/macports/release/tarballs/

  1. When installing a port, get current version number from ports.macports.org
    pkgversion="$(getFileStdout "https://ports.macports.org/api/v1/ports/$pkgname/?format=json" | \
              grep -o -E '"version":"[^"]+"' | \
              cut -d'"' -f4)"
mite-user commented 2 years ago

Fixed #302