Moving to the FreeBSD git repo for src

Just like I moved devgit.freshports.org from github to git.freebsd.org for the doc repo on Thursday, today (Monday), I’m doing the same thing for the src repo.

The jail uses storage on an nvd-based zpool. First, create a new filesystem:

[dan@slocum:~] $ sudo zfs create nvd/freshports/devgit/ingress/repos/src

You can see it appear here in the jail, but with the wrong permissions:

[dan@devgit-ingress01:/var/db/ingress/repos] $ ls -l
total 22
drwxr-xr-x  23 ingress  ingress  27 Dec 17 23:55 doc
drwxr-xr-x  26 ingress  ingress  45 Dec 20 03:03 freebsd
drwxr-xr-x  23 ingress  ingress  26 Dec  8 07:12 freebsd-doc
drwxr-xr-x  69 ingress  ingress  84 Dec 19 09:18 freebsd-ports
drwxr-xr-x  69 ingress  ingress  84 Nov 22 19:28 freebsd-ports-quarterly
-rw-r--r--   1 ingress  ingress  41 Dec 21 18:54 latest.doc
-rw-r--r--   1 ingress  ingress  41 Dec 21 18:54 latest.freebsd
-rw-r--r--   1 ingress  ingress  41 Dec 18 00:12 latest.freebsd-doc
-rw-r--r--   1 ingress  ingress  41 Dec 21 18:54 latest.freebsd-ports
-rw-r--r--   1 ingress  ingress  41 Dec 21 18:54 latest.freebsd-ports-quarterly
drwxr-xr-x   2 root     wheel     2 Dec 21 18:55 src
[dan@devgit-ingress01:/var/db/ingress/repos] $ 

So I fix that:

[dan@devgit-ingress01:/var/db/ingress/repos] $ sudo chown ingress:ingress src

Then clone the repo:

[dan@devgit-ingress01:/var/db/ingress/repos] $ sudo su -l ingress
$ bash
[ingress@devgit-ingress01 ~]$ cd repos
[ingress@devgit-ingress01 ~/repos]$ git clone https://git.FreeBSD.org/src.git
Cloning into 'src'...
remote: Enumerating objects: 3798472, done.
remote: Counting objects: 100% (3798472/3798472), done.
remote: Compressing objects: 100% (744779/744779), done.
remote: Total 3798472 (delta 3016406), reused 3757055 (delta 2987426), pack-reused 0
Receiving objects: 100% (3798472/3798472), 1.10 GiB | 11.63 MiB/s, done.
Resolving deltas: 100% (3016406/3016406), done.
Updating files: 100% (81314/81314), done.
[ingress@devgit-ingress01 ~/repos]$ ls -l
total 24
drwxr-xr-x  23 ingress  ingress  27 Dec 17 23:55 doc
drwxr-xr-x  26 ingress  ingress  45 Dec 20 03:03 freebsd
drwxr-xr-x  23 ingress  ingress  26 Dec  8 07:12 freebsd-doc
drwxr-xr-x  69 ingress  ingress  84 Dec 19 09:18 freebsd-ports
drwxr-xr-x  69 ingress  ingress  84 Nov 22 19:28 freebsd-ports-quarterly
-rw-r--r--   1 ingress  ingress  41 Dec 21 19:03 latest.doc
-rw-r--r--   1 ingress  ingress  41 Dec 21 19:03 latest.freebsd
-rw-r--r--   1 ingress  ingress  41 Dec 18 00:12 latest.freebsd-doc
-rw-r--r--   1 ingress  ingress  41 Dec 21 19:03 latest.freebsd-ports
-rw-r--r--   1 ingress  ingress  41 Dec 21 19:03 latest.freebsd-ports-quarterly
drwxr-xr-x  26 ingress  ingress  44 Dec 21 19:00 src
[ingress@devgit-ingress01 ~/repos]$ 

It takes up about 2.5G of space:

[ingress@devgit-ingress01 ~/repos]$ du -ch -d 0 src
2.4G	src
2.4G	total

The next step: set the commit marker.

That would be commit 3cc0c0d66a065554459bd2f9b4f80cc07426464a.

Creating the commit marker:

[ingress@devgit-ingress01 ~/repos]$ echo 3cc0c0d66a065554459bd2f9b4f80cc07426464a > latest.src
[ingress@devgit-ingress01 ~/repos]$ cat latest.src
3cc0c0d66a065554459bd2f9b4f80cc07426464a
[ingress@devgit-ingress01 ~/repos]$ 

A plan for the future involves setting this via a tag in the repo.

The configuration file change is within /usr/local/etc/freshports/config.pm:

convert_repo_label_to_directory(){
  repo=$1
  
  case $repo in
     src) dir='src';;
     src-stable-12) dir='freebsd-stable-12';;
     doc) dir='doc';;
     ports) dir='freebsd-ports';;
     ports-quarterly) dir='freebsd-ports-quarterly';;
     *) dir='';;
  esac

  echo $dir
}

The fix is on line 5. It was: freebsd, it is now src.

Those values correspond to the GitHub repo name (https://github.com/freebsd/freebsd/) and the FreeeBSD repo name (https://cgit.freebsd.org/src/ respectivtely.

For the truly bored amongst you, here are the logs for the first processing of the src repo:

2020.12.21 19:18:12 git-delta.sh Now processing repo: src
2020.12.21 19:18:12 git-delta.sh REPODIR='/var/db/ingress/repos/src' exists
2020.12.21 19:18:12 git-delta.sh LATEST_FILE='/var/db/ingress/repos/latest.src' exists
2020.12.21 19:18:12 git-delta.sh Repodir is /var/db/ingress/repos/src
2020.12.21 19:18:12 git-delta.sh Running: /usr/local/bin/git pull:
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Already up to date.
2020.12.21 19:18:12 git-delta.sh Done.
2020.12.21 19:18:12 git-delta.sh STARTPOINT = 3cc0c0d66a065554459bd2f9b4f80cc07426464a
2020.12.21 19:18:12 git-delta.sh Running: /usr/local/bin/git rev-list 3cc0c0d66a065554459bd2f9b4f80cc07426464a..HEAD
2020.12.21 19:18:12 git-delta.sh Done.
2020.12.21 19:18:12 git-delta.sh The commits found are:
2020.12.21 19:18:12 git-delta.sh /usr/local/libexec/freshports/git-to-freshports-xml.py --repo src --path /var/db/ingress/repos/src --commit 3cc0c0d66a065554459bd2f9b4f80cc07426464a --spooling /var/db/ingress/message-queues/spooling --output /var/db/ingress/message-queues/incoming
2020.12.21 19:18:12 git-delta.sh Ending

I did run that git config pull.rebase false later.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top