Skip to content
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

Update for cpesearch Helper Function, formatting #482

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell-allowed-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ clion
cmdline
configfile
confopts
cpesearch
cran
cryptsetup
cxxflags
Expand Down
2 changes: 1 addition & 1 deletion docs/packaging/advanced-config/local-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
sudo eopkg index --skip-signing /var/lib/solbuild/local/ --output /var/lib/solbuild/local/eopkg-index.xml
```

Or, if you have our [helper functions](/docs/packaging/prepare-for-packaging#set-up-monorepo-helper-functions-optional) set up, you get the same result by running:
Or, if you have our [helper functions](/docs/packaging/prepare-for-packaging#set-up-repository-helper-functions-optional) set up, you get the same result by running:

```bash
localrepo_reindex
Expand Down Expand Up @@ -98,12 +98,12 @@

```
$ sudo eopkg ar Local /var/lib/solbuild/local/eopkg-index.xml.xz
Repo Local added to system.

Check warning on line 101 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Repo)
Updating repository: Local
Package database updated.
$ sudo eopkg ar Solus https://cdn.getsol.us/repo/unstable/eopkg-index.xml.xz
Repo already present with name Solus and same URL. Removing first.

Check warning on line 105 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Repo)
Repo Solus added to system.

Check warning on line 106 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Repo)
Updating repository: Solus
eopkg-index.xml.xz.sha1sum (40.0 B)100% 765.61 KB/s [00:00:00] [complete]
eopkg-index.xml.xz (2.1 MB)100% 914.38 KB/s [00:00:01] [complete]
Expand All @@ -124,12 +124,12 @@

#### Disabling the local solbuild repository in eopkg

To reset the system to use only packages from the official Solus repository, disable the "Local" `eopkg` repository using the command `sudo eopkg disable-repo Local`.

Check warning on line 127 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (repo)

The output should look similar to:

```
$ sudo eopkg disable-repo Local

Check warning on line 132 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (repo)
$ sudo eopkg lr
Local [inactive]
/var/lib/solbuild/local/eopkg-index.xml.xz
Expand All @@ -137,10 +137,10 @@
https://cdn.getsol.us/repo/unstable/eopkg-index.xml.xz
```

The "Local" `eopkg` repository can be re-enabled with `sudo eopkg enable-repo Local`.

Check warning on line 140 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (repo)

```
$ sudo eopkg enable-repo Local

Check warning on line 143 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (repo)
$ sudo eopkg lr
Local [active]
/var/lib/solbuild/local/eopkg-index.xml.xz
Expand Down
29 changes: 17 additions & 12 deletions docs/packaging/prepare-for-packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
sidebar_position: 1
---

# Prepare for Packaging
# Prepare for packaging

## Switch to the Unstable Repository
## Switch to the Unstable repository

Packages need to be built and tested against the "unstable" repository. If you don't want to switch your primary system to unstable, you can do your packaging work in a VM. We have Virtual Machine Manager in the repos.

Refer to [Repository Management](/docs/user/package-management/repo-management) to see how to add and switch to unstable.

## Setting up the Packager file
## Setting up the packager file

In order to utilize the build system, you must first set up a configuration file that has your packager details.

Expand All @@ -28,19 +28,21 @@
Matrix=@username:matrix.org
```

## Installing Development Tools
## Installing development tools

We need to install a few things in order to get started with packaging:

- `curl` is used by our optional Helper Functions
- `go-task` is used by our build tools for scripting
- `git` is used for version control of the solus sources
- `github-cli` is used to make working with GitHub easier
- `jq` is used by our optional Helper Functions
- `solbuild` is a lightweight container environment for building packages repeatably
- `solbuild-config-unstable` sets up solbuild for working with the `unstable` repository
- `ypkg` is the program that actually builds packages

```bash
sudo eopkg it go-task git github-cli solbuild solbuild-config-unstable ypkg
sudo eopkg it curl go-task git github-cli jq solbuild solbuild-config-unstable ypkg
```

## Setting up a GitHub account
Expand Down Expand Up @@ -79,15 +81,15 @@

Create your own fork of [getsolus/packages](https://github.com/getsolus/packages) using the GitHub web UI or [`gh` cli tool](https://cli.github.com/manual/gh_repo_fork) from the `github-cli` package. It will be forked to `github.com/yourgithubaccount/packages`.

## Clone Your Forked Package Repository
## Clone Your forked package repository

Create a local clone of the package repository you just forked. Here we are using the name `solus-packages` and cloning it into our home directoy. The rest of the documentation will presume this structure. You can choose a different name and path but will have to make sure to replace it in every command that refers to the `solus-packages` directory.

```bash
gh repo clone packages ~/solus-packages

Check warning on line 89 in docs/packaging/prepare-for-packaging.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (repo)
```

## Initialize Git hooks
## Initialize git hooks

Initialize Git hooks for working with the repository by running:

Expand All @@ -97,9 +99,11 @@

This makes it easy to create commits in the correct format, and will warn you about issues with changes you commit.

## Set up Monorepo Helper Functions (Optional)
## Set up repository helper functions (Optional)

After cloning your repo, create a symlink to source our helper functions for your shell. Then, start a new instance of the shell.
The helper functions are a collection of shell scripts that help you navigate the packages repository more quickly, and perform some specialized searches.

After cloning your repository, create a symlink to source the helper functions for your shell. Then, start a new instance of the shell.

### bash

Expand Down Expand Up @@ -130,13 +134,14 @@

| Function | Description | Usage |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **gotosoluspkgs** | Change directory to the solus monorepo from anywhere on the filesystem. | `gotosoluspkgs` |
| **cpesearch** | Search for CPE Names for packages. For use when writing the [`monitoring.yml`](/docs/packaging/monitoring.yml.md) file for a package | `cpesearch search-term` |
| **goroot** | When in the solus monorepo, change directory to the root directory of the git repository. | `goroot` |
| **gotopkg** | Change directory to any solus package. You can type part of the package name then double press `Tab` to get autocompletion for this function. | `gotopkg firefox` |
| **whatuses** | Find out what packages use a library by reading the `abi_used_libs` files. | `whatuses libfoobar.so.1` |
| **gotosoluspkgs** | Change directory to the solus monorepo from anywhere on the filesystem. | `gotosoluspkgs` |
| **whatprovides** | Find out what package provides a library by reading the `abi_libs` files. | `whatprovides libfoobar.so.1.` |
| **whatuses** | Find out what packages use a library by reading the `abi_used_libs` files. | `whatuses libfoobar.so.1` |

## Building Packages
## Building packages

Your system is now set up for package work.
If you are new to packaging, see [Your First Package Update](your-first-package-update.md).