From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8631513997D for ; Tue, 12 Nov 2019 23:56:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CD767E08A4; Tue, 12 Nov 2019 23:56:28 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AA071E08A4 for ; Tue, 12 Nov 2019 23:56:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4D42034CCDD for ; Tue, 12 Nov 2019 23:56:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E7B3E8A6 for ; Tue, 12 Nov 2019 23:56:24 +0000 (UTC) From: "Maciej Mrozowski" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Maciej Mrozowski" Message-ID: <1573602651.f3fdca23a349b3059cad5834e5e4fe9f945a52c6.reavertm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: kde-plasma/plasma-workspace/ X-VCS-Repository: proj/kde X-VCS-Files: kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild X-VCS-Directories: kde-plasma/plasma-workspace/ X-VCS-Committer: reavertm X-VCS-Committer-Name: Maciej Mrozowski X-VCS-Revision: f3fdca23a349b3059cad5834e5e4fe9f945a52c6 X-VCS-Branch: master Date: Tue, 12 Nov 2019 23:56:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9adf3329-441d-4869-bd6b-dc653ad7febc X-Archives-Hash: 865b441620ad9d793ab95ce6d70c40bf commit: f3fdca23a349b3059cad5834e5e4fe9f945a52c6 Author: Maciej Mrozowski gentoo org> AuthorDate: Tue Nov 12 22:51:22 2019 +0000 Commit: Maciej Mrozowski gentoo org> CommitDate: Tue Nov 12 23:50:51 2019 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=f3fdca23 kde-plasma/plasma-workspace: migrate {ssh,gpg}-agent scripts to new layout Bug: https://bugs.gentoo.org/688366 Package-Manager: Portage-2.3.76, Repoman-2.3.16 Signed-off-by: Maciej Mrozowski gentoo.org> .../plasma-workspace-5.17.49.9999.ebuild | 50 ++++++++++++++++------ .../plasma-workspace/plasma-workspace-9999.ebuild | 50 ++++++++++++++++------ 2 files changed, 76 insertions(+), 24 deletions(-) diff --git a/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild index 317e618cc1..067f98d509 100644 --- a/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild +++ b/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild @@ -129,6 +129,12 @@ PATCHES=( RESTRICT+=" test" +# used for agent scripts migration +OLDST=/etc/plasma/startup/10-agent-startup.sh +NEWST=/etc/xdg/plasma-workspace/env/10-agent-startup.sh +OLDSH=/etc/plasma/shutdown/10-agent-shutdown.sh +NEWSH=/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh + src_prepare() { ecm_src_prepare @@ -158,22 +164,42 @@ src_configure() { src_install() { ecm_src_install - # startup and shutdown scripts - insinto /etc/plasma/startup - doins "${FILESDIR}/10-agent-startup.sh" + # default startup and shutdown scripts + insinto "$(dirname ${NEWST})" + doins "${FILESDIR}/$(basename ${NEWST})" + + insinto "$(dirname ${NEWSH})" + doins "${FILESDIR}/$(basename ${NEWSH})" + fperms +x "${NEWSH}" +} + +pkg_preinst() { + ecm_pkg_preinst - insinto /etc/plasma/shutdown - doins "${FILESDIR}/10-agent-shutdown.sh" + # migrate existing agent scripts to new layout if no files there yet + if [[ -r "${EROOT}${OLDST}" && ! -f "${EROOT}${NEWST}" ]]; then + mkdir -p "${EROOT}$(dirname ${NEWST})" && cp "${EROOT}${OLDST}" "${EROOT}${NEWST}" && \ + elog "${EROOT}${OLDST} has been migrated to ${EROOT}${NEWST}, please delete old file." + fi + if [[ -r "${EROOT}${OLDSH}" && ! -f "${EROOT}${NEWSH}" ]]; then + mkdir -p "${EROOT}$(dirname ${NEWSH})" && cp "${EROOT}${OLDSH}" "${EROOT}${NEWSH}" && \ + chmod +x "${EROOT}${NEWSH}" && \ + elog "${EROOT}${OLDSH} has been migrated to ${EROOT}${NEWSH}, please delete old file." + fi } pkg_postinst () { ecm_pkg_postinst - elog "To enable gpg-agent and/or ssh-agent in Plasma sessions, do the following:" - elog " * Copy the necessary files to your home directory:" - elog " - cp /etc/plasma/startup/10-agent-startup.sh ~/.config/plasma-workspace/env/" - elog " - cp /etc/plasma/shutdown/10-agent-shutdown.sh ~/.config/plasma-workspace/shutdown/" - elog " * Edit 10-agent-startup.sh and uncomment the lines enabling ssh-agent." - elog " * In 10-agent-shutdown.sh uncomment the respective lines to properly kill" - elog " the agent when the session ends." + # warn about any leftover user scripts + if [[ -d "${EROOT}"/etc/plasma/startup && -n "$(ls "${EROOT}"/etc/plasma/startup)" ]] || \ + [[ -d "${EROOT}"/etc/plasma/shutdown && -n "$(ls "${EROOT}"/etc/plasma/shutdown)" ]]; then + elog "You appear to have scripts in ${EROOT}/etc/plasma/{startup,shutdown}." + elog "They will no longer work since plasma-workspace-5.17" + fi + + elog " * Edit ${EROOT}${NEWST} and uncomment" + elog " the lines enabling ssh-agent." + elog " * Edit ${EROOT}${NEWSH} uncomment" + elog " the respective lines to properly kill the agent when the session ends." } diff --git a/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild index fa7caa9f54..50cf5b65b4 100644 --- a/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild +++ b/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild @@ -126,6 +126,12 @@ PATCHES=( "${FILESDIR}/${PN}-5.14.2-split-libkworkspace.patch" ) RESTRICT+=" test" +# used for agent scripts migration +OLDST=/etc/plasma/startup/10-agent-startup.sh +NEWST=/etc/xdg/plasma-workspace/env/10-agent-startup.sh +OLDSH=/etc/plasma/shutdown/10-agent-shutdown.sh +NEWSH=/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh + src_prepare() { ecm_src_prepare @@ -156,22 +162,42 @@ src_configure() { src_install() { ecm_src_install - # startup and shutdown scripts - insinto /etc/plasma/startup - doins "${FILESDIR}/10-agent-startup.sh" + # default startup and shutdown scripts + insinto "$(dirname ${NEWST})" + doins "${FILESDIR}/$(basename ${NEWST})" + + insinto "$(dirname ${NEWSH})" + doins "${FILESDIR}/$(basename ${NEWSH})" + fperms +x "${NEWSH}" +} + +pkg_preinst() { + ecm_pkg_preinst - insinto /etc/plasma/shutdown - doins "${FILESDIR}/10-agent-shutdown.sh" + # migrate existing agent scripts to new layout if no files there yet + if [[ -r "${EROOT}${OLDST}" && ! -f "${EROOT}${NEWST}" ]]; then + mkdir -p "${EROOT}$(dirname ${NEWST})" && cp "${EROOT}${OLDST}" "${EROOT}${NEWST}" && \ + elog "${EROOT}${OLDST} has been migrated to ${EROOT}${NEWST}, please delete old file." + fi + if [[ -r "${EROOT}${OLDSH}" && ! -f "${EROOT}${NEWSH}" ]]; then + mkdir -p "${EROOT}$(dirname ${NEWSH})" && cp "${EROOT}${OLDSH}" "${EROOT}${NEWSH}" && \ + chmod +x "${EROOT}${NEWSH}" && \ + elog "${EROOT}${OLDSH} has been migrated to ${EROOT}${NEWSH}, please delete old file." + fi } pkg_postinst () { ecm_pkg_postinst - elog "To enable gpg-agent and/or ssh-agent in Plasma sessions, do the following:" - elog " * Copy the necessary files to your home directory:" - elog " - cp /etc/plasma/startup/10-agent-startup.sh ~/.config/plasma-workspace/env/" - elog " - cp /etc/plasma/shutdown/10-agent-shutdown.sh ~/.config/plasma-workspace/shutdown/" - elog " * Edit 10-agent-startup.sh and uncomment the lines enabling ssh-agent." - elog " * In 10-agent-shutdown.sh uncomment the respective lines to properly kill" - elog " the agent when the session ends." + # warn about any leftover user scripts + if [[ -d "${EROOT}"/etc/plasma/startup && -n "$(ls "${EROOT}"/etc/plasma/startup)" ]] || \ + [[ -d "${EROOT}"/etc/plasma/shutdown && -n "$(ls "${EROOT}"/etc/plasma/shutdown)" ]]; then + elog "You appear to have scripts in ${EROOT}/etc/plasma/{startup,shutdown}." + elog "They will no longer work since plasma-workspace-5.17" + fi + + elog " * Edit ${EROOT}${NEWST} and uncomment" + elog " the lines enabling ssh-agent." + elog " * Edit ${EROOT}${NEWSH} uncomment" + elog " the respective lines to properly kill the agent when the session ends." }