diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2018-05-19 17:42:01 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2018-05-27 06:26:01 -0400 |
commit | 958fc8e3d30079957ce504958e2cdc3262293e8a (patch) | |
tree | 974f2eaeedb60af7ffb915aa65bf8143213a05c3 | |
parent | 7fbd6893b9f1d388aa2369a9f34b9a277018422a (diff) |
squashme - housekeeping
-rw-r--r-- | .gitignore | 3 | ||||
-rwxr-xr-x | mk | 20 | ||||
-rw-r--r-- | src/libcalamares/PacstrapCppJob.cpp | 31 | ||||
-rw-r--r-- | src/libcalamares/PacstrapCppJob.h | 6 | ||||
-rw-r--r-- | src/modules/locale/LocalePage.cpp | 6 | ||||
-rw-r--r-- | src/modules/pacstrap-gui/pacstrap-gui.conf | 1 |
6 files changed, 43 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore index d67fee190..c31479c22 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ CMakeLists.txt.user # Kate *.kate-swp + +# ./mk +LAST_BUILD_HOST @@ -2,7 +2,7 @@ readonly NO_UPGRADE=1 readonly RUN_INSTALLED=1 -# [ "`lsmod | grep squashfs`" ] || sudo modprobe squashfs +readonly THIS_BUILD_HOST==$(grep '^ID=' /etc/os-release | cut -d '=' -f 2) function print() { printf "\033[01;34m%s\033[00m\n" "$(echo -e $*)" ; } @@ -16,17 +16,19 @@ then print "\n--- running pacman ---\n" plasma-framework qt5-tools polkit-qt5 yaml-cpp" # squashfs-tools os-prober # PARABOLA_PKGS="arch-install-scripts" PKGS="$BASE_PKGS $CALAMARES_PKGS $PARABOLA_PKGS" - pacman -Qi calamares > /dev/null 2>&1 && sudo pacman -R calamares - pacman -Qi $PKGS > /dev/null && (($NO_UPGRADE)) || sudo pacman -Sy --needed $PKGS || exit 1 + pacman -Qi calamares > /dev/null 2>&1 && sudo pacman -R calamares + pacman -Qi $PKGS > /dev/null && (($NO_UPGRADE)) || sudo pacman -Sy --needed $PKGS || exit 1 elif which apt-get &> /dev/null then print "\n--- running apt ---\n" - apt-get install extra-cmake-modules libatasmart-dev libboost-python-dev \ - libkf5coreaddons-dev libkf5kio-dev libkf5plasma-dev \ - libkf5service-dev libkpmcore4-dev libparted-dev \ - libpolkit-qt5-1-dev qtdeclarative5-dev || exit 1 + sudo apt-get install -qqq extra-cmake-modules libatasmart-dev libboost-python-dev \ + libkf5coreaddons-dev libkf5kio-dev libkf5plasma-dev \ + libkf5service-dev libkpmcore4-dev libparted-dev \ + libpolkit-qt5-1-dev qtdeclarative5-dev || exit 1 fi +[ "$(cat ./LAST_BUILD_HOST)" == "$THIS_BUILD_HOST" ] || (echo "cleaning build/ dir" ; sudo rm -rf ./build) +echo "$THIS_BUILD_HOST" > ./LAST_BUILD_HOST if [ ! -d ./build ] then print "\n--- preparing build environment ---\n" mkdir ./build @@ -65,9 +67,9 @@ fi if (($RUN_INSTALLED)) then print "\n--- running make install ---\n" - sudo make install + sudo make install || exit 1 else print "\n--- running make ---\n" - make + make || exit 1 fi cd .. diff --git a/src/libcalamares/PacstrapCppJob.cpp b/src/libcalamares/PacstrapCppJob.cpp index 364f4a2a8..4c4b9d998 100644 --- a/src/libcalamares/PacstrapCppJob.cpp +++ b/src/libcalamares/PacstrapCppJob.cpp @@ -78,12 +78,16 @@ const qreal PacstrapCppJob::PACMAN_SYNC_PROPORTION = 0.05 ; // per task prog const qreal PacstrapCppJob::LIST_PACKAGES_PROPORTION = 0.05 ; // per task progress-bar proportion const qreal PacstrapCppJob::CHROOT_TASK_PROPORTION = 0.9 ; // per task progress-bar proportion const QString PacstrapCppJob::SYSTEM_EXEC_FMT = "/bin/sh -c \"%1\"" ; -const QString PacstrapCppJob::PACSTRAP_CLEANUP_CMD = "umount %1/dev/pts %1/dev/shm %1/dev %1/proc %1/run %1/sys %1/tmp %1 2> /dev/null" ; +const QString PacstrapCppJob::PACSTRAP_FILENAME = "/usr/bin/pacstrap-calamares" ; +const QString PacstrapCppJob::PACSTRAP_PREP_CMD = "sed 's|^chroot_setup |#chroot_setup |' /usr/bin/pacstrap > %1 && \ + chmod +x %1" ; +const QString PacstrapCppJob::PACSTRAP_RM_CMD = "rm %1" ; +// const QString PacstrapCppJob::PACSTRAP_CLEANUP_CMD = "umount %1/dev/pts %1/dev/shm %1/dev %1/proc %1/run %1/sys %1/tmp %1 2> /dev/null" ; // const QString PacstrapCppJob::MOUNT_FMT = "mkdir %2 2> /dev/null || true && mount %1 %2" ; const QString PacstrapCppJob::CHROOT_PREP_FMT = "mkdir -m 0755 -p {%1,%2}" ; const QString PacstrapCppJob::DB_REFRESH_FMT = "pacman -S --print --config %1 --root %2 --refresh" ; const QString PacstrapCppJob::LIST_PACKAGES_FMT = "pacman -S --print --config %1 --root %2 %3" ; -const QString PacstrapCppJob::PACSTRAP_FMT = "pacstrap-calamares -M -C %1 %2 %3 --noprogressbar" ; +const QString PacstrapCppJob::PACSTRAP_FMT = "%1 -M -C %2 %3 %4 --noprogressbar" ; // const QString PacstrapCppJob::KEYRING_CMD = "pacman -Sy --noconfirm parabola-keyring" ; const QString PacstrapCppJob::KEYRING_CMD = "pacman -Sy --noconfirm archlinux-keyring \ archlinux32-keyring \ @@ -96,6 +100,7 @@ const QString PacstrapCppJob::KEYRING_CMD = "pacman -Sy --noconfirm parabola && \ pacman-key --refresh-keys " ; // const QString PacstrapCppJob::UMOUNT_FMT = "umount %1" ; +const QString PacstrapCppJob::PACSTRAP_PREP_ERROR_MSG = "Could not create custom 'pacstrap-calamares' script." ; const QString PacstrapCppJob::CONFIG_ERROR_MSG = "Invalid configuration map." ; const QString PacstrapCppJob::TARGET_ERROR_MSG = "Target device for root filesystem is unspecified." ; const QString PacstrapCppJob::CONFFILE_ERROR_MSG = "Pacman configuration not found: '%1'." ; @@ -128,15 +133,9 @@ PacstrapCppJob::PacstrapCppJob(const char* job_name , const char* status_msg , this->nPreviousPackages = 0 ; // deferred to exec() this->nPendingPackages = 0 ; // deferred to exec() this->progressPercent = 0 ; - - execStatus("sed 's|^chroot_setup |#chroot_setup |' /usr/bin/pacstrap > /usr/bin/pacstrap-calamares") ; - execStatus("chmod +x /usr/bin/pacstrap-calamares") ; } -PacstrapCppJob::~PacstrapCppJob() -{ - execStatus("rm /usr/bin/pacstrap-calamares || true") ; -} +PacstrapCppJob::~PacstrapCppJob() {} /* PacstrapCppJob public getters/setters */ @@ -191,8 +190,8 @@ DEBUG_TRACE_EXEC // if (!!execStatus(keyring_cmd )) return JobError(KEYRING_ERROR_MSG) ; // if (!!execStatus(mount_cmd )) return JobError(MOUNT_ERROR_MSG ) ; - if (!!execStatus(chroot_prep_cmd )) return JobError(CHROOT_PREP_ERROR_MSG) ; - if (!!execStatus(pacman_sync_cmd , PACMAN_SYNC_PROPORTION)) return JobError(PACMAN_SYNC_ERROR_MSG) ; + if (!!execStatus(chroot_prep_cmd )) return JobError(CHROOT_PREP_ERROR_MSG ) ; + if (!!execStatus(pacman_sync_cmd , PACMAN_SYNC_PROPORTION)) return JobError(PACMAN_SYNC_ERROR_MSG ) ; if (!this->packages.isEmpty()) { @@ -207,7 +206,13 @@ DEBUG_TRACE_EXEC if (this->nPendingPackages > 0) { - QString pacstrap_cmd = PACSTRAP_FMT.arg(this->confFile , this->mountPoint , this->packages) ; + QString pacstrap_prep_cmd = PACSTRAP_PREP_CMD.arg(PACSTRAP_FILENAME) ; + QString pacstrap_cmd = PACSTRAP_FMT .arg(PACSTRAP_FILENAME , this->confFile , + this->mountPoint , this->packages ) ; + QString pacstrap_rm_cmd = PACSTRAP_RM_CMD .arg(PACSTRAP_FILENAME) ; + + if (!!execStatus(pacstrap_prep_cmd)) return JobError(PACSTRAP_PREP_ERROR_MSG) ; + QVariantMap pacstrap_result = execWithProgress(pacstrap_cmd , CHROOT_TASK_PROPORTION) ; int pacstrap_status = pacstrap_result.value(STATUS_KEY).toInt() ; QString pacstrap_error = pacstrap_result.value(STDERR_KEY).toString().trimmed() ; @@ -223,6 +228,8 @@ DEBUG_TRACE_EXEC pacstrap_status = pacstrap_result.value(STATUS_KEY).toInt() ; pacstrap_error = pacstrap_result.value(STDERR_KEY).toString().trimmed() ; } + + execStatus(pacstrap_rm_cmd) ; if (!!pacstrap_status) return JobError(PACSTRAP_ERROR_MSG + pacstrap_error) ; QString exec_error_msg = chrootExecPostInstall() ; diff --git a/src/libcalamares/PacstrapCppJob.h b/src/libcalamares/PacstrapCppJob.h index 8fc6b3aa0..828a5aa6f 100644 --- a/src/libcalamares/PacstrapCppJob.h +++ b/src/libcalamares/PacstrapCppJob.h @@ -129,7 +129,10 @@ private: static const qreal LIST_PACKAGES_PROPORTION ; static const qreal CHROOT_TASK_PROPORTION ; static const QString SYSTEM_EXEC_FMT ; - static const QString PACSTRAP_CLEANUP_CMD ; + static const QString PACSTRAP_FILENAME ; + static const QString PACSTRAP_PREP_CMD ; + static const QString PACSTRAP_RM_CMD ; +// static const QString PACSTRAP_CLEANUP_CMD ; static const QString KEYRING_CMD ; static const QString MOUNT_FMT ; static const QString CHROOT_PREP_FMT ; @@ -137,6 +140,7 @@ private: static const QString LIST_PACKAGES_FMT ; static const QString PACSTRAP_FMT ; static const QString UMOUNT_FMT ; + static const QString PACSTRAP_PREP_ERROR_MSG ; static const QString CONFIG_ERROR_MSG ; static const QString TARGET_ERROR_MSG ; static const QString CONFFILE_ERROR_MSG ; diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index 8d3d458da..8703cc832 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -450,21 +450,25 @@ LocaleConfiguration LocalePage::guessLocaleConfiguration() const { QLocale myLocale; // User-selected language + cLog() << "LocalePage::guessLocaleConfiguration() m_localeGenLines.isEmpty()=" << m_localeGenLines.isEmpty() ; + // If we cannot say anything about available locales if ( m_localeGenLines.isEmpty() ) { cDebug() << "WARNING: guessLocaleConfiguration can't guess from an empty list."; return LocaleConfiguration::createDefault(); } + cLog() << "LocalePage::guessLocaleConfiguration() myLocale.name()=" << myLocale.name() ; if ( myLocale.name().isEmpty() ) cLog() << "LocalePage::guessLocaleConfiguration() returing default" ; -else cLog() << "LocalePage::guessLocaleConfiguration() returing fromLanguageAndLocation()" ; QString myLanguageLocale = myLocale.name(); if ( myLanguageLocale.isEmpty() ) return LocaleConfiguration::createDefault(); +cLog() << "LocalePage::guessLocaleConfiguration() returing fromLanguageAndLocation(" << myLanguageLocale << m_tzWidget->getCurrentLocation().country << ")" ; + return LocaleConfiguration::fromLanguageAndLocation( myLanguageLocale, m_localeGenLines, m_tzWidget->getCurrentLocation().country ); diff --git a/src/modules/pacstrap-gui/pacstrap-gui.conf b/src/modules/pacstrap-gui/pacstrap-gui.conf index 8e71031b2..afedfb443 100644 --- a/src/modules/pacstrap-gui/pacstrap-gui.conf +++ b/src/modules/pacstrap-gui/pacstrap-gui.conf @@ -75,7 +75,6 @@ lxde: - "gksu" - "gnome-screenshot" - "lxde" - - "lxdm" # (issue #1790) - "obconf" - "xarchiver" - "xscreensaver" |