Skip to content

Commit

Permalink
Improve possible to run Pieman from any directory
Browse files Browse the repository at this point in the history
  • Loading branch information
karpa4o4 committed Jul 24, 2020
1 parent 14b9ae5 commit 5f74434
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bootstrap/50-firstboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if is_alpine; then
echo "rm -f /etc/local.d/90-firstboot.start" >> "${ETC}"/local.d/90-firstboot.start
elif is_debian_based; then
install_exec "${FIRSTBOOT}" "${ETC}"/rc.firstboot
install_exec files/etc/rc.local "${ETC}"/rc.local
install_exec "${PIEMAN_DIR}"/files/etc/rc.local "${ETC}"/rc.local

# /etc/rc.firstboot has to destroy itself and its traces after first run.
cat <<EOT >> "${ETC}"/rc.firstboot
Expand Down
4 changes: 2 additions & 2 deletions essentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ IMAGE_MENDER_ARTIFACT=3
# Returns:
# None
activate_venv_if_exists() {
if [[ -d venv ]] && [[ -f venv/bin/python ]]; then
if [[ -d "${PIEMAN_DIR}"/venv ]] && [[ -f "${PIEMAN_DIR}"/venv/bin/python ]]; then
info "activating the venv virtual environment"
# shellcheck disable=SC1091
source ./venv/bin/activate
source "${PIEMAN_DIR}"/venv/bin/activate
fi
}

Expand Down
4 changes: 2 additions & 2 deletions helpers/others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ add_option_to_pm_options() {
# Returns:
# None
create_keyring() {
for key in keys/"${PIECES[0]}"/*; do
for key in "${PIEMAN_DIR}"/keys/"${PIECES[0]}"/*; do
gpg --no-default-keyring --keyring="${KEYRING}" --import "${key}"
done
}
Expand All @@ -96,7 +96,7 @@ create_keyring() {
# Returns:
# None
mark_keys_as_trusted() {
for key in keys/"${PIECES[0]}"/*; do
for key in "${PIEMAN_DIR}"/keys/"${PIECES[0]}"/*; do
local key_name=""

key_name=$(basename "${key}")
Expand Down

0 comments on commit 5f74434

Please sign in to comment.