summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2017-11-15 01:03:03 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2017-12-01 21:55:38 -0500
commit57c6ed3adf791643b347a261093f69678e91c39c (patch)
tree4c6387703dabc14a5b216a2dc672009507001617
parent1423a63ef96d0b185e058d736cfa6c867f331943 (diff)
stash
-rw-r--r--data/skel/mate/.bashrc2
-rw-r--r--src/libcalamares/PacstrapCppJob.cpp45
-rw-r--r--src/libcalamares/PacstrapCppJob.h5
-rw-r--r--src/modules/pacstrap-base/pacstrap-base.cpp3
-rw-r--r--src/modules/pacstrap-gui/pacstrap-gui.cpp10
5 files changed, 43 insertions, 22 deletions
diff --git a/data/skel/mate/.bashrc b/data/skel/mate/.bashrc
index cf741d7a8..89392d75b 100644
--- a/data/skel/mate/.bashrc
+++ b/data/skel/mate/.bashrc
@@ -5,6 +5,8 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
+setxkbmap us
+
alias ls='ls --color=auto'
if [[ "$XDG_VTNR" == "7" ]]
diff --git a/src/libcalamares/PacstrapCppJob.cpp b/src/libcalamares/PacstrapCppJob.cpp
index 6d500e3e1..268baf2da 100644
--- a/src/libcalamares/PacstrapCppJob.cpp
+++ b/src/libcalamares/PacstrapCppJob.cpp
@@ -83,6 +83,9 @@ const QString PacstrapCppJob::MOUNT_ERROR_MSG = "Failed to mount the pacst
const QString PacstrapCppJob::CHROOT_PREP_ERROR_MSG = "Failed to prepare the pacstrap chroot." ;
const QString PacstrapCppJob::PACMAN_SYNC_ERROR_MSG = "Failed to syncronize packages in the pacstrap chroot." ;
const QString PacstrapCppJob::UMOUNT_ERROR_MSG = "Failed to unmount the pacstrap chroot." ;
+const QString PacstrapCppJob::STATUS_KEY = QString("status") ;
+const QString PacstrapCppJob::STDOUT_KEY = QString("stdout") ;
+const QString PacstrapCppJob::STDERR_KEY = QString("stderr") ;
/* PacstrapCppJob public constructors/destructors */
@@ -174,15 +177,16 @@ DEBUG_TRACE_EXEC
/* PacstrapCppJob protected instance methods */
-QStringList PacstrapCppJob::execWithProgress(QString command_line , qreal task_proportion)
+QVariantMap PacstrapCppJob::execWithProgress(QString command_line , qreal task_proportion)
{
- QProcess proc ;
- int status ;
- QString stdout = QString("") ;
- QString stderr = QString("") ;
-
- cDebug() << "[PACSTRAP]: executing shell command: " << command_line ;
- cDebug() << "=================== [SHELL OUTPUT BEGIN] ===================" ;
+ QProcess proc ;
+ int status ;
+ QString stdout = QString("") ;
+ QString stderr = QString("") ;
+ QVariantMap retval ;
+
+ cLog() << "[PACSTRAP]: executing shell command: " << command_line ;
+ cLog() << "=================== [SHELL OUTPUT BEGIN] ===================" ;
proc.start(QString(SYSTEM_EXEC_FMT).arg(command_line)) ; proc.waitForStarted(-1) ;
while (proc.waitForFinished(250) || proc.state() != QProcess::NotRunning)
{
@@ -196,28 +200,41 @@ QStringList PacstrapCppJob::execWithProgress(QString command_line , qreal task_p
}
this->progressPercent = emitProgress(task_proportion) ;
- cDebug() << "==================== [SHELL OUTPUT END] ====================" ;
+ cLog() << "==================== [SHELL OUTPUT END] ====================" ;
status = (proc.exitStatus() == QProcess::NormalExit) ? proc.exitCode() : 255 ;
DEBUG_TRACE_EXECWITHPROGRESS
- return (QStringList() << QString(status) << stdout << stderr) ;
-}
+ retval.insert(STATUS_KEY , QVariant(status)) ;
+ retval.insert(STDOUT_KEY , QVariant(stdout)) ;
+ retval.insert(STDERR_KEY , QVariant(stderr)) ;
+
+ return retval ;
+} ;
int PacstrapCppJob::execStatus(QString command_line , qreal task_proportion)
{
- return execWithProgress(command_line , task_proportion).at(0).toInt() ;
+ QVariantMap result = execWithProgress(command_line , task_proportion) ;
+ int status = result.value(STATUS_KEY).toInt() ;
+
+ return status ;
}
QString PacstrapCppJob::execOutput(QString command_line , qreal task_proportion)
{
- return execWithProgress(command_line , task_proportion).at(1) ;
+ QVariantMap result = execWithProgress(command_line , task_proportion) ;
+ QString stdout = result.value(STDOUT_KEY).toString() ;
+
+ return stdout ;
}
QString PacstrapCppJob::execError(QString command_line , qreal task_proportion)
{
- return execWithProgress(command_line , task_proportion).at(2) ;
+ QVariantMap result = execWithProgress(command_line , task_proportion) ;
+ QString stderr = result.value(STDERR_KEY).toString() ;
+
+ return stderr ;
}
diff --git a/src/libcalamares/PacstrapCppJob.h b/src/libcalamares/PacstrapCppJob.h
index 3b517b6ad..ca0d851ed 100644
--- a/src/libcalamares/PacstrapCppJob.h
+++ b/src/libcalamares/PacstrapCppJob.h
@@ -50,7 +50,7 @@ public:
protected:
- QStringList execWithProgress(QString command_line , qreal task_proportion = 0.0) ;
+ QVariantMap execWithProgress(QString command_line , qreal task_proportion = 0.0) ;
int execStatus (QString command_line , qreal task_proportion = 0.0) ;
QString execOutput (QString command_line , qreal task_proportion = 0.0) ;
QString execError (QString command_line , qreal task_proportion = 0.0) ;
@@ -138,6 +138,9 @@ private:
static const QString CHROOT_PREP_ERROR_MSG ;
static const QString PACMAN_SYNC_ERROR_MSG ;
static const QString UMOUNT_ERROR_MSG ;
+ static const QString STATUS_KEY ;
+ static const QString STDOUT_KEY ;
+ static const QString STDERR_KEY ;
} ;
diff --git a/src/modules/pacstrap-base/pacstrap-base.cpp b/src/modules/pacstrap-base/pacstrap-base.cpp
index 9641a1a08..b998c41f7 100644
--- a/src/modules/pacstrap-base/pacstrap-base.cpp
+++ b/src/modules/pacstrap-base/pacstrap-base.cpp
@@ -49,8 +49,7 @@ QString PacstrapBaseJob::chrootExec()
if (!!execStatus(pacstrap_cmd , CHROOT_TASK_PROPORTION)) return PACSTRAP_ERROR_MSG ;
-QString grub_theme_kludge_cmd = QString("echo GRUB_THEME=/boot/grub/themes/GNUAxiom/theme.txt >> %1/etc/default/grub").
- arg(MOUNTPOINT) ;
+QString grub_theme_kludge_cmd = QString("echo GRUB_THEME=/boot/grub/themes/GNUAxiom/theme.txt >> %1/etc/default/grub").arg(MOUNTPOINT) ;
printf("[PACSTRAP-BASE]: grub_theme_cmd=%s\n" , grub_theme_cmd.toStdString().c_str()) ;
printf("[PACSTRAP-BASE]: grub_theme_cmd IN:\n"); QProcess::execute(QString("/bin/sh -c \"cat %1/etc/default/grub\"").arg(MOUNTPOINT));
diff --git a/src/modules/pacstrap-gui/pacstrap-gui.cpp b/src/modules/pacstrap-gui/pacstrap-gui.cpp
index 233e5896d..a21d3a022 100644
--- a/src/modules/pacstrap-gui/pacstrap-gui.cpp
+++ b/src/modules/pacstrap-gui/pacstrap-gui.cpp
@@ -58,14 +58,14 @@ QString PacstrapGuiJob::chrootExec()
if (!!execStatus(pacstrap_cmd , CHROOT_TASK_PROPORTION)) return PACSTRAP_ERROR_MSG ;
-printf("[PACSTRAP-GUI]: ls /etc/skel") ; QProcess::execute(QString("/bin/sh -c \"ls -al /etc/skel/\"" ) ) ;
-printf("[PACSTRAP-GUI]: ls chroot/etc/skel/") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/skel/\"" ).arg(MOUNTPOINT)) ;
-printf("[PACSTRAP-GUI]: ls chroot/etc/wallpaper.png") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/wallpaper.png\"").arg(MOUNTPOINT)) ;
-printf("[PACSTRAP-GUI]: ls chroot/etc/sudoers*") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/sudoers*\"" ).arg(MOUNTPOINT)) ;
+printf("[PACSTRAP-GUI]: ls /etc/skel\n") ; QProcess::execute(QString("/bin/sh -c \"ls -al /etc/skel/\"" ) ) ;
+printf("[PACSTRAP-GUI]: ls chroot/etc/skel/\n") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/skel/\"" ).arg(MOUNTPOINT)) ;
+printf("[PACSTRAP-GUI]: ls chroot/etc/wallpaper.png\n") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/wallpaper.png\"").arg(MOUNTPOINT)) ;
+printf("[PACSTRAP-GUI]: ls chroot/etc/sudoers*\n") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/sudoers*\"" ).arg(MOUNTPOINT)) ;
if (!!execStatus(wallpaper_cmd)) return WALLPAPER_ERROR_MSG ;
-printf("[PACSTRAP-GUI]: ls chroot/etc/wallpaper.png") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/wallpaper.png\"").arg(MOUNTPOINT)) ;
+printf("[PACSTRAP-GUI]: ls chroot/etc/wallpaper.png\n") ; QProcess::execute(QString("/bin/sh -c \"ls -al %1/etc/wallpaper.png\"").arg(MOUNTPOINT)) ;
return QString("") ;
}