From owner-freebsd-ports-bugs@FreeBSD.ORG Sat May 24 01:30:00 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87710167 for ; Sat, 24 May 2014 01:30:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 632C42979 for ; Sat, 24 May 2014 01:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O1U0PH015129 for ; Sat, 24 May 2014 01:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4O1U02v015126; Sat, 24 May 2014 01:30:00 GMT (envelope-from gnats) Resent-Date: Sat, 24 May 2014 01:30:00 GMT Resent-Message-Id: <201405240130.s4O1U02v015126@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ed Maste Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0201115E for ; Sat, 24 May 2014 01:29:55 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E309A2973 for ; Sat, 24 May 2014 01:29:54 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O1TsKa015055 for ; Sat, 24 May 2014 01:29:54 GMT (envelope-from emaste@freefall.freebsd.org) Received: (from emaste@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4O1Tso8015054; Sat, 24 May 2014 01:29:54 GMT (envelope-from emaste) Message-Id: <201405240129.s4O1Tso8015054@freefall.freebsd.org> Date: Sat, 24 May 2014 01:29:54 GMT From: Ed Maste Reply-To: Ed Maste To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/190158: textproc/kdiff3 fails to save output with -o relative path X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 01:30:00 -0000 >Number: 190158 >Category: ports >Synopsis: textproc/kdiff3 fails to save output with -o relative path >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 24 01:30:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Ed Maste >Release: FreeBSD 11.0-CURRENT amd64 >Organization: FreeBSD >Environment: System: FreeBSD freefall.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r265336: Sun May 4 20:43:08 UTC 2014 peter@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL amd64 >Description: Using kdiff3 as "git mergetool" fails to save output specified as a relative path. Upstream fix here: http://sourceforge.net/p/kdiff3/code/ci/23ad423e4255c80ee22b269f73e20333f7c06678/ >How-To-Repeat: printf '1\n' > file.BASE printf '0\n1\n' > file.r0 printf '1\n2\n' > file.r1 kdiff3 --auto -o ./file file.BASE file.r0 file.r1 (From https://bugs.archlinux.org/task/31813) >Fix: --- patch-23ad423 begins here --- commit 23ad423e4255c80ee22b269f73e20333f7c06678 Author: joachim99 Date: Sat Sep 22 23:02:12 2012 +0200 - Fix for saving files on KDE with relative path specified via command line option -o. Signed-off-by: joachim99 diff --git src-QT4/fileaccess.cpp src-QT4/fileaccess.cpp index 134fc26..b6e01f0 100644 --- src-QT4/fileaccess.cpp +++ src-QT4/fileaccess.cpp @@ -183,7 +183,8 @@ static QString nicePath( const QFileInfo& fi ) void FileAccess::setFile( const QFileInfo& fi, FileAccess* pParent ) { - m_filePath = nicePath( fi.filePath() ); // remove "./" at start + m_filePath = pParent == 0 ? fi.absoluteFilePath() : + nicePath( fi.filePath() ); // remove "./" at start m_bSymLink = fi.isSymLink(); if ( m_bSymLink || (!m_bExists && m_filePath.contains("@@") ) ) @@ -566,7 +567,16 @@ QString FileAccess::absoluteFilePath() const if ( parent() != 0 ) return parent()->absoluteFilePath() + "/" + m_filePath; else - return m_filePath; + { + if ( m_filePath.isEmpty() ) + return QString(); + + QFileInfo fi( m_filePath ); + if ( fi.isAbsolute() ) + return m_filePath; + else + return fi.absoluteFilePath(); // Probably never reached + } } // Full abs path // Just the name-part of the path, without parent directories @@ -1184,7 +1194,7 @@ bool FileAccessJobHandler::rename( const QString& dest ) m_bSuccess = false; KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->url(), kurl, permissions, KIO::HideProgressInfo ); connect( pJob, SIGNAL(result(KJob*)), this, SLOT(slotSimpleJobResult(KJob*))); - connect( pJob, SIGNAL(percent(KJob*,unsigned long)), this, SLOT(slotPercent(KJob*, unsigned long))); + connect( pJob, SIGNAL(percent(KJob*,unsigned long)), &pp, SLOT(slotPercent(KJob*, unsigned long))); ProgressProxy::enterEventLoop( pJob, i18n("Renaming file: %1 -> %2",m_pFileAccess->prettyAbsPath(),dest) ); @@ -1673,7 +1683,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, &pp, SLOT( slotListDirInfoMessage(KJob*, const QString&) )); // This line makes the transfer via fish unreliable.:-( - //connect( pListJob, SIGNAL(percent(KJob*,unsigned long)), this, SLOT(slotPercent(KJob*, unsigned long))); + //connect( pListJob, SIGNAL(percent(KJob*,unsigned long)), &pp, SLOT(slotPercent(KJob*, unsigned long))); ProgressProxy::enterEventLoop( pListJob, i18n("Listing directory: %1",m_pFileAccess->prettyAbsPath()) ); diff --git src-QT4/kdiff3.cpp src-QT4/kdiff3.cpp index 165602f..de7cc9c 100644 --- src-QT4/kdiff3.cpp +++ src-QT4/kdiff3.cpp @@ -211,6 +211,8 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff3 m_outputFilename = args->getOption("output"); if ( m_outputFilename.isEmpty() ) m_outputFilename = args->getOption("out"); + if ( ! m_outputFilename.isEmpty() ) + m_outputFilename = FileAccess( m_outputFilename, true ).absoluteFilePath(); } m_bAutoFlag = args!=0 && args->isSet("auto"); --- patch-23ad423 ends here --- >Release-Note: >Audit-Trail: >Unformatted: