diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2006-11-18 21:29:47 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2006-11-18 21:29:47 +0000 |
commit | af78d3a64e39b3aea2b255362acae37bfe87bf1e (patch) | |
tree | 959e98790fc24f0c35b82b3f0961a32f125f876c /app-editors/kile | |
parent | add missing python-gtkextra to removal list (diff) | |
download | gentoo-2-af78d3a64e39b3aea2b255362acae37bfe87bf1e.tar.gz gentoo-2-af78d3a64e39b3aea2b255362acae37bfe87bf1e.tar.bz2 gentoo-2-af78d3a64e39b3aea2b255362acae37bfe87bf1e.zip |
Add patch to backport the fix for backup files.
(Portage version: 2.1.2_rc2)
Diffstat (limited to 'app-editors/kile')
-rw-r--r-- | app-editors/kile/ChangeLog | 8 | ||||
-rw-r--r-- | app-editors/kile/files/digest-kile-1.9.2-r1 | 3 | ||||
-rw-r--r-- | app-editors/kile/files/kile-1.9.2-backupfile.patch | 69 | ||||
-rw-r--r-- | app-editors/kile/kile-1.9.2-r1.ebuild | 47 |
4 files changed, 126 insertions, 1 deletions
diff --git a/app-editors/kile/ChangeLog b/app-editors/kile/ChangeLog index 2a15db6eaa73..d06e18431028 100644 --- a/app-editors/kile/ChangeLog +++ b/app-editors/kile/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-editors/kile # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/kile/ChangeLog,v 1.80 2006/11/18 20:57:33 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/kile/ChangeLog,v 1.81 2006/11/18 21:29:47 flameeyes Exp $ + +*kile-1.9.2-r1 (18 Nov 2006) + + 18 Nov 2006; Diego Pettenò <flameeyes@gentoo.org> + +files/kile-1.9.2-backupfile.patch, +kile-1.9.2-r1.ebuild: + Add patch to backport the fix for backup files. *kile-1.9.3 (18 Nov 2006) diff --git a/app-editors/kile/files/digest-kile-1.9.2-r1 b/app-editors/kile/files/digest-kile-1.9.2-r1 new file mode 100644 index 000000000000..1f96630b8cf3 --- /dev/null +++ b/app-editors/kile/files/digest-kile-1.9.2-r1 @@ -0,0 +1,3 @@ +MD5 2f4fa752595c9011fd9292d7ff99d124 kile-1.9.2.tar.bz2 5038779 +RMD160 d3b7245412d57ce38275348fc67b6f8b875a2976 kile-1.9.2.tar.bz2 5038779 +SHA256 292bc8a5d868faf70f7e0b3c868da30ad3ad77b3355ca08389e60e1339175c00 kile-1.9.2.tar.bz2 5038779 diff --git a/app-editors/kile/files/kile-1.9.2-backupfile.patch b/app-editors/kile/files/kile-1.9.2-backupfile.patch new file mode 100644 index 000000000000..fb1b8dfe8bed --- /dev/null +++ b/app-editors/kile/files/kile-1.9.2-backupfile.patch @@ -0,0 +1,69 @@ +--- kile-1.9.2/src/kile/kiledocmanager.cpp 2006-05-07 23:44:53.000000000 +0200 ++++ kile-1.9.3/src/kile/kiledocmanager.cpp 2006-11-18 20:55:03.000000000 +0100 +@@ -34,6 +34,7 @@ + #include <kio/netaccess.h> + #include <kpushbutton.h> + #include <kurl.h> ++#include <kfileitem.h> + + #include "kileuntitled.h" + #include "templates.h" +@@ -743,10 +747,8 @@ + { + Kate::View *view; + QFileInfo fi; +- bool successBackup; + int saveResult; +- QString backupFileName; +- KURL url; ++ KURL url, backupUrl; + + kdDebug() << "===Kile::fileSaveAll=================" << endl; + kdDebug() << "autosaving = " << amAutoSaving << ", DisUntitled = " << disUntitled << endl; +@@ -759,7 +761,6 @@ + { + url = view->getDoc()->url(); + fi.setFile(url.path()); +- backupFileName = url.path()+ ".backup"; + + if ( ( !amAutoSaving && !(disUntitled && url.isEmpty() ) ) // DisregardUntitled is true and we have an untitled doc and don't autosave + || ( amAutoSaving && !url.isEmpty() ) //don't save untitled documents when autosaving +@@ -768,10 +769,34 @@ + { + if (amAutoSaving && fi.size() > 0) // the size check ensures that we don't save empty files (to prevent something like #125809 in the future). + { +- kdDebug() << "autosaving: " << backupFileName << endl; +- successBackup = KIO::NetAccess::file_copy(url, KURL::fromPathOrURL(backupFileName), -1, true, false, kapp->mainWidget()); +- if(!successBackup) +- m_ki->logWidget()->printMsg(KileTool::Error,i18n("The file %1 could not be saved, check the permissions and the free disk space!").arg(backupFileName),i18n("Autosave")); ++ KURL backupUrl = KURL::fromPathOrURL(url.path()+ ".backup"); ++ kdDebug() << "autosaving: " << backupUrl.prettyURL() << endl; ++ ++ // patch for secure permissions, slightly modified for kile by Thomas Braun, taken from #103331 ++ ++ // get the right permissions, start with safe default ++ mode_t perms = 0600; ++ KIO::UDSEntry fentry; ++ if (KIO::NetAccess::stat (url, fentry, kapp->mainWidget())) ++ { ++ kdDebug () << "stating successfull: " << url.prettyURL() << endl; ++ KFileItem item (fentry, url); ++ perms = item.permissions(); ++ } ++ ++ // first del existing file if any, than copy over the file we have ++ // failure if a: the existing file could not be deleted, b: the file could not be copied ++ if ( (!KIO::NetAccess::exists( backupUrl, false, kapp->mainWidget() ) ++ || KIO::NetAccess::del( backupUrl, kapp->mainWidget() ) ) ++ && KIO::NetAccess::file_copy( url, backupUrl, perms, true, false, kapp->mainWidget() ) ) ++ { ++ kdDebug()<<"backing up successfull ("<<url.prettyURL()<<" -> "<<backupUrl.prettyURL()<<")"<<endl; ++ } ++ else ++ { ++ kdDebug()<<"backing up failed ("<<url.prettyURL()<<" -> "<<backupUrl.prettyURL()<<")"<<endl; ++ m_ki->logWidget()->printMsg(KileTool::Error,i18n("The file %1 could not be saved, check the permissions and the free disk space!").arg(backupUrl.prettyURL()),i18n("Autosave")); ++ } + } + + kdDebug() << "saving: " << url.path() << endl; diff --git a/app-editors/kile/kile-1.9.2-r1.ebuild b/app-editors/kile/kile-1.9.2-r1.ebuild new file mode 100644 index 000000000000..767150351bf1 --- /dev/null +++ b/app-editors/kile/kile-1.9.2-r1.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-editors/kile/kile-1.9.2-r1.ebuild,v 1.1 2006/11/18 21:29:47 flameeyes Exp $ + +inherit kde + +MY_P="${P/_rc/rc}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="A Latex Editor and TeX shell for kde" +HOMEPAGE="http://kile.sourceforge.net/" +SRC_URI="mirror://sourceforge/kile/${MY_P}.tar.bz2" +LICENSE="GPL-2" + +SLOT=0 +KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="kde" + +RDEPEND="dev-lang/perl + virtual/tetex + dev-tex/latex2html + kde? ( || ( ( kde-base/kpdf + kde-base/kghostview + kde-base/kdvi + kde-base/kviewshell ) + kde-base/kdegraphics ) )" + +need-kde 3.2 + +LANGS="br ca cs cy da de el en_GB es et eu fi fr ga gl hi hu is it ja lt mt nb +nl nn pa pl pt pt_BR ro ru rw sk sr sr@Latn sv ta tr zh_CN" +for lang in ${LANGS}; do + IUSE="${IUSE} linguas_${lang}" +done + +PATCHES="${FILESDIR}/${P}-backupfile.patch" + +src_unpack() { + kde_src_unpack + + if [[ -n ${LINGUAS} ]]; then + MAKE_TRANSL=$(echo $(echo "${LINGUAS} ${LANGS}" | fmt -w 1 | sort | uniq -d)) + einfo "Building translations for: ${MAKE_TRANSL}" + sed -i -e "s:^SUBDIRS.*=.*:SUBDIRS = ${MAKE_TRANSL}:" ${S}/translations/Makefile.am || die "sed for locale failed" + rm -f ${S}/configure + fi +} |