mirror of
https://github.com/kiviktnm/decman.git
synced 2026-09-19 20:18:28 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf987c69d1 | ||
|
|
4d940ff0ac | ||
|
|
e93eed4309 | ||
|
|
61a06668eb | ||
|
|
d568c6fa84 | ||
|
|
741e6611ce |
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Decman is a declarative package & configuration manager for Arch Linux. It allows you to manage installed packages, your dotfiles, enabled systemd units, and run commands automatically. Your system is configured using python so your configuration can be very adaptive.
|
Decman is a declarative package & configuration manager for Arch Linux. It allows you to manage installed packages, your dotfiles, enabled systemd units, and run commands automatically. Your system is configured using python so your configuration can be very adaptive.
|
||||||
|
|
||||||
|
If you want, you can also use decman with other configuration languages. See the [example with TOML later in this README](#decman-with-other-configuration-languages).
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
A complete example is available in the `example`-directory of this repository. It also serves as documentation so reading it is recommended.
|
A complete example is available in the `example`-directory of this repository. It also serves as documentation so reading it is recommended.
|
||||||
@@ -102,6 +104,203 @@ Decman has some CLI options, to see them all run:
|
|||||||
decman --help
|
decman --help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Clone the decman PKGBUILD:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/kiviktnm/decman-pkgbuild.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Review the PKGBUILD and install it.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd decman-pkgbuild
|
||||||
|
makepkg -si
|
||||||
|
```
|
||||||
|
|
||||||
|
So far I have not created an AUR package for decman, because I'm not sure if other people would find decman useful.
|
||||||
|
|
||||||
|
## What decman manages?
|
||||||
|
|
||||||
|
### Packages
|
||||||
|
|
||||||
|
Decman can be used to install pacman packages. Decman will install all packages defined in the source and **remove** all packages not defined in the source. You can set packages to be ignored by decman, so that it won't install them nor remove them.
|
||||||
|
|
||||||
|
```py
|
||||||
|
# Include both foreign and pacman packages here.
|
||||||
|
decman.ignored_packages += ["yay", "opendoas"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Foreign packages
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Building of foreign packages is not the primary function of decman. There are some issues that I may or may not fix.
|
||||||
|
> If you can't build a package using decman, consider adding it to `ignored_packages` and building it yourself.
|
||||||
|
|
||||||
|
Decman can install AUR packages as well as user defined packages. Foreign packages are AUR and user packages combined.
|
||||||
|
|
||||||
|
Here is an example of a user package. Managing user packages is somewhat cumbersome as you have to declare their versions, dependencies and make dependencies manually. However, you probably won't install many user packages anyway.
|
||||||
|
|
||||||
|
```py
|
||||||
|
decman.user_packages.append(
|
||||||
|
decman.UserPackage(
|
||||||
|
pkgname="decman-git",
|
||||||
|
# Note, this example may not be up to date
|
||||||
|
provides=["decman"],
|
||||||
|
version="0.2.1",
|
||||||
|
dependencies=["python", "python-requests", "devtools", "pacman", "systemd", "git"],
|
||||||
|
make_dependencies=[
|
||||||
|
"python-setuptools", "python-build", "python-installer", "python-wheel"
|
||||||
|
],
|
||||||
|
git_url="https://github.com/kiviktnm/decman-pkgbuild.git",
|
||||||
|
))
|
||||||
|
```
|
||||||
|
|
||||||
|
Building of foreign packages happens in a chroot. This creates some overhead, but ensures clean builds. By default the chroot is created to `/tmp/decman/build`. I recommend to use a tempfs for the `/tmp/` directory to speed up builds. Also make sure that the tempfs-partition is large enough. I recommend at least 6 GB.
|
||||||
|
|
||||||
|
Build packages are stored in a cache `/var/cache/decman`. By default decman keeps 3 most recent versions of all packages.
|
||||||
|
|
||||||
|
### Systemd units
|
||||||
|
|
||||||
|
Decman can enable systemd services, system wide or for a specific user. Decman will enable all units defined in the source, and disable them when they are removed from the source. If a unit is not defined in the source, decman will not touch it.
|
||||||
|
|
||||||
|
### Files
|
||||||
|
|
||||||
|
Decman functions as a dotfile manager. It will install the defined files and directories to their destinations. You can set file permissions, owners as well as define variables that will be substituted in the installed files. Decman keeps track of all files it creates and when a file is no longer present in your source, it will be also removed from its destination. This helps with keeping your system clean. However, decman won't ever remove directories as they might contain files that weren't created by decman.
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
Modules have 4 methods: `on_enable`, `on_disable`, `after_update` and `after_version_change`. These will be executed if the module is enabled, the module is disabled, after every update and after the version of the module has changed. You can use the helper functions `prg` and `sh` to run programs. These programs could for example be used to update packages managed by another package manager.
|
||||||
|
|
||||||
|
## Order of operations
|
||||||
|
|
||||||
|
When decman runs, it does the following things in this order.
|
||||||
|
|
||||||
|
1. Disable systemd units that are no longer in the source.
|
||||||
|
1. Create and update files.
|
||||||
|
1. Remove files no longer in the source.
|
||||||
|
1. Remove packages not defined in the source.
|
||||||
|
1. Upgrade packages.
|
||||||
|
- To upgrade foreign devel packages (eg. `*-git`) use the `--upgrade-devel` CLI option.
|
||||||
|
1. Install new packages.
|
||||||
|
1. Enable new systemd units.
|
||||||
|
1. Run commands:
|
||||||
|
1. `on_enable`
|
||||||
|
1. `after_version_change`
|
||||||
|
1. `on_disable`
|
||||||
|
1. `after_update`
|
||||||
|
|
||||||
|
Operations may be skipped with command line options.
|
||||||
|
|
||||||
|
## Decman with other configuration languages
|
||||||
|
|
||||||
|
Since decman uses Python files to declare your system, you can easily parse another configuration language in your Python source instead of declaring things directly in Python.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Here is a basic example using TOML.</summary>
|
||||||
|
|
||||||
|
To use TOML with Python, you need the `toml`-package. To install it in Arch Linux, install the `python-toml`-package.
|
||||||
|
|
||||||
|
This example doesn't allow you to use decman's modules or set decman's settings using TOML. You'll have to set them using Python. With this example you can use both TOML and Python if you want.
|
||||||
|
It would be possible to add support for TOML decman modules, but I don't think it would be worth the effort.
|
||||||
|
|
||||||
|
Write this in your decman source.
|
||||||
|
|
||||||
|
```py
|
||||||
|
import toml
|
||||||
|
import decman
|
||||||
|
|
||||||
|
TOML_CONFIG_FILE="/your/file/here.toml"
|
||||||
|
|
||||||
|
# These functions convert TOML tables to decman Files/Directories/UserPackages.
|
||||||
|
|
||||||
|
def toml_to_decman_file(toml_dict) -> decman.File:
|
||||||
|
return decman.File(content=toml_dict.get("content"),
|
||||||
|
source_file=toml_dict.get("source_file"),
|
||||||
|
bin_file=toml_dict.get("bin_file", False),
|
||||||
|
encoding=toml_dict.get("encoding", "utf-8"),
|
||||||
|
owner=toml_dict.get("owner"),
|
||||||
|
group=toml_dict.get("group"),
|
||||||
|
permissions=toml_dict.get("permissions", 0o644))
|
||||||
|
|
||||||
|
|
||||||
|
def toml_to_decman_directory(toml_dict) -> decman.Directory:
|
||||||
|
return decman.Directory(source_directory=toml_dict["source_directory"],
|
||||||
|
bin_files=toml_dict.get("bin_files", False),
|
||||||
|
encoding=toml_dict.get("encoding", "utf-8"),
|
||||||
|
owner=toml_dict.get("owner"),
|
||||||
|
group=toml_dict.get("group"),
|
||||||
|
permissions=toml_dict.get("permissions", 0o644))
|
||||||
|
|
||||||
|
def toml_to_decman_user_package(toml_dict) -> decman.UserPackage:
|
||||||
|
return decman.UserPackage(pkgname=toml_dict["pkgname"],
|
||||||
|
version=toml_dict["version"],
|
||||||
|
dependencies=toml_dict["dependencies"],
|
||||||
|
git_url=toml_dict["git_url"],
|
||||||
|
pkgbase=toml_dict.get("pkgbase"),
|
||||||
|
provides=toml_dict.get("provides"),
|
||||||
|
make_dependencies=toml_dict.get("make_dependencies"),
|
||||||
|
check_dependencies=toml_dict.get("check_dependencies"))
|
||||||
|
|
||||||
|
|
||||||
|
# Parse TOML into a Python dictionary
|
||||||
|
toml_source = toml.load(TOML_CONFIG_FILE)
|
||||||
|
|
||||||
|
# Set decman variables using the parsed dictionary.
|
||||||
|
|
||||||
|
decman.packages = toml_source.get("packages", [])
|
||||||
|
decman.aur_packages = toml_source.get("aur_packages", [])
|
||||||
|
decman.ignored_packages = toml_source.get("ignored_packages", [])
|
||||||
|
decman.enabled_systemd_units = toml_source.get("enabled_systemd_units", [])
|
||||||
|
decman.enabled_systemd_user_units = toml_source.get("enabled_systemd_user_units", {})
|
||||||
|
|
||||||
|
for filename, toml_file_dec in toml_source.get("files", {}).items():
|
||||||
|
decman.files[filename] = toml_to_decman_file(toml_file_dec)
|
||||||
|
|
||||||
|
for dirname, toml_dir_dec in toml_source.get("directories", {}).items():
|
||||||
|
decman.directories[dirname] = toml_to_decman_directory(toml_dir_dec)
|
||||||
|
|
||||||
|
for toml_user_package_dec in toml_source.get("user_packages", []):
|
||||||
|
decman.user_packages.append(toml_to_decman_user_package(toml_user_package_dec))
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you can use TOML configuration like this:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
packages = ["python", "git", "networkmanager", "ufw", "neovim", "python-toml"]
|
||||||
|
aur_packages = ["protonvpn"]
|
||||||
|
enabled_systemd_units = ["NetworkManager.service"]
|
||||||
|
ignored_packages = ["yay"]
|
||||||
|
user_packages = [{
|
||||||
|
pkgname="decman-git",
|
||||||
|
# Note, this example may not be up to date
|
||||||
|
provides=["decman"],
|
||||||
|
version="0.2.1",
|
||||||
|
dependencies=["python", "python-requests", "devtools", "pacman", "systemd", "git"],
|
||||||
|
make_dependencies=[
|
||||||
|
"python-setuptools", "python-build", "python-installer", "python-wheel"
|
||||||
|
],
|
||||||
|
git_url="https://github.com/kiviktnm/decman-pkgbuild.git"
|
||||||
|
}]
|
||||||
|
|
||||||
|
[files]
|
||||||
|
'/etc/vconsole.conf' = { content="KEYMAP=us" }
|
||||||
|
'/etc/pacman.conf' = { source_file="./dotfiles/pacman.conf" }
|
||||||
|
|
||||||
|
[directories]
|
||||||
|
'/home/user/.config/nvim' = { source_directory="./dotfiles/nvim", owner="user" }
|
||||||
|
|
||||||
|
# To set other file/directory attributes, just add them like this. Note that here I am not using octal notation for permissions.
|
||||||
|
'/home/user/.config/example' = { source_directory="./dotfiles/example", owner="user", group="user", bin_files=true, encoding="utf-8", permissions=448 }
|
||||||
|
|
||||||
|
[enabled_systemd_user_units]
|
||||||
|
user = ["syncthing.service"]
|
||||||
|
user2 = ["example.service", "another.service"]
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Why use decman?
|
## Why use decman?
|
||||||
|
|
||||||
Here are some reasons why I created decman for myself.
|
Here are some reasons why I created decman for myself.
|
||||||
@@ -183,93 +382,6 @@ I tried NixOS in the past, but it had some issues that caused me to create decma
|
|||||||
- NixOS is hard, and the documentation (when I last tried it) wasn't that good. Doing more complex stuff was sometimes just very annoying.
|
- NixOS is hard, and the documentation (when I last tried it) wasn't that good. Doing more complex stuff was sometimes just very annoying.
|
||||||
- NixOS has unnecessary abstraction with NixOS options. They are great until you have to configure something specific and there is not an option for it. Then you'll have to inline other configuration language within your Nix config. And if some software doesn't have any premade options you'll have to do write the config manually. Then you'll have some software managed with just options and others with normal config files. I prefer to keep everything consistent.
|
- NixOS has unnecessary abstraction with NixOS options. They are great until you have to configure something specific and there is not an option for it. Then you'll have to inline other configuration language within your Nix config. And if some software doesn't have any premade options you'll have to do write the config manually. Then you'll have some software managed with just options and others with normal config files. I prefer to keep everything consistent.
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Clone the decman PKGBUILD:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/kiviktnm/decman-pkgbuild.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Review the PKGBUILD and install it.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd decman-pkgbuild
|
|
||||||
makepkg -si
|
|
||||||
```
|
|
||||||
|
|
||||||
So far I have not created an AUR package for decman, because I'm not sure if other people would find decman useful.
|
|
||||||
|
|
||||||
## What decman manages?
|
|
||||||
|
|
||||||
### Packages
|
|
||||||
|
|
||||||
Decman can be used to install pacman packages. Decman will install all packages defined in the source and **remove** all packages not defined in the source. You can set packages to be ignored by decman, so that it won't install them nor remove them.
|
|
||||||
|
|
||||||
```py
|
|
||||||
# Include both foreign and pacman packages here.
|
|
||||||
decman.ignored_packages += ["yay", "opendoas"]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Foreign packages
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Building of foreign packages is not the primary function of decman. There are some issues that I may or may not fix.
|
|
||||||
> If you can't build a package using decman, consider adding it to `ignored_packages` and building it yourself.
|
|
||||||
|
|
||||||
Decman can install AUR packages as well as user defined packages. Foreign packages are AUR and user packages combined.
|
|
||||||
|
|
||||||
Here is an example of a user package. Managing user packages is somewhat cumbersome as you have to declare their versions, dependencies and make dependencies manually. However, you probably won't install many user packages anyway.
|
|
||||||
|
|
||||||
```py
|
|
||||||
decman.user_packages.append(
|
|
||||||
decman.UserPackage(
|
|
||||||
pkgname="decman-git",
|
|
||||||
# Note, this example may not be up to date
|
|
||||||
provides=["decman"],
|
|
||||||
version="0.2.0",
|
|
||||||
dependencies=["python", "python-requests", "devtools", "pacman", "systemd", "git"],
|
|
||||||
make_dependencies=[
|
|
||||||
"python-setuptools", "python-build", "python-installer", "python-wheel"
|
|
||||||
],
|
|
||||||
git_url="https://github.com/kiviktnm/decman-pkgbuild.git",
|
|
||||||
))
|
|
||||||
```
|
|
||||||
|
|
||||||
Building of foreign packages happens in a chroot. This creates some overhead, but ensures clean builds. Build packages are stored in a cache `/var/cache/decman`. By default decman keeps 3 most recent versions of all packages.
|
|
||||||
|
|
||||||
### Systemd units
|
|
||||||
|
|
||||||
Decman can enable systemd services, system wide or for a specific user. Decman will enable all units defined in the source, and disable them when they are removed from the source. If a unit is not defined in the source, decman will not touch it.
|
|
||||||
|
|
||||||
### Files
|
|
||||||
|
|
||||||
Decman functions as a dotfile manager. It will install the defined files and directories to their destinations. You can set file permissions, owners as well as define variables that will be substituted in the installed files. Decman keeps track of all files it creates and when a file is no longer present in your source, it will be also removed from its destination. This helps with keeping your system clean. However, decman won't ever remove directories as they might contain files that weren't created by decman.
|
|
||||||
|
|
||||||
### Commands
|
|
||||||
|
|
||||||
Modules have 4 methods: `on_enable`, `on_disable`, `after_update` and `after_version_change`. These will be executed if the module is enabled, the module is disabled, after every update and after the version of the module has changed. You can use the helper functions `prg` and `sh` to run programs. These programs could for example be used to update packages managed by another package manager.
|
|
||||||
|
|
||||||
## Order of operations
|
|
||||||
|
|
||||||
When decman runs, it does the following things in this order.
|
|
||||||
|
|
||||||
1. Disable systemd units that are no longer in the source.
|
|
||||||
1. Create and update files.
|
|
||||||
1. Remove files no longer in the source.
|
|
||||||
1. Remove packages not defined in the source.
|
|
||||||
1. Upgrade packages.
|
|
||||||
- To upgrade foreign devel packages (eg. `*-git`) use the `--upgrade-devel` CLI option.
|
|
||||||
1. Install new packages.
|
|
||||||
1. Enable new systemd units.
|
|
||||||
1. Run commands:
|
|
||||||
1. `on_enable`
|
|
||||||
1. `after_version_change`
|
|
||||||
1. `on_disable`
|
|
||||||
1. `after_update`
|
|
||||||
|
|
||||||
Operations may be skipped with command line options.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright (C) 2024 Kivi Kaitaniemi
|
Copyright (C) 2024 Kivi Kaitaniemi
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class MyModule(Module):
|
|||||||
return [
|
return [
|
||||||
UserPackage(
|
UserPackage(
|
||||||
pkgname="decman-git",
|
pkgname="decman-git",
|
||||||
version="0.2.0",
|
version="0.2.1",
|
||||||
provides=["decman"],
|
provides=["decman"],
|
||||||
dependencies=[
|
dependencies=[
|
||||||
"python",
|
"python",
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ decman.config.makepkg_user = "kk"
|
|||||||
decman.user_packages.append(
|
decman.user_packages.append(
|
||||||
UserPackage(
|
UserPackage(
|
||||||
pkgname="decman-git",
|
pkgname="decman-git",
|
||||||
version="0.2.0",
|
version="0.2.1",
|
||||||
provides=["decman"],
|
provides=["decman"],
|
||||||
dependencies=[
|
dependencies=[
|
||||||
"python",
|
"python",
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "decman"
|
name = "decman"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
description = "Declarative package & configuration manager for Arch Linux."
|
description = "Declarative package & configuration manager for Arch Linux."
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@@ -217,10 +217,10 @@ class Directory:
|
|||||||
if group is not None:
|
if group is not None:
|
||||||
self.gid = grp.getgrnam(group).gr_gid
|
self.gid = grp.getgrnam(group).gr_gid
|
||||||
|
|
||||||
def copy_to(
|
def copy_to(self,
|
||||||
self,
|
target_directory: str,
|
||||||
target_directory: str,
|
variables: typing.Optional[dict[str, str]] = None,
|
||||||
variables: typing.Optional[dict[str, str]] = None) -> list[str]:
|
only_print: bool = False) -> list[str]:
|
||||||
"""
|
"""
|
||||||
Copies the files in this directory to the target directory.
|
Copies the files in this directory to the target directory.
|
||||||
|
|
||||||
@@ -242,7 +242,9 @@ class Directory:
|
|||||||
target = os.path.normpath(
|
target = os.path.normpath(
|
||||||
os.path.join(target_directory, src_path))
|
os.path.join(target_directory, src_path))
|
||||||
created.append(target)
|
created.append(target)
|
||||||
file.copy_to(target, variables)
|
|
||||||
|
if not only_print:
|
||||||
|
file.copy_to(target, variables)
|
||||||
finally:
|
finally:
|
||||||
os.chdir(original_wd)
|
os.chdir(original_wd)
|
||||||
return created
|
return created
|
||||||
|
|||||||
+10
-16
@@ -32,11 +32,10 @@ def main():
|
|||||||
help="python file containing configuration")
|
help="python file containing configuration")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--print",
|
"--print",
|
||||||
|
"--dry-run",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
default=False,
|
default=False,
|
||||||
help=
|
help="print what would happen as a result of running decman")
|
||||||
"print what would happen as a result of running decman (doesn't print removed files)"
|
|
||||||
)
|
|
||||||
parser.add_argument("--debug",
|
parser.add_argument("--debug",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
default=False,
|
default=False,
|
||||||
@@ -263,23 +262,18 @@ class Core:
|
|||||||
|
|
||||||
def _create_and_remove_files(self):
|
def _create_and_remove_files(self):
|
||||||
l.print_summary("Installing files.")
|
l.print_summary("Installing files.")
|
||||||
l.print_list("Files to install:",
|
|
||||||
self.source.all_file_targets(),
|
all_created = self.source.create_all_files(self.only_print)
|
||||||
elements_per_line=1,
|
to_remove = self.source.files_to_remove(self.store, all_created)
|
||||||
level=l.INFO)
|
|
||||||
l.print_list("Directories to install:",
|
l.print_list("Ensured files are up to date:",
|
||||||
self.source.all_directory_targets(),
|
all_created,
|
||||||
elements_per_line=1,
|
elements_per_line=1)
|
||||||
level=l.INFO)
|
l.print_list("Removing files:", to_remove, elements_per_line=1)
|
||||||
|
|
||||||
if self.only_print:
|
if self.only_print:
|
||||||
return
|
return
|
||||||
|
|
||||||
all_created = self.source.create_all_files()
|
|
||||||
to_remove = self.source.files_to_remove(self.store, all_created)
|
|
||||||
|
|
||||||
l.print_list("Removing files:", to_remove, elements_per_line=1)
|
|
||||||
|
|
||||||
for file in to_remove:
|
for file in to_remove:
|
||||||
try:
|
try:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ class Source:
|
|||||||
elif module.enabled and module.name not in store.enabled_modules:
|
elif module.enabled and module.name not in store.enabled_modules:
|
||||||
module.after_version_change()
|
module.after_version_change()
|
||||||
|
|
||||||
def create_all_files(self) -> list[str]:
|
def create_all_files(self, only_print: bool) -> list[str]:
|
||||||
"""
|
"""
|
||||||
Creates all files and returns them. The files created are based on the specified files,
|
Creates all files and returns them. The files created are based on the specified files,
|
||||||
directories and modules.
|
directories and modules.
|
||||||
@@ -470,9 +470,13 @@ class Source:
|
|||||||
variables: typing.Optional[dict[str, str]] = None):
|
variables: typing.Optional[dict[str, str]] = None):
|
||||||
for target, file in files.items():
|
for target, file in files.items():
|
||||||
created_files.append(target)
|
created_files.append(target)
|
||||||
|
|
||||||
|
if only_print:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
file.copy_to(target, variables)
|
|
||||||
print_debug(f"Installing file to {target}.")
|
print_debug(f"Installing file to {target}.")
|
||||||
|
file.copy_to(target, variables)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print_error(f"{e}")
|
print_error(f"{e}")
|
||||||
raise err.UserFacingError(
|
raise err.UserFacingError(
|
||||||
@@ -483,7 +487,8 @@ class Source:
|
|||||||
for target, directory in dirs.items():
|
for target, directory in dirs.items():
|
||||||
try:
|
try:
|
||||||
print_debug(f"Installing directory to {target}.")
|
print_debug(f"Installing directory to {target}.")
|
||||||
created_files.extend(directory.copy_to(target, variables))
|
created_files.extend(
|
||||||
|
directory.copy_to(target, variables, only_print))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print_error(f"{e}")
|
print_error(f"{e}")
|
||||||
raise err.UserFacingError(
|
raise err.UserFacingError(
|
||||||
|
|||||||
Reference in New Issue
Block a user