Revert "Fixed menuconfig with new async runner"
I did not test this well enough, sorry! This introduced problems
such as interactive shell not working anymore (#40), cryptsetup partion
creating not working anymore etc.
This reverts commit f39c1dae69
.
This commit is contained in:
parent
06a5c653fe
commit
7d6365b473
|
@ -55,7 +55,7 @@ def menuconfig(args, pkgname, arch):
|
||||||
cmd += [key + "=" + value]
|
cmd += [key + "=" + value]
|
||||||
cmd += ["abuild", "-d", "menuconfig"]
|
cmd += ["abuild", "-d", "menuconfig"]
|
||||||
logging.info("(native) run menuconfig")
|
logging.info("(native) run menuconfig")
|
||||||
pmb.chroot.user(args, cmd, "native", "/home/user/build", log=False, passthrough=True)
|
pmb.chroot.user(args, cmd, "native", "/home/user/build", log=False)
|
||||||
|
|
||||||
# Update config + checksums
|
# Update config + checksums
|
||||||
logging.info("copy kernel config back to aport-folder")
|
logging.info("copy kernel config back to aport-folder")
|
||||||
|
|
|
@ -41,7 +41,7 @@ def executables_absolute_path():
|
||||||
|
|
||||||
|
|
||||||
def root(args, cmd, suffix="native", working_dir="/", log=True,
|
def root(args, cmd, suffix="native", working_dir="/", log=True,
|
||||||
auto_init=True, return_stdout=False, check=True, passthrough=False):
|
auto_init=True, return_stdout=False, check=True):
|
||||||
"""
|
"""
|
||||||
Run a command inside a chroot as root.
|
Run a command inside a chroot as root.
|
||||||
|
|
||||||
|
@ -82,4 +82,4 @@ def root(args, cmd, suffix="native", working_dir="/", log=True,
|
||||||
|
|
||||||
# Run the command
|
# Run the command
|
||||||
return pmb.helpers.run.core(args, cmd_full, log_message, log,
|
return pmb.helpers.run.core(args, cmd_full, log_message, log,
|
||||||
return_stdout, check, passthrough)
|
return_stdout, check)
|
||||||
|
|
|
@ -20,7 +20,7 @@ import pmb.chroot.root
|
||||||
|
|
||||||
|
|
||||||
def user(args, cmd, suffix="native", working_dir="/", log=True,
|
def user(args, cmd, suffix="native", working_dir="/", log=True,
|
||||||
auto_init=True, return_stdout=False, check=True, passthrough=False):
|
auto_init=True, return_stdout=False, check=True):
|
||||||
"""
|
"""
|
||||||
Run a command inside a chroot as "user"
|
Run a command inside a chroot as "user"
|
||||||
|
|
||||||
|
@ -29,4 +29,4 @@ def user(args, cmd, suffix="native", working_dir="/", log=True,
|
||||||
"""
|
"""
|
||||||
cmd = ["su", "user", "-c", " ".join(cmd)]
|
cmd = ["su", "user", "-c", " ".join(cmd)]
|
||||||
return pmb.chroot.root(args, cmd, suffix, working_dir, log,
|
return pmb.chroot.root(args, cmd, suffix, working_dir, log,
|
||||||
auto_init, return_stdout, check, passthrough)
|
auto_init, return_stdout, check)
|
||||||
|
|
|
@ -19,7 +19,6 @@ along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
import locale
|
import locale
|
||||||
import subprocess
|
|
||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -78,7 +77,7 @@ def _execute(loop, args, cmd, log_message, log, return_stdout, check=True):
|
||||||
return return_code
|
return return_code
|
||||||
|
|
||||||
|
|
||||||
def core(args, cmd, log_message, log, return_stdout, check=True, passthrough=False):
|
def core(args, cmd, log_message, log, return_stdout, check=True):
|
||||||
logging.debug(log_message)
|
logging.debug(log_message)
|
||||||
"""
|
"""
|
||||||
Run the command and write the output to the log.
|
Run the command and write the output to the log.
|
||||||
|
@ -87,9 +86,6 @@ def core(args, cmd, log_message, log, return_stdout, check=True, passthrough=Fal
|
||||||
:param log: send output to log instead of stdout
|
:param log: send output to log instead of stdout
|
||||||
:param return_stdout: return the stdout from the called process
|
:param return_stdout: return the stdout from the called process
|
||||||
"""
|
"""
|
||||||
if passthrough:
|
|
||||||
result = subprocess.check_call(cmd)
|
|
||||||
else:
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.set_debug(False)
|
loop.set_debug(False)
|
||||||
task = _execute(loop, args, cmd, log_message, log, return_stdout, check)
|
task = _execute(loop, args, cmd, log_message, log, return_stdout, check)
|
||||||
|
@ -98,7 +94,7 @@ def core(args, cmd, log_message, log, return_stdout, check=True, passthrough=Fal
|
||||||
|
|
||||||
|
|
||||||
def user(args, cmd, log=True, working_dir=None, return_stdout=False,
|
def user(args, cmd, log=True, working_dir=None, return_stdout=False,
|
||||||
check=True, passthrough=False):
|
check=True):
|
||||||
"""
|
"""
|
||||||
:param working_dir: defaults to args.work
|
:param working_dir: defaults to args.work
|
||||||
"""
|
"""
|
||||||
|
@ -106,13 +102,13 @@ def user(args, cmd, log=True, working_dir=None, return_stdout=False,
|
||||||
working_dir = args.work
|
working_dir = args.work
|
||||||
|
|
||||||
# TODO: maintain and check against a whitelist
|
# TODO: maintain and check against a whitelist
|
||||||
return core(args, cmd, "% " + " ".join(cmd), log, return_stdout, check, passthrough)
|
return core(args, cmd, "% " + " ".join(cmd), log, return_stdout, check)
|
||||||
|
|
||||||
|
|
||||||
def root(args, cmd, log=True, working_dir=None, return_stdout=False,
|
def root(args, cmd, log=True, working_dir=None, return_stdout=False,
|
||||||
check=True, passthrough=False):
|
check=True):
|
||||||
"""
|
"""
|
||||||
:param working_dir: defaults to args.work
|
:param working_dir: defaults to args.work
|
||||||
"""
|
"""
|
||||||
cmd = ["sudo"] + cmd
|
cmd = ["sudo"] + cmd
|
||||||
return user(args, cmd, log, working_dir, return_stdout, check, passthrough)
|
return user(args, cmd, log, working_dir, return_stdout, check)
|
||||||
|
|
Loading…
Reference in New Issue