Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove libshadowutils-dev dependency
In response to https://git.sailfishos.org/mer-core/nemo-qml-plugin-systemsettings/merge_requests/3#note_42842
The USER environment variable is set after login, and since this package
is not used before login, it is safe to use. This way we don't have to
keep a downstream attempt to turn shadow in a shared library which no
one is going to upstream.
  • Loading branch information
PureTryOut committed Apr 22, 2020
1 parent 6a24b44 commit 6b37598
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion rpm/nemo-qml-plugin-systemsettings.spec
Expand Up @@ -21,7 +21,6 @@ BuildRequires: pkgconfig(profile)
BuildRequires: pkgconfig(mce) >= 1.21.0
BuildRequires: pkgconfig(mlite5)
BuildRequires: pkgconfig(usb-moded-qt5)
BuildRequires: pkgconfig(libshadowutils)
BuildRequires: pkgconfig(blkid)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(nemodbus) >= 2.1.16
Expand Down
13 changes: 1 addition & 12 deletions src/developermodesettings.cpp
Expand Up @@ -41,9 +41,6 @@
#include <QNetworkInterface>
#include <transaction.h>

#include <getdef.h>
#include <pwd.h>

/* Symbolic constants */
#define PROGRESS_INDETERMINATE (-1)

Expand Down Expand Up @@ -103,7 +100,7 @@ DeveloperModeSettings::DeveloperModeSettings(QObject *parent)
, m_wlanIpAddress("-")
, m_usbInterface(USB_NETWORK_FALLBACK_INTERFACE)
, m_usbIpAddress(USB_NETWORK_FALLBACK_IP)
, m_username("nemo")
, m_username(qgetenv("USER"))
, m_developerModeEnabled(QFile::exists(DEVELOPER_MODE_PROVIDED_FILE))
, m_workStatus(Idle)
, m_workProgress(PROGRESS_INDETERMINATE)
Expand All @@ -113,14 +110,6 @@ DeveloperModeSettings::DeveloperModeSettings(QObject *parent)
, m_localInstallFailed(false)
, m_localDeveloperModePackagePath(get_cached_package(QStringLiteral("*"))) // Initialized to possibly incompatible package
{
int uid = getdef_num("UID_MIN", -1);
struct passwd *pwd;
if ((pwd = getpwuid(uid)) != NULL) {
m_username = QString(pwd->pw_name);
} else {
qCWarning(lcDeveloperModeLog) << "Failed to return username using getpwuid()";
}

// Resolve and update local package path
if (!m_localDeveloperModePackagePath.isEmpty()) {
PackageKit::Transaction *resolvePackage = PackageKit::Daemon::resolve(DEVELOPER_MODE_PACKAGE"-preload", PackageKit::Transaction::FilterInstalled);
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Expand Up @@ -6,7 +6,7 @@ QT += qml dbus systeminfo
QT -= gui

CONFIG += c++11 hide_symbols link_pkgconfig
PKGCONFIG += profile mlite5 mce timed-qt5 libshadowutils blkid libcrypto nemomodels-qt5 libsailfishkeyprovider connman-qt5 glib-2.0
PKGCONFIG += profile mlite5 mce timed-qt5 blkid libcrypto nemomodels-qt5 libsailfishkeyprovider connman-qt5 glib-2.0
PKGCONFIG += ssu-sysinfo nemodbus packagekitqt5 libsystemd sailfishusermanager sailfishaccesscontrol

system(qdbusxml2cpp -p mceiface.h:mceiface.cpp mce.xml)
Expand Down

0 comments on commit 6b37598

Please sign in to comment.