From decf9119f27cba6a5aa3ae33b7c3e73d2f869af9 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 8 Nov 2020 23:22:26 +0000 Subject: Fixing a variable missmatch in #61. The global configuration snapshot (that is used for debug printing) does not contain the password for the new user (for safety reasons). So we can no longer get the password from that snapshot, but instead we have to get it from the global variable users (:dict). --- PKGBUILD/archinstall-bin/PKGBUILD | 2 +- PKGBUILD/archinstall/PKGBUILD | 2 +- PKGBUILD/python-archinstall/PKGBUILD | 2 +- VERSION | 2 +- archinstall/lib/profiles.py | 9 +++++++-- examples/guided.py | 4 +++- make.sh | 1 + 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/PKGBUILD/archinstall-bin/PKGBUILD b/PKGBUILD/archinstall-bin/PKGBUILD index 12c2bd06..9d78deb0 100644 --- a/PKGBUILD/archinstall-bin/PKGBUILD +++ b/PKGBUILD/archinstall-bin/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Anton Hvornum anton@hvornum.se # Contributor: Anton Hvornum anton@hvornum.se pkgname="archinstall-bin" -pkgver="2.0.6rc11" +pkgver="2.0.6rc15" pkgdesc="Installs a pre-built binary of ${pkgname}" pkgrel=1 url="https://github.com/Torxed/archinstall" diff --git a/PKGBUILD/archinstall/PKGBUILD b/PKGBUILD/archinstall/PKGBUILD index 1a273169..94f83172 100644 --- a/PKGBUILD/archinstall/PKGBUILD +++ b/PKGBUILD/archinstall/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Anton Hvornum # Contributor: demostanis worlds pkgname="archinstall" -pkgver="2.0.6rc11" +pkgver="2.0.6rc15" pkgdesc="Installs launcher scripts for archinstall" pkgrel=1 url="https://github.com/Torxed/archinstall" diff --git a/PKGBUILD/python-archinstall/PKGBUILD b/PKGBUILD/python-archinstall/PKGBUILD index ac546930..97c20fd9 100644 --- a/PKGBUILD/python-archinstall/PKGBUILD +++ b/PKGBUILD/python-archinstall/PKGBUILD @@ -2,7 +2,7 @@ # Contributor: demostanis worlds pkgname="python-archinstall" -pkgver="2.0.6rc11" +pkgver="2.0.6rc15" pkgdesc="Installs ${pkgname} as a python library." pkgrel=1 url="https://github.com/Torxed/archinstall" diff --git a/VERSION b/VERSION index e933c631..7e20819a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.6rc13 \ No newline at end of file +2.0.6rc15 \ No newline at end of file diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index f20726d2..e9eb9583 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -49,7 +49,10 @@ def find_examples(): :return: {'guided.py' : './examples/guided.py', '' : ''} :rtype: dict """ - cwd = os.path.abspath(f'{os.path.dirname(__file__)}') + + # We need to traverse backwards one step with /../ because + # We're living in src/lib/ and we're not executing from src/ anymore. + cwd = os.path.abspath(f'{os.path.dirname(__file__)}/../') examples = f"{cwd}/examples" return {os.path.basename(path): path for path in glob.glob(f'{examples}/*.py')} @@ -65,7 +68,9 @@ def find_installation_script(profile): with open(profile, 'r') as file: return Script(file.read(), filename=os.path.basename(profile)) except FileNotFoundError: - cwd = os.path.abspath(f'{os.path.dirname(__file__)}') + # We need to traverse backwards one step with /../ because + # We're living in src/lib/ and we're not executing from src/ anymore. + cwd = os.path.abspath(f'{os.path.dirname(__file__)}/../') examples = f"{cwd}/examples" raise ProfileNotFound(f"File {profile} does not exist in {examples}") elif parsed_url.scheme in ('https', 'http'): diff --git a/examples/guided.py b/examples/guided.py index d9dd0ac6..b57d5e34 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -55,7 +55,9 @@ def perform_installation(device, boot_partition, language, mirrors): if 'profile' in archinstall.storage['_guided'] and len(profile := archinstall.storage['_guided']['profile']['path'].strip()): installation.install_profile(profile) - for user, password in archinstall.storage['_guided']['users'].items(): + for user in archinstall.storage['_guided']['users']: + password = users[user] + sudo = False if len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0: sudo = True diff --git a/make.sh b/make.sh index ec903ffb..f733ce10 100755 --- a/make.sh +++ b/make.sh @@ -13,5 +13,6 @@ rm -rf archinstall.egg-info/ build/ src/ pkg/ dist/ archinstall.build/ "archinst # makepkg -f python3 setup.py sdist bdist_wheel echo 'python3 -m twine upload dist/* && rm -rf dist/' +python3 -m twine upload dist/* && rm -rf dist/ rm -rf archinstall.egg-info/ build/ src/ pkg/ archinstall.build/ "archinstall-v${VERSION}-x86_64/" -- cgit v1.2.3-54-g00ecf