xref: /freebsd/contrib/blocklist/FreeBSD-upgrade (revision 715cc257137099e022c7eecea4cd6995bb7604a3)
1FreeBSD maintainer's guide to blocklist
2=======================================
3
4These instructions describe the blocklist vendor import procedure,
5following the Committer's Guide
6(https://docs.freebsd.org/en/articles/committers-guide/#vendor-import-git).
7
8> [!NOTE]
9> This guide follows the convention that a `freebsd` remote is pointing
10> to gitrepo.FreeBSD.org/src.git.
11
121.	Grab our top level directory:
13
14		freebsd=$(git rev-parse --show-toplevel)
15
162.	Create a Git worktree under a temporary directory:
17
18		worktree=$(mktemp -d -t blocklist)
19		git worktree add ${worktree} vendor/blocklist
20
213.	Clone the blocklist repo (https://github.com/zoulasc/blocklist.git):
22
23		blocklist_repo=$(mktemp -d -t blocklist-repo)
24		git clone https://github.com/zoulasc/blocklist.git ${blocklist_repo}
25		cd ${blocklist_repo}
26		commit=$(git rev-parse HEAD)
27		commit_short=$(git rev-parse --short HEAD)
28		date=$(git show -s --format=%cd --date=format:%Y-%m-%d)
29		tag=$(git show -s --format=%cd --date=format:%Y%m%d)
30
314.	Copy to the vendor branch using rsync (net/rsync):
32
33		rsync -va --del --exclude=".git" ${blocklist_repo}/ ${worktree}
34
355.	Take care of added/deleted files:
36
37		cd ${worktree}
38		git add -A ${worktree}
39		git status
40		git diff --staged
41
426.	Commit:
43
44		message=$(cat <<-EOM
45		blocklist ${date} (${commit_short})
46
47		Upstream hash ${commit}.
48
49		Obtained from:	https://github.com/zoulasc/blocklist
50		EOM
51		)
52		git commit -e -m "Vendor import of ${message}"
53
547.	Tag:
55
56		git tag -a -e -m "Tag ${message}" vendor/blocklist/${tag}
57
58	At this point, the vendor branch can be pushed to the FreeBSD
59	repo via:
60
61		git push --follow-tags freebsd vendor/blocklist
62
638.	Merge from the vendor branch:
64
65		cd ${freebsd}
66		git subtree merge -P contrib/blocklist vendor/blocklist
67
68	Some files may have been deleted from FreeBSD's copy of
69	blocklist.  When git prompts for these deleted files during the
70	merge, choose 'd' (leaving them deleted).
71
729.	Resolve conflicts.
73
7410.	Diff against the vendor branch:
75
76		git diff --diff-filter=M vendor/blocklist/${tag} HEAD:contrib/blocklist
77
78	Review the diff for any unexpected changes.
79
8011.	Run the FreeBSD changes script:
81
82		cd contrib/blocklist
83		sh ./freebsd-changes.sh
84
8512.	If source files have been added or removed, update the
86	appropriate makefiles to reflect changes in the vendor's
87	Makefile.in.
88
8913.	Build and install world, reboot, test.  Pay particular attention
90	to the fingerd(8) and sshd(8) integration.
91
9214.	Commit.
93
9415.	Cleanup:
95
96		rm -fr ${blocklist_repo} ${worktree}
97		git worktree prune
98