Skip to content

Commit bb65040

Browse files
TraceyC77Tracey Clark
andauthored
bugfix: correct helper setup docs for bash and zsh (#593)
Co-authored-by: Tracey Clark <[email protected]>
1 parent 9d89384 commit bb65040

File tree

1 file changed

+50
-11
lines changed

1 file changed

+50
-11
lines changed

docs/packaging/prepare-for-packaging.md

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Prepare for Packaging
33
summary: Quick guide on getting your system set up for packaging on Solus
44
sidebar_position: 1
55
---
6-
76
# Prepare for packaging
87

98
## Switch to the Unstable repository
@@ -121,9 +120,17 @@ After cloning your repository, create a symlink to source the helper functions f
121120

122121
```bash
123122
mkdir -p ~/.bashrc.d
123+
chmod 700 ~/.bashrc.d
124124
ln -s ~/solus-packages/common/Scripts/helpers.sh ~/.bashrc.d/solus-monorepo-helpers.sh
125+
source ~/.bashrc
125126
```
126127

128+
:::note
129+
130+
By default, the system will load all files in `~/.bashrc.d` through code in `.bashrc`
131+
132+
:::
133+
127134
### fish
128135

129136
```bash
@@ -133,25 +140,57 @@ ln -s ~/solus-packages/common/Scripts/helpers.fish ~/.config/fish/conf.d/solus.f
133140

134141
### zsh
135142

143+
:::note
144+
145+
If you already have a customized `.zshrc` or config for `zsh`, you'll need to adapt these commands or edit your config by hand (e.g. instead of using the `cat` command)
146+
147+
:::
148+
136149
```bash
137150
mkdir -p ~/.zshrc.d
138-
printf "\nfpath=(~/.zshrc.d \$fpath)" >> ~/.zshrc
151+
chmod 700 ~/.zshrc.d
152+
cat <<eos >>! ~/.zshrc
153+
fpath=(\$HOME/.zshrc.d \$fpath)
154+
source \$HOME/.zshrc.d/solus-monorepo-helpers.zsh
155+
156+
eos
157+
139158
source ~/.zshrc
140-
ln -s ~/solus-packages/common/Scripts/helpers.zsh ~/.zshrc.d/solus-monorepo-helpers.zsh
159+
```
160+
161+
This is what you need in your `.zshrc` (or another file loaded by `zsh`)
162+
163+
:::note
164+
165+
You may have more than what is shown here if you have customized things
166+
167+
:::
168+
169+
```bash
170+
fpath=($HOME/.zshrc.d $fpath)
171+
autoload -U $HOME/.zshrc.d/*
172+
source $HOME/.zshrc.d/solus-monorepo-helpers.zsh
173+
```
174+
175+
Verify that `$fpath` contains the needed directory with:
176+
177+
```bash
178+
echo $fpath | grep .zshrc.d
141179
```
142180

143181
---
144182

145183
You should now have the following available from your shell:
146184

147-
| Function | Description | Usage |
148-
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
149-
| **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` |
150-
| **goroot** | When in the Solus packages repository, change directory to the root directory. | `goroot` |
151-
| **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` |
152-
| **gotosoluspkgs** | Change directory to the Solus packages repository from anywhere on the filesystem. | `gotosoluspkgs` |
153-
| **whatprovides** | Find out what package provides a library by reading the `abi_libs` files. | `whatprovides libfoobar.so.1` |
154-
| **whatuses** | Find out what packages use a library by reading the `abi_used_libs` files. | `whatuses libfoobar.so.1` |
185+
186+
| Function | Description | Usage |
187+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
188+
| **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` |
189+
| **goroot** | When in the Solus packages repository, change directory to the root directory. | `goroot` |
190+
| **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` |
191+
| **gotosoluspkgs** | Change directory to the Solus packages repository from anywhere on the filesystem. | `gotosoluspkgs` |
192+
| **whatprovides** | Find out what package provides a library by reading the`abi_libs` files. | `whatprovides libfoobar.so.1` |
193+
| **whatuses** | Find out what packages use a library by reading the`abi_used_libs` files. | `whatuses libfoobar.so.1` |
155194

156195
## Building packages
157196

0 commit comments

Comments
 (0)