Use $XDG_CONFIG_HOME instead of hardcoded path (MR 1969)
This commit is contained in:
parent
86d61b8012
commit
72e24f7f96
|
@ -68,7 +68,7 @@ set_alias_pmbootstrap() {
|
||||||
pmbootstrap="$pmbootstrap_dir"/pmbootstrap.py
|
pmbootstrap="$pmbootstrap_dir"/pmbootstrap.py
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139
|
||||||
alias pmbootstrap="\"$pmbootstrap\""
|
alias pmbootstrap="\"$pmbootstrap\""
|
||||||
if [ -e ~/.config/pmbootstrap.cfg ]; then
|
if [ -e "${XDG_CONFIG_HOME:-$HOME/.config}"/pmbootstrap.cfg ]; then
|
||||||
"$pmbootstrap" work_migrate
|
"$pmbootstrap" work_migrate
|
||||||
else
|
else
|
||||||
echo "NOTE: First run of pmbootstrap, running 'pmbootstrap init'"
|
echo "NOTE: First run of pmbootstrap, running 'pmbootstrap init'"
|
||||||
|
|
|
@ -68,7 +68,7 @@ defaults = {
|
||||||
"ccache_size": "5G",
|
"ccache_size": "5G",
|
||||||
"is_default_channel": True,
|
"is_default_channel": True,
|
||||||
"cipher": "aes-xts-plain64",
|
"cipher": "aes-xts-plain64",
|
||||||
"config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg",
|
"config": (os.environ.get('XDG_CONFIG_HOME') or os.path.expanduser("~/.config")) + "/pmbootstrap.cfg",
|
||||||
"device": "qemu-amd64",
|
"device": "qemu-amd64",
|
||||||
"extra_packages": "none",
|
"extra_packages": "none",
|
||||||
"fork_alpine": False,
|
"fork_alpine": False,
|
||||||
|
|
|
@ -7,7 +7,6 @@ via SSH if expected processes are running.
|
||||||
We use an extra config file (based on ~/.config/pmbootstrap.cfg), because we
|
We use an extra config file (based on ~/.config/pmbootstrap.cfg), because we
|
||||||
need to change it a lot (e.g. UI, username, ...).
|
need to change it a lot (e.g. UI, username, ...).
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -78,8 +77,7 @@ class QEMU(object):
|
||||||
def run(self, args, tmpdir, ui="none"):
|
def run(self, args, tmpdir, ui="none"):
|
||||||
# Copy and adjust user's pmbootstrap.cfg
|
# Copy and adjust user's pmbootstrap.cfg
|
||||||
config = str(tmpdir) + "/pmbootstrap.cfg"
|
config = str(tmpdir) + "/pmbootstrap.cfg"
|
||||||
shutil.copyfile(os.path.expanduser("~") + "/.config/pmbootstrap.cfg",
|
shutil.copyfile(args.config, config)
|
||||||
config)
|
|
||||||
pmbootstrap_run(args, config, ["config", "device", "qemu-amd64"])
|
pmbootstrap_run(args, config, ["config", "device", "qemu-amd64"])
|
||||||
pmbootstrap_run(args, config, ["config", "kernel", "virt"])
|
pmbootstrap_run(args, config, ["config", "kernel", "virt"])
|
||||||
pmbootstrap_run(args, config, ["config", "extra_packages", "none"])
|
pmbootstrap_run(args, config, ["config", "extra_packages", "none"])
|
||||||
|
|
Loading…
Reference in New Issue