-
Notifications
You must be signed in to change notification settings - Fork 16
Adding Maintaining GhostBSD Ports from FreeBSD Ports
#85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ports Contribution | ||
|
||
Welcome to the GhostBSD ports contribution documentation! Here’s how you can help maintain our ports tree and updated ports. | ||
|
||
- [Maintaining GhostBSD Ports in Sync with FreeBSD Ports](maintaining-ports-tree.md) - Learn how to keep our ports current with FreeBSD. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Maintaining GhostBSD Ports from FreeBSD Ports | ||
|
||
## Purpose | ||
This guide explains how to keep the GhostBSD ports tree (https://github.com/ghostbsd/ghostbsd-ports) current with the upstream FreeBSD ports tree (https://github.com/freebsd/freebsd-ports), resolve merge conflicts, and test changes before submission. | ||
|
||
## Prerequisites | ||
- Git installed and configured with access to GitHub. | ||
- Basic understanding of Git commands and FreeBSD ports structure. | ||
- `poudriere` installed for testing (optional but recommended). | ||
- A local working directory (e.g., `~/ghostbsd-ports`). | ||
|
||
--- | ||
|
||
## Step-by-Step Instructions | ||
|
||
### 1. Clone the Repository and Configure Remotes | ||
Clone the GhostBSD ports repository if you don’t already have it: | ||
```shell | ||
git clone https://github.com/ghostbsd/ghostbsd-ports.git | ||
cd ghostbsd-ports | ||
``` | ||
Add the FreeBSD ports repository as a remote: | ||
```shell | ||
git remote add freebsd https://github.com/freebsd/freebsd-ports.git | ||
``` | ||
Verify the remotes: | ||
```shell | ||
git remote -v | ||
``` | ||
Expected output: | ||
``` | ||
freebsd https://github.com/freebsd/freebsd-ports.git (fetch) | ||
freebsd https://github.com/freebsd/freebsd-ports.git (push) | ||
origin https://github.com/ghostbsd/ghostbsd-ports.git (fetch) | ||
origin https://github.com/ghostbsd/ghostbsd-ports.git (push) | ||
``` | ||
|
||
**Note**: If the `freebsd` remote is already set, skip the `git remote add` step. | ||
|
||
--- | ||
|
||
### 2. Create a New Working Branch | ||
Always work in a feature branch to keep `master` clean: | ||
```shell | ||
git checkout master | ||
git pull origin master # Ensure your local master is up-to-date | ||
git checkout -b my-branch-name | ||
``` | ||
- Replace `my-branch-name` with a descriptive name (e.g., `sync-freebsd-20250403`). | ||
- This isolates your changes and simplifies pull requests. | ||
|
||
--- | ||
|
||
### 3. Fetch and Merge FreeBSD Ports | ||
Fetch the latest changes from FreeBSD: | ||
```shell | ||
git fetch freebsd | ||
``` | ||
Merge FreeBSD’s `master` branch into your branch: | ||
```shell | ||
git merge freebsd/master | ||
``` | ||
|
||
- **If no conflicts occur**: Proceed to Step 5 (Testing). | ||
- **If conflicts occur**: Continue to Step 4 (Resolving Conflicts). | ||
|
||
You’re right—my wording for directory conflicts suggests restoring GhostBSD’s version when FreeBSD renames or removes a directory, but you want the resolver to ensure files are moved and the old directory is removed, aligning with FreeBSD’s change. Here’s the corrected section: | ||
|
||
--- | ||
|
||
### 4. Resolve Merge Conflicts | ||
Conflicts typically come from GhostBSD-specific changes (e.g., `Mk` files, `Makefiles`). FreeBSD updates, like renamed or removed directories, can also affect merges. Check https://github.com/freebsd/freebsd-ports for upstream changes. To find code conflicts: | ||
```bash | ||
grep -R '<<<<<<< HEAD' . | ||
``` | ||
This lists files with conflicts, marked like: | ||
``` | ||
<<<<<<< HEAD | ||
# GhostBSD-specific changes (your code) | ||
======= | ||
# FreeBSD changes (upstream code) | ||
>>>>>>> freebsd/master | ||
``` | ||
|
||
**Resolution Tips**: | ||
- Code conflicts require ports maintenance knowledge but are usually easy—often just changes Git can’t auto-merge. | ||
- **Keep GhostBSD changes**: Always preserve our customizations (e.g., in `Mk` files or `Makefiles`, the most common conflict sources EFE), especially fixes made before FreeBSD or changes to default options. | ||
- **Resolve `PORTVERSION` conflicts**: For `Makefile` `PORTVERSION`, use FreeBSD’s version (e.g., `1.2.4`) unless a comment above ours (e.g., `# Keep 1.2.3 for GhostBSD fix`) says to keep it. | ||
- **Handle directory conflicts**: If FreeBSD renamed or removed a directory, ensure all files are moved to the new location and remove the old directory (use `git status` to spot added/removed files). | ||
|
||
### 5. Test the Ports Tree (Dry Run) | ||
Before committing, test the updated ports tree with `poudriere`: | ||
```shell | ||
sudo poudriere bulk -j ghostbsd-amd64 -p ghostbsd-ports -an | ||
``` | ||
- `-j ghostbsd-amd64`: Specifies the jail (adjust if different). | ||
- `-p ghostbsd-ports`: Uses your local ports tree. | ||
- `-an`: Dry run (analyzes without building). | ||
|
||
Check the output for errors. If issues arise, fix the affected ports and repeat. | ||
|
||
### 6. Commit and Push Changes | ||
Stage all changes: | ||
```shell | ||
git add -A | ||
``` | ||
Commit changes: | ||
```shell | ||
git commit | ||
``` | ||
Push to your branch: | ||
```shell | ||
git push origin my-branch-name | ||
``` | ||
|
||
### 7. Submit Changes | ||
- Create a pull request (PR) on GitHub from `my-branch-name` to `ghostbsd-ports/master`. | ||
- Describe the changes and any resolved conflicts in the PR. | ||
- Await review and approval from maintainers. | ||
|
||
:::{note} | ||
Do not push directly to `master` unless you’re a maintainer with explicit permission. | ||
::: | ||
|
||
## Common Issues and Solutions | ||
- **Conflict in `Mk` Files**: FreeBSD may update build infrastructure. Retain GhostBSD-specific tweaks (e.g., custom `USES` flags). | ||
- **Renamed/Removed Directories**: If FreeBSD renamed or removed a directory, ensure all files are moved to the new location and delete the old directory during conflict resolution. | ||
- **Testing Fails**: Check `poudriere` logs (e.g., `/usr/local/poudriere/data/logs/bulk`) for clues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
myst-parser | ||
sphinx-rtd-theme | ||
sphinx-rtd-theme | ||
linkify-it-py |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.