/usr/ports from release media and git

As in portsnap? No, I think you need to do 'git clone'.

In theory, you could do the clone operation on a different machine and - space permitting - include the cloned repo on your install media.
 
Thank you. I have switched to using git. Can't see much point in continuing to distribute ports on the release media, once portsnap is removed.
 
Thank you. I have switched to using git. Can't see much point in continuing to distribute ports on the release media, once portsnap is removed.
An extracted ports tree still works even if it doesn't have an update plan. It could be used to install a (potentially outdated) git or similar instead of using pkg to do it to then prepare a supported upgrade path.

Wonder if there is consideration for providing a git compatible ports tree as a package for install media.
 
For git i have a script
Code:
#!/usr/local/bin/zsh -v
rm -r /usr/ports/* /usr/ports/.??*
cd /usr/ports/
rmdir /usr/ports/distfiles
rmdir /usr/ports/packages
git clone --branch 2024Q2 https://git.FreeBSD.org/ports.git /usr/ports
mkdir /usr/ports/distfiles
mkdir /usr/ports/packages
 
rmdir /usr/ports/distfiles
rmdir /usr/ports/packages
.
You just removed those directories with the previous rm -r /usr/ports/* /usr/ports/.??*. You might not want to actually delete /usr/ports/distfiles because you will have to redownload all those files again. Maybe just move it out of the way.
 
Wonder if there is consideration for providing a git compatible ports tree as a package for install media.
Probably not.

It's easy feasible to create a Git compatible ports.txz. Remove in /usr/src/release/Makefile
Rich (BB code):
150 ports.txz:
   
154          --exclude .git
(The same can be done with src.txz)

but the distribution file size is 10x larger. The average ports.txz file is ~ 50MB.

From a shallow main ports clone created file (no packages/ and distfiles/):
Rich (BB code):
 # make ports.txz -C /usr/src-14.0/release

 % du -hA /usr/obj/usr/src-14.0/amd64.amd64/release/ports.txz
502M    /usr/obj/usr/src-14.0/amd64.amd64/release/ports.txz

This would make the installation image ~ 450MB larger, with a full clone even much larger.
 
Assuming you don't need anything other than the main branch, and don't require all the history locally:

# git clone --single-branch --depth 1 -b main https://git.FreeBSD.org/ports.git /usr/ports
Cloning into '/usr/ports'...
remote: Enumerating objects: 196240, done.
remote: Counting objects: 100% (196240/196240), done.
remote: Compressing objects: 100% (183805/183805), done.
remote: Total 196240 (delta 12629), reused 122619 (delta 5828), pack-reused 0
Receiving objects: 100% (196240/196240), 87.15 MiB | 5.00 MiB/s, done.
Resolving deltas: 100% (12629/12629), done.
Updating files: 100% (159892/159892), done.


Only has to download ~100MB. Expands out on disk to ~ 550MB with 110MB .git/ repository + 440MB of checked-out files — apparent sizes, actual disk usage is higher due to tons of small files.

(Doesn't do anything for reusing the local files, but it needs to download the repo anyway (if you're going to use it to track / update), so the re-creating local files isn't a big additional task.)
 
Back
Top