Cherry-picking new upstream version 0.11.1

* Removed some build dependencies:
  -cmake
  -libqt5xdg-dev
  -libqt5xdgiconloader-dev
  -pkg-config
  -qttools5-dev
  -qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Fixed d/gbp.conf
ubuntu/cosmic debian/0.11.1-1
Alf Gaida 7 years ago
parent f71380240d
commit abe1bf9f3c

3
.gitignore vendored

@ -1,3 +0,0 @@
build
lxqt-admin.kdev4
*/translations/lxqt-admin

@ -1,7 +1,16 @@
lxqt-admin-0.11.0 / 2016-09-24
lxqt-admin-0.11.1 / 2017-01-01
==============================
* lxqt-admin-user: Add FreeBSD support
* Added *da.desktop
* Add French translation
* Remove cpack (#40)
0.11.0 / 2016-09-24
===================
* Release 0.11.0: Add changelog
* user: Add failure message box
* user: Provide icon name in polkit policy
* Update README.md

@ -14,15 +14,13 @@ find_package(KF5WindowSystem REQUIRED QUIET)
include(LXQtCompilerSettings NO_POLICY_SCOPE)
include(LXQtTranslate)
add_subdirectory(lxqt-admin-time)
add_subdirectory(lxqt-admin-user)
# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include(CPack)
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-user")
message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-time")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
add_subdirectory(lxqt-admin-user)
message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-time")
else()
add_subdirectory(lxqt-admin-user)
add_subdirectory(lxqt-admin-time)
endif()

16
debian/changelog vendored

@ -1,3 +1,19 @@
lxqt-admin (0.11.1-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.11.1
* Removed some build dependencies:
-cmake
-libqt5xdg-dev
-libqt5xdgiconloader-dev
-pkg-config
-qttools5-dev
-qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Fixed d/gbp.conf
-- Alf Gaida <agaida@siduction.org> Mon, 02 Jan 2017 12:11:04 +0100
lxqt-admin (0.11.0-2) unstable; urgency=medium
* Cherry-picking new upstream version 0.11.0

10
debian/control vendored

@ -6,17 +6,11 @@ Uploaders: Alf Gaida <agaida@siduction.org>,
Section: x11
Priority: optional
Build-Depends: debhelper (>= 10),
cmake (>= 3.0.2),
libkf5windowsystem-dev,
liblxqt0-dev (>= 0.11.0),
liblxqt0-dev (>= 0.11.1),
libqt5svg5-dev,
libqt5x11extras5-dev,
libqt5xdg-dev (>= 2.0.0),
libqt5xdgiconloader-dev (>= 2.0.0),
libx11-dev,
pkg-config,
qttools5-dev,
qttools5-dev-tools
libx11-dev
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-admin.git/?h=debian/sid
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-admin.git -b debian/sid

4
debian/copyright vendored

@ -3,12 +3,12 @@ Upstream-Name: lxqt-admin
Source: https://github.com/lxde/lxqt-admin
Files: *
Copyright: 2014-2016 LXQt team
Copyright: 2014-2017 LXQt team
2014 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
License: LGPL-2.1+
Files: debian/*
Copyright: 2014-2016 Alf Gaida <agaida@siduction.org>
Copyright: 2014-2017 Alf Gaida <agaida@siduction.org>
2015 Andrew Lee (李健秋) <ajqlee@debian.org>
License: LGPL-2.1+

2
debian/gbp.conf vendored

@ -1,5 +1,5 @@
[DEFAULT]
debian-branch = debian
debian-branch = debian/sid
pristine-tar = True
[import-orig]

@ -0,0 +1,3 @@
Name[da]=Dato og klokkeslæt
GenericName[da]=Indstillinger for dato og klokkeslæt
Comment[da]=Konfigurér datoen og klokkeslættet på dit system

@ -0,0 +1,4 @@
#TRANSLATIONS
Name[fr]=Date et heure
GenericName[fr]=Paramétrer la date et l'heure
Comment[fr]=Paramétrer la date et l'heure du système

@ -82,5 +82,10 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.lxqt-admin-user.policy"
@ONLY
)
install(PROGRAMS "lxqt-admin-user-helper" DESTINATION bin)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
install(PROGRAMS "lxqt-admin-user-helper.freebsd" DESTINATION bin RENAME lxqt-admin-user-helper)
else()
install(PROGRAMS "lxqt-admin-user-helper.default" DESTINATION bin RENAME lxqt-admin-user-helper)
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.lxqt-admin-user.policy" DESTINATION "share/polkit-1/actions")

@ -0,0 +1,15 @@
#!/bin/sh
case "$1" in
useradd|usermod|userdel|groupadd|groupmod|groupdel)
export LC_ALL=C
exec "pw" "${@}"
;;
passwd)
export LC_ALL=C
exec "$@"
;;
*)
echo "Command '$1' is not allowed!"
exit 1
;;
esac

@ -40,6 +40,15 @@ MainWindow::MainWindow():
connect(ui.actionChangePasswd, SIGNAL(triggered(bool)), SLOT(onChangePasswd()));
connect(ui.actionRefresh, SIGNAL(triggered(bool)), SLOT(reload()));
#ifdef Q_OS_FREEBSD //Disable group gpasswd for FreeBSD
connect(ui.tabWidget, &QTabWidget::currentChanged, [this](int index) {
if(index==1) {
ui.actionChangePasswd->setEnabled(false);
} else {
ui.actionChangePasswd->setEnabled(true);
}
});
#endif
connect(ui.userList, &QListWidget::activated, this, &MainWindow::onRowActivated);
connect(ui.groupList, &QListWidget::activated, this, &MainWindow::onRowActivated);

@ -0,0 +1,3 @@
Name[da]=Brugere og grupper
GenericName[da]=Indstillinger for brugere og grupper
Comment[da]=Konfigurér systemets brugere og grupper

@ -0,0 +1,4 @@
#TRANSLATIONS
Name[fr]=Utilisateurs et groupes
GenericName[fr]=Paramétrage des utilisateurs et des groupes
Comment[fr]=Paramétrage des utilisateurs et des groupes du système

@ -46,7 +46,7 @@ UserDialog::UserDialog(UserManager* userManager, UserInfo* user, QWidget* parent
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsUserCheckable|Qt::ItemIsSelectable);
if(!isNewUser)
{
if(group->hasMember(user->name()) || user->gid() == group->gid()) // the user is in this group
if(group->hasMember(user->name())) // the user is in this group
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);

@ -246,6 +246,9 @@ bool UserManager::addUser(UserInfo* user) {
if(!user->groups().isEmpty()) { // set group membership
command << QStringLiteral("-G") << user->groups().join(',');
}
#ifdef Q_OS_FREEBSD
command << QStringLiteral("-n");
#endif
command << user->name();
return pkexec(command);
}
@ -254,33 +257,46 @@ bool UserManager::modifyUser(UserInfo* user, UserInfo* newSettings) {
if(!user || user->name().isEmpty() || !newSettings)
return false;
bool isDirty = false;
QStringList command;
command << QStringLiteral("usermod");
if(newSettings->uid() != user->uid())
if(newSettings->uid() != user->uid()) {
command << QStringLiteral("-u") << QString::number(newSettings->uid());
isDirty=true;
}
if(newSettings->homeDir() != user->homeDir()) {
command << QStringLiteral("-d") << newSettings->homeDir();
// command << QStringLiteral("-m"); // create the user's home directory if it does not exist.
isDirty=true;
}
if(newSettings->shell() != user->shell()) {
command << QStringLiteral("-s") << newSettings->shell();
isDirty=true;
}
if(newSettings->fullName() != user->fullName())
if(newSettings->fullName() != user->fullName()) {
command << QStringLiteral("-c") << newSettings->fullName();
if(newSettings->gid() != user->gid())
isDirty=true;
}
if(newSettings->gid() != user->gid()) {
command << QStringLiteral("-g") << QString::number(newSettings->gid());
if(newSettings->name() != user->name()) // change login name
isDirty=true;
}
if(newSettings->name() != user->name()) { // change login name
command << QStringLiteral("-l") << newSettings->name();
isDirty=true;
}
if(newSettings->groups() != user->groups()) { // change group membership
command << QStringLiteral("-G") << newSettings->groups().join(',');
isDirty=true;
}
#ifdef Q_OS_FREEBSD
command << QStringLiteral("-n");
#endif
command << user->name();
return pkexec(command);
if(isDirty) {
return pkexec(command);
}
return true; //No changes
}
bool UserManager::deleteUser(UserInfo* user) {
@ -332,24 +348,51 @@ bool UserManager::modifyGroup(GroupInfo* group, GroupInfo* newSettings) {
if(!group || group->name().isEmpty() || !newSettings)
return false;
QStringList command;
bool isDirty = false;
command << QStringLiteral("groupmod");
if(newSettings->gid() != group->gid())
if(newSettings->gid() != group->gid()) {
command << QStringLiteral("-g") << QString::number(newSettings->gid());
if(newSettings->name() != group->name())
command << QStringLiteral("-n") << newSettings->name();
isDirty = true;
}
if(newSettings->name() != group->name()) {
isDirty = true;
#ifdef Q_OS_FREEBSD
command << QStringLiteral("-l");
#else
command << QStringLiteral("-n");
#endif
command << newSettings->name();
}
#ifdef Q_OS_FREEBSD
if(newSettings->members() != group->members()) {
isDirty = true;
command << QStringLiteral("-M"); // Set the list of group members.
command << newSettings->members().join(',');
}
command << QStringLiteral("-n");
#endif
command << group->name();
if(!pkexec(command))
if(isDirty && !pkexec(command))
return false;
// if group members are changed, use gpasswd to reset members
// if group members are changed, use gpasswd to reset members on linux
#ifndef Q_OS_FREEBSD //This is already done with pw groupmod -M earlier.
if(newSettings->members() != group->members()) {
command.clear();
command << QStringLiteral("gpasswd");
command << QStringLiteral("-M"); // Set the list of group members.
command << newSettings->members().join(',');
command << group->name();
//if the group name changed the group->name() is still the old setting.
if(newSettings->name() != group->name()) {
command << newSettings->name();
} else {
command << group->name();
}
return pkexec(command);
}
#endif
return true;
}

Loading…
Cancel
Save