Macports: ฉันจะติดตั้งพอร์ตโดยใช้เฉพาะเวอร์ชันจากวันที่ในอดีตได้อย่างไร
เมื่อสองปีก่อนฉันใช้ 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.
คำตอบ
Thank you to Lothar Haeger on the Macports mailing list for giving me the key hint I needed. What I had to do was:
Checkout a local copy of the Macports Port Tree from Github.
cd ~; git clone https://github.com/macports/macports-ports
Reset my local port tree to an earlier point in time.
cd macports-ports; git reset --hard
commit-hash-from-2018Generate a port index for my local port tree:
portindex
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]