Macports: ฉันจะติดตั้งพอร์ตโดยใช้เฉพาะเวอร์ชันจากวันที่ในอดีตได้อย่างไร

Aug 20 2020

เมื่อสองปีก่อนฉันใช้ Macports เพื่อติดตั้งสำเนาของ Docker Machine ลงในคอมพิวเตอร์ที่ใช้ OS X 10.9 "Mavericks" สิ่งที่ฉันต้องทำคือพิมพ์sudo port install Docker-machineและ Macports ก็ดึงและรวบรวมทุกสิ่งที่ฉันต้องการโดยอัตโนมัติ

ในฐานะที่เป็น 2020 สิงหาคมนี้ไม่ทำงานบน Mavericks เนื่องจากข้อผิดพลาดในเวอร์ชั่นล่าสุดไปและ / หรือกรอบการสนับสนุนมรดก ตั้งแต่ Mavericks เก่ามากแตกนี้เป็นที่เข้าใจ† แต่หางเครื่องไม่ทำงานเป็นสองปีที่ผ่านมาและฉันจะไม่คิดใช้รุ่นเก่า

Using a clean Macports prefix, how can I install ports using only software that existed as of a certain date in the past? I do not want to merely install an older version of Docker Machine; I want to install an older version of Docker Machine and every port that Docker Machine depends on, such as Go and Legacy Support.

On Debian, this would be super easy; I'd just edit sources.list to point to a snapshot. How can I do something similar in Macports? The full Macports project history is tracked in Git, so I'm pretty sure it's possible.


† I'm delighted that Macports supports Mavericks at all. With Homebrew I would be completely SOL.

‡ Because I tried that, and it doesn't work. Which isn't particularly surprising given how ports and their dependencies are interconnected. For reference, the procedure for installing an older version of a single package is documented here.

คำตอบ

4 Wowfunhappy Aug 21 2020 at 01:06

Thank you to Lothar Haeger on the Macports mailing list for giving me the key hint I needed. What I had to do was:

  1. Checkout a local copy of the Macports Port Tree from Github. cd ~; git clone https://github.com/macports/macports-ports

  2. Reset my local port tree to an earlier point in time. cd macports-ports; git reset --hard commit-hash-from-2018

  3. Generate a port index for my local port tree: portindex

  4. Tell Macports to use my local port tree in place of the official online one. To do this, I opened macports's sources.conf (generally in /opt/local/etc/macports/) in a text editor, commented out the default URL at the bottom of the file, and added after it: file:///Users/my-user-name/macports-ports [default]