public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Manuel Rüger" <mrueg@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/kde4-l10n/
Date: Sat, 19 Sep 2015 14:05:39 +0000 (UTC)	[thread overview]
Message-ID: <1442671525.07a7c23b7d497d5e0566570fc655063140774b40.mrueg@gentoo> (raw)

commit:     07a7c23b7d497d5e0566570fc655063140774b40
Author:     Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Wed Sep 16 18:47:58 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Sat Sep 19 14:05:25 2015 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=07a7c23b

kde-apps/kde4-l10n: Finally fix USE=-minimal

Be more verbose about what is being copied or removed.
Merge everything from LEGACY_LANGS, not just messages.
Take care of nonexistent directories in destination paths.
Fixes https://bugs.gentoo.org/show_bug.cgi?id=560336

Package-Manager: portage-2.2.20.1

 kde-apps/kde4-l10n/kde4-l10n-15.08.1.ebuild | 44 ++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 14 deletions(-)

diff --git a/kde-apps/kde4-l10n/kde4-l10n-15.08.1.ebuild b/kde-apps/kde4-l10n/kde4-l10n-15.08.1.ebuild
index ef80763..49d9885 100644
--- a/kde-apps/kde4-l10n/kde4-l10n-15.08.1.ebuild
+++ b/kde-apps/kde4-l10n/kde4-l10n-15.08.1.ebuild
@@ -66,11 +66,12 @@ src_unpack() {
 }
 
 src_prepare() {
-	local LNG DIR SDIR
+	local LNG DIR LDIR SDIR
 	# add all linguas to cmake
 	if [[ -n ${A} ]]; then
 		for LNG in ${LINGUAS}; do
 			DIR="${KMNAME}-${LNG}-${PV}"
+			LDIR="${KMNAME}-${LNG}-${LV}"
 			SDIR="${S}/${DIR}/4/${LNG}"
 			if [[ -d "${DIR}" ]] ; then
 				echo "add_subdirectory( ${DIR} )" >> "${S}"/CMakeLists.txt
@@ -80,12 +81,12 @@ src_prepare() {
 
 				# Drop translations installed with plasma 5 and kde-apps 5 packages
 				if use minimal; then
-					einfo "Removing paths from ${LNG}"
-					if [[ -d "${KMNAME}-${LNG}-${LV}" ]] ; then
-						rm -rf "${KMNAME}-${LNG}-${LV}"
+					einfo "${LNG}: Removing file conflicts"
+					if [[ -d "${LDIR}" ]] ; then
+						rm -rf "${LDIR}"
 					fi
 
-					# Remove dirs
+					einfo "   directories..."
 					while read path; do
 						if [[ -n ${path} && -e "${SDIR}"/${path%\ *}/CMakeLists.txt ]] ; then
 							sed -e ":${path#*\ }: s:^:#:"\
@@ -93,7 +94,7 @@ src_prepare() {
 						fi
 					done < <(grep -v "^#" "${REMOVE_DIRS}")
 
-					# Remove messages
+					einfo "   messages..."
 					for path in $(grep -v "^#" "${REMOVE_MSGS}") ; do
 						rm -f "${SDIR}"/messages/${path}
 						# Quirk for LINGUAS=sr variants
@@ -102,16 +103,31 @@ src_prepare() {
 						fi
 					done
 				else
-					if [[ -d "${KMNAME}-${LNG}-${LV}" ]] ; then
-						# Do not try to copy kdepim localisation
-						for path in kdepim kdepimlibs kdepim-runtime; do
-							rm -rf "${KMNAME}-${LNG}-${LV}/messages/${path}" || die
+					if [[ -d "${LDIR}" ]] ; then
+						einfo "${LNG}: Adding legacy localisation"
+						local dest_path
+						# Step through directories alphabetically first
+						for path in $(ls -R "${LDIR}" | grep ":$" | sed -e 's/:$//') ; do
+							dest_path="${path/${LV}/${PV}/4/${LNG}}"
+							if [[ ! -d "${dest_path}" ]] ; then
+								einfo "   $(basename ${dest_path}) subdirectory"\
+									"added to $(basename $(dirname ${dest_path}))"
+								mkdir "${dest_path}" || die "Failed creating ${dest_path}"
+								echo "add_subdirectory($(basename ${dest_path}))" >> \
+									$(dirname "${dest_path}")/CMakeLists.txt
+							fi
 						done
-						# Merge legacy localisation
-						for path in $(find "${KMNAME}-${LNG}-${LV}" -name "*.po"); do
-							cp -rn "${path}" "${path/${LV}/${PV}/4/${LNG}}" || die
+						einfo "   merging legacy localisation..."
+						for path in $(find "${LDIR}" -type f) ; do
+							dest_path="${path/${LV}/${PV}/4/${LNG}}"
+							cp -rn "${path}" "${dest_path}" || die "Failed copying ${path}"
 						done
-						rm -rf "${KMNAME}-${LNG}-${LV}"
+						# Disable kdepim
+						for path in kdepim kdepimlibs kdepim-runtime ; do
+							find "${SDIR}" -name CMakeLists.txt -type f -exec \
+								sed -i -e "s:^ *add_subdirectory( *${path} *):# no ${path}:g" {} +
+						done
+						rm -rf "${LDIR}"
 					fi
 				fi
 			fi


             reply	other threads:[~2015-09-19 14:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-19 14:05 Manuel Rüger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-07-25 16:55 [gentoo-commits] proj/kde:master commit in: kde-apps/kde4-l10n/ Andreas Sturmlechner
2016-07-23 12:03 Johannes Huber
2016-07-13 18:23 Johannes Huber
2016-07-08 17:29 Michael Palimaka
2016-05-18 13:25 Johannes Huber
2016-04-09 15:12 Michael Palimaka
2015-12-06 15:22 Alexey Shvetsov
2015-08-25 21:35 Johannes Huber
2015-08-08 12:28 Johannes Huber
2015-06-27 13:53 Manuel Rüger
2015-06-14 15:24 Michael Palimaka
2015-05-31 19:09 Manuel Rüger
2015-05-27 12:07 Michael Palimaka
2015-05-23 17:16 Michael Palimaka
2015-05-23 17:16 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442671525.07a7c23b7d497d5e0566570fc655063140774b40.mrueg@gentoo \
    --to=mrueg@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox