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).

This commit is contained in:
Anton Hvornum 2020-11-08 23:22:26 +00:00
parent 18c811ac96
commit decf9119f2
7 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# Maintainer: Anton Hvornum anton@hvornum.se # Maintainer: Anton Hvornum anton@hvornum.se
# Contributor: Anton Hvornum anton@hvornum.se # Contributor: Anton Hvornum anton@hvornum.se
pkgname="archinstall-bin" pkgname="archinstall-bin"
pkgver="2.0.6rc11" pkgver="2.0.6rc15"
pkgdesc="Installs a pre-built binary of ${pkgname}" pkgdesc="Installs a pre-built binary of ${pkgname}"
pkgrel=1 pkgrel=1
url="https://github.com/Torxed/archinstall" url="https://github.com/Torxed/archinstall"

View File

@ -1,7 +1,7 @@
# Maintainer: Anton Hvornum <anton@hvornum.se> # Maintainer: Anton Hvornum <anton@hvornum.se>
# Contributor: demostanis worlds <demostanis@protonmail.com> # Contributor: demostanis worlds <demostanis@protonmail.com>
pkgname="archinstall" pkgname="archinstall"
pkgver="2.0.6rc11" pkgver="2.0.6rc15"
pkgdesc="Installs launcher scripts for archinstall" pkgdesc="Installs launcher scripts for archinstall"
pkgrel=1 pkgrel=1
url="https://github.com/Torxed/archinstall" url="https://github.com/Torxed/archinstall"

View File

@ -2,7 +2,7 @@
# Contributor: demostanis worlds <demostanis@protonmail.com> # Contributor: demostanis worlds <demostanis@protonmail.com>
pkgname="python-archinstall" pkgname="python-archinstall"
pkgver="2.0.6rc11" pkgver="2.0.6rc15"
pkgdesc="Installs ${pkgname} as a python library." pkgdesc="Installs ${pkgname} as a python library."
pkgrel=1 pkgrel=1
url="https://github.com/Torxed/archinstall" url="https://github.com/Torxed/archinstall"

View File

@ -1 +1 @@
2.0.6rc13 2.0.6rc15

View File

@ -49,7 +49,10 @@ def find_examples():
:return: {'guided.py' : './examples/guided.py', '<profile #2>' : '<path #2>'} :return: {'guided.py' : './examples/guided.py', '<profile #2>' : '<path #2>'}
:rtype: dict :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" examples = f"{cwd}/examples"
return {os.path.basename(path): path for path in glob.glob(f'{examples}/*.py')} 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: with open(profile, 'r') as file:
return Script(file.read(), filename=os.path.basename(profile)) return Script(file.read(), filename=os.path.basename(profile))
except FileNotFoundError: 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" examples = f"{cwd}/examples"
raise ProfileNotFound(f"File {profile} does not exist in {examples}") raise ProfileNotFound(f"File {profile} does not exist in {examples}")
elif parsed_url.scheme in ('https', 'http'): elif parsed_url.scheme in ('https', 'http'):

View File

@ -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()): if 'profile' in archinstall.storage['_guided'] and len(profile := archinstall.storage['_guided']['profile']['path'].strip()):
installation.install_profile(profile) 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 sudo = False
if len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0: if len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0:
sudo = True sudo = True

View File

@ -13,5 +13,6 @@ rm -rf archinstall.egg-info/ build/ src/ pkg/ dist/ archinstall.build/ "archinst
# makepkg -f # makepkg -f
python3 setup.py sdist bdist_wheel python3 setup.py sdist bdist_wheel
echo 'python3 -m twine upload dist/* && rm -rf dist/' 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/" rm -rf archinstall.egg-info/ build/ src/ pkg/ archinstall.build/ "archinstall-v${VERSION}-x86_64/"