# Local Full FreeBSD Ports Repo?



## CoryG (May 10, 2022)

I'd like to host a local replication of the entire FreeBSD Ports trees along with rolling updates which divert things like historical code changes within a repo to separate branches such that if there's a malicious editor of a repo they don't overwrite local copies of code.  Is there a simple way to do this?  How much storage space would a current snapshot consume?  Is there any data available on the growth of the size of the entire repo over time (years?)


----------



## patmaddox (May 14, 2022)

I just git cloned the ports repo, and it takes 2.7 GB of disk space. That is just the definitions for how to build ports, it's not the source for the applications themselves.

You can easily create a git branch with your own modifications. The simplest way to detect a malicious editor as you say though is to look at the commit history for the ports you're interested in.


----------



## Alexander88207 (May 14, 2022)

CoryG said:


> I'd like to host a local replication of the entire FreeBSD Ports trees along with rolling updates which divert things like historical code changes within a repo to separate branches such that if there's a malicious editor of a repo they don't overwrite local copies of code.  Is there a simple way to do this?  How much storage space would a current snapshot consume?  Is there any data available on the growth of the size of the entire repo over time (years?)



You could fork it on github and then apply an bot on it that updates the fork automatically.


----------



## Phishfry (May 15, 2022)

CoryG said:


> How much storage space would a current snapshot consume?


I know this is somewhat off topic but the entire package repository is around 80GB.
I don't know about the entire ports tree. I could easily see triple.


----------



## CoryG (May 16, 2022)

patmaddox said:


> I just git cloned the ports repo, and it takes 2.7 GB of disk space. That is just the definitions for how to build ports, it's not the source for the applications themselves.
> 
> You can easily create a git branch with your own modifications. The simplest way to detect a malicious editor as you say though is to look at the commit history for the ports you're interested in.


I'd be aiming for a backup of the complete source and re-pointing the ports-tree to the local cloned sources.  My initial guess would be TB of storage requirements for all the code and history but I don't know offhand how to calculate that without actually pulling everything or writing a script to query and sum every repo involved.


----------



## Jose (May 16, 2022)

"The FreeBSD Foundation was nice enough to purchase several 24-32 CPU 96GB machines to replace the old cluster. Using the new systems with Poudriere, the entire ports tree can be built from scratch in about 16 hours on one machine."

Doesn't say how much disk space is consumed, unfortunately, and it's from 8 years ago.

Edit: Unfortunately, the Freebsd infrastructure for building official packages is not documented very well. See here for details: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256537


----------



## Phishfry (May 16, 2022)

My package repository figure of ~80GB has the packages in *.txz format and I am unsure if that is compressed too.


----------

