Skip to content
Open
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The list of provided helper functions:
- `AddPackage [--foreign] PACKAGE...` - Adds a package to the list of packages to be installed.
- `RemovePackage [--foreign] PACKAGE...` - Removes an earlier-added package to the list of packages to be installed.
- `IgnorePackage [--foreign] PACKAGE...` - Adds a package to the list of [packages to be ignored](#ignoring-packages).
- `IgnorePackagesAll` - Adds all installed packages to the list of [packages to be ignored](#ignoring-packages).
- `AddPackageGroup GROUP` - Adds all packages currently in the given group to the list of packages to be installed.
- `CopyFile PATH [MODE [OWNER [GROUP]]]` - Copies a file from the `files` subdirectory to the output.
- `CopyFileTo SRC-PATH DST-PATH [MODE [OWNER [GROUP]]]` - As above, but allows source and output paths to vary.
Expand Down Expand Up @@ -174,6 +175,12 @@ IgnorePackage linux-git

`aconfmgr save` will not update the configuration based on ignored packages' presence or absence, and `aconfmgr apply` will not install or uninstall them. The packages should also not be present in the configuration's package list, of course. To ignore a foreign package (e.g. a non-AUR foreign package), use the `--foreign` switch (e.g. `IgnorePackage --foreign my-flobulator`).

To ignore all installed packages use the `IgnorePackagesAll` function:

```bash
IgnorePackagesAll
```

### Inlining files

In the output generated by `aconfmgr save`, non-empty new or modified files are copied in their entirety to the configuration directory, under the `/files/` subdirectory, accompanied by a `Copyfile` invocation. However, this can sometimes be wasteful or unwieldy if the file consists of a single line, or has one line changed out of a thousand. This section describes some techniques to move the edits into the configuration files entirely.
Expand Down
11 changes: 11 additions & 0 deletions src/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ function IgnorePackage() {
fi
}

#
# IgnorePackagesAll - does not accept arguments
#
# Ignores all installed packages. Usefule if you want to use another manger for managing packages.
#

function IgnorePackagesAll() {
mapfile -t ignore_foreign_packages < <(pacman -Qqm)
mapfile -t ignore_packages < <(pacman -Qqn)
}

#
# CopyFile PATH [MODE [OWNER [GROUP]]]
#
Expand Down