From 524084075e3ba8bc8bc5e2264601a37721504335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tpg=20=28Tomasz=20Pawe=C5=82=20Gajc=29?= Date: Mon, 23 Feb 2015 19:02:31 +0100 Subject: [PATCH] update to new snapshot, add patch to remove user --- .abf.yml | 2 +- ...0150203-add-removeUser-functionality.patch | 44 +++++++++++++++++++ ...mares-1.0.0-20150203-use-urpme--auto.patch | 12 ----- calamares.spec | 6 +-- omv-users.conf | 1 + 5 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 calamares-1.0.0-20150203-add-removeUser-functionality.patch delete mode 100644 calamares-1.0.0-20150203-use-urpme--auto.patch diff --git a/.abf.yml b/.abf.yml index 75cb9f4..99a66a7 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,3 +1,3 @@ sources: - calamares-1.0.0-20150222.tar.xz: 5a8a5da9b80d93a26c02bac6e8cfc7726a4516a4 + calamares-1.0.0-20150223.tar.xz: c317b28015214905bdb3e3ea1377aad9e2317e38 calamares-partitionmanager-20150112.tar.xz: 9fd2828fde3ecb3692868ea186469424c5be580e diff --git a/calamares-1.0.0-20150203-add-removeUser-functionality.patch b/calamares-1.0.0-20150203-add-removeUser-functionality.patch new file mode 100644 index 0000000..f4c575c --- /dev/null +++ b/calamares-1.0.0-20150203-add-removeUser-functionality.patch @@ -0,0 +1,44 @@ +diff -Naur calamares-1.0.0-20150223/src/modules/users/CreateUserJob.cpp calamares-1.0.0-20150223.tpg/src/modules/users/CreateUserJob.cpp +--- calamares-1.0.0-20150223/src/modules/users/CreateUserJob.cpp 2015-02-23 08:45:48.000000000 +0000 ++++ calamares-1.0.0-20150223.tpg/src/modules/users/CreateUserJob.cpp 2015-02-23 18:01:08.983649397 +0000 +@@ -143,5 +143,14 @@ + tr( "chown terminated with error code %1." ) + .arg( ec ) ); + ++ if ( gs->contains( "removeUser" ) && ++ !gs->value( "removeUser" ).toString().isEmpty() ) ++ { ++ ++ QString removeUser = gs->value( "removeUser" ).toString(); ++ ++ CalamaresUtils::chrootCall( { "userdel", "-f", "-r" removeUser } ); ++ } ++ + return Calamares::JobResult::ok(); + } +diff -Naur calamares-1.0.0-20150223/src/modules/users/UsersViewStep.cpp calamares-1.0.0-20150223.tpg/src/modules/users/UsersViewStep.cpp +--- calamares-1.0.0-20150223/src/modules/users/UsersViewStep.cpp 2015-02-23 08:45:48.000000000 +0000 ++++ calamares-1.0.0-20150223.tpg/src/modules/users/UsersViewStep.cpp 2015-02-23 17:58:40.420748643 +0000 +@@ -151,5 +151,13 @@ + Calamares::JobQueue::instance()->globalStorage()->insert( "sudoersGroup", + configurationMap.value( "sudoersGroup" ).toString() ); + } ++ ++ if ( configurationMap.contains( "removeUser" ) && ++ configurationMap.value( "removeUser" ).type() == QVariant::String ) ++ { ++ Calamares::JobQueue::instance()->globalStorage()->insert( "removeUser", ++ configurationMap.value( "removeUser" ).toString() ); ++ } ++ + } + +diff -Naur calamares-1.0.0-20150223/src/modules/users/users.conf calamares-1.0.0-20150223.tpg/src/modules/users/users.conf +--- calamares-1.0.0-20150223/src/modules/users/users.conf 2015-02-23 08:45:48.000000000 +0000 ++++ calamares-1.0.0-20150223.tpg/src/modules/users/users.conf 2015-02-23 17:32:11.521059300 +0000 +@@ -9,3 +9,5 @@ + - audio + autologinGroup: autologin + sudoersGroup: wheel ++# Remove specified user after installation is done ++removeUser: diff --git a/calamares-1.0.0-20150203-use-urpme--auto.patch b/calamares-1.0.0-20150203-use-urpme--auto.patch deleted file mode 100644 index 6c702c7..0000000 --- a/calamares-1.0.0-20150203-use-urpme--auto.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur calamares-1.0.0-20150203/src/modules/packages/main.py calamares-1.0.0-20150203.tpg/src/modules/packages/main.py ---- calamares-1.0.0-20150203/src/modules/packages/main.py 2015-02-03 08:45:42.000000000 +0000 -+++ calamares-1.0.0-20150203.tpg/src/modules/packages/main.py 2015-02-22 00:35:34.360391343 +0000 -@@ -53,7 +53,7 @@ - # ignore the error code for now because dnf thinks removing a nonexistent package is an error - chroot_call(["dnf", "--disablerepo=*", "-C", "-y", "remove"] + pkgs) - elif self.backend == "urpmi": -- check_chroot_call(["urpme"] + pkgs) -+ check_chroot_call(["urpme", "--auto"] + pkgs) - elif self.backend == "apt": - check_chroot_call(["apt-get", "--purge", "-q", "-y", "remove"] + pkgs) - check_chroot_call(["apt-get", "--purge", "-q", "-y", "autoremove"]) diff --git a/calamares.spec b/calamares.spec index 9834f0a..9da5326 100644 --- a/calamares.spec +++ b/calamares.spec @@ -1,4 +1,4 @@ -%define calamdate 20150222 +%define calamdate 20150223 %define partdate 20150112 %define major 1 @@ -8,7 +8,7 @@ Summary: Distribution-independent installer framework Name: calamares Version: 1.0.0 -Release: 0.%{calamdate}.3 +Release: 0.%{calamdate}.1 Group: System/Configuration/Other License: GPLv3+ URL: http://calamares.io/ @@ -35,7 +35,7 @@ Source18: omv-settings.conf Source19: omv-unpackfs.conf Source20: omv-users.conf Patch1: calamares-0.17.0-20150112-openmandriva-desktop-file.patch -Patch2: calamares-1.0.0-20150203-use-urpme--auto.patch +Patch3: calamares-1.0.0-20150203-add-removeUser-functionality.patch BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Xml) diff --git a/omv-users.conf b/omv-users.conf index 75ebb6b..ea4eb55 100644 --- a/omv-users.conf +++ b/omv-users.conf @@ -10,3 +10,4 @@ defaultGroups: - sambashare autologinGroup: autologin sudoersGroup: wheel +removeUser: live