From 73dbd9babc8784113fea0c633dc16899ef8bf5f3 Mon Sep 17 00:00:00 2001 From: Johannes Winkelmann Date: Wed, 13 Sep 2006 17:13:26 +0000 Subject: [PATCH] prt-get: prepare for 5.14 git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1875 0b5ae1c7-2405-0410-a7fc-ba219f786e1e --- ChangeLog | 6 ++++-- configure | 6 +++--- configure.in | 2 +- src/prtget.cpp | 17 +++++++++-------- src/prtget.h | 5 +++-- src/versioncomparator.cpp | 10 +++++++--- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 014852c..46b9884 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,12 @@ -* 0.5.14 00.00.200x Johannes Winkelmann +* 5.14 13.09.2006 Johannes Winkelmann - Remove handling of external dependency list - make InstallTransaction::getPkgDest use pkgmk.conf from install-root - revert getPkgDest to ignore install-root - determine PKGMK_PACKAGE_DIR using fgrep without sourcing pkgmk.conf +- fix bug in "undecided" output of diff (thanks treach) +- fix bug in version comperator introduced in 5.13 -* 0.5.13 08.09.2006 Johannes Winkelmann +* 5.13 08.09.2006 Johannes Winkelmann - Show undecided versions in diff and sysup when using "prefer higher" - fix display bug in "dependent" - fix bug in version comparator diff --git a/configure b/configure index 57de96f..a755b3f 100755 --- a/configure +++ b/configure @@ -742,7 +742,7 @@ pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' -mandir='${prefix}/man' +mandir='${datarootdir}/man' ac_prev= ac_dashdash= @@ -1245,7 +1245,7 @@ Fine tuning of the installation directories: --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [PREFIX/man] + --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] @@ -2023,7 +2023,7 @@ fi # Define the identity of the package. PACKAGE=prt-get - VERSION=5.13 + VERSION=5.14 cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in index 511ca7c..c26a9a4 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/prtget.cpp]) -AM_INIT_AUTOMAKE(prt-get,5.14pre) +AM_INIT_AUTOMAKE(prt-get,5.14) dnl Determine default prefix diff --git a/src/prtget.cpp b/src/prtget.cpp index 340a5f1..4537c26 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -835,8 +835,8 @@ void PrtGet::printQuickDiff() void PrtGet::printFormattedDiffLine(const string& name, - const string& version1, - const string& version2, + const string& versionInstalled, + const string& versionPortsTree, bool isLocked) { cout.setf( ios::left, ios::adjustfield ); @@ -846,7 +846,7 @@ void PrtGet::printFormattedDiffLine(const string& name, cout.width( 20 ); cout.fill( ' ' ); - cout << version1; + cout << versionInstalled; string locked = ""; if ( isLocked ) { @@ -854,7 +854,7 @@ void PrtGet::printFormattedDiffLine(const string& name, } cout.width( 20 ); cout.fill( ' ' ); - cout << version2 << locked << endl; + cout << versionPortsTree << locked << endl; } /*! print an overview of port which are installed in a different version @@ -931,7 +931,8 @@ void PrtGet::printDiff() } } - if (m_undefinedVersionComp.size()) { + if (m_undefinedVersionComp.size() && + (m_parser->all() || m_parser->verbose()) ) { cout << "\n\n" << "Undecidable version differences (use --strict-diff)" << endl << endl; printFormattedDiffLine("Port", @@ -946,8 +947,8 @@ void PrtGet::printDiff() for (; it != m_undefinedVersionComp.end(); ++it) { p = it->first; printFormattedDiffLine(p->name(), - p->versionReleaseString(), it->second, + p->versionReleaseString(), false); } } @@ -1101,9 +1102,9 @@ void PrtGet::evaluateResult( InstallTransaction& transaction, for ( ; uit != m_undefinedVersionComp.end(); ++uit ) { p = uit->first; cout << p->name() << " (" - << p->versionReleaseString() + << uit->second << " vs " - << uit->second << ")" << endl; + << p->versionReleaseString() << ")" << endl; } } diff --git a/src/prtget.h b/src/prtget.h index 70f7445..6a82975 100644 --- a/src/prtget.h +++ b/src/prtget.h @@ -45,7 +45,7 @@ public: PG_INSTALL_ERROR, PG_PARTIAL_INSTALL_ERROR }; - + PrtGet( const ArgParser* parser ); ~PrtGet(); @@ -117,7 +117,7 @@ protected: list& target ); void warnPackageNotFound(InstallTransaction& transaction); - + static void printFormattedDiffLine(const string& name, const string& version1, const string& version2, @@ -155,6 +155,7 @@ protected: compareVersions( const string& v1, const string& v2 ); static bool printFile(const string& file); + // map package from ports tree to version currently installed std::list< std::pair > m_undefinedVersionComp; }; diff --git a/src/versioncomparator.cpp b/src/versioncomparator.cpp index ce808a5..42f39fb 100644 --- a/src/versioncomparator.cpp +++ b/src/versioncomparator.cpp @@ -69,17 +69,17 @@ COMP_RESULT compareVersions(const string& v1, const string& v2) for (int k = 0; k < subTokLen; ++k) { long sl1 = strtol(subtokens1[k].c_str(), &error1, 10); long sl2 = strtol(subtokens2[k].c_str(), &error2, 10); - if (!error1 && !error2) { + if (*error1 == 0 && *error2 == 0) { if (sl1 < sl2) { return LESS; } else if (sl1 > sl2) { return GREATER; } } else { - + // string tokens if (subtokens1[k][1] == 0 && subtokens2[k][1] == 0) { - + if (subtokens1[k][0] < subtokens2[k][0]) { return LESS; } else if (subtokens1[k][0] > subtokens2[k][0]) { @@ -246,6 +246,10 @@ int main(int argc, char** argv) check("1.4.2beta3", "1.4.2alpha2", GREATER); check("1.4.2-some", "1.4.2-1", UNDEFINED); check("1.4.2-1", "1.4.2-some", UNDEFINED); + + check("7.0r63-3", "7.0r68-1", LESS); + check("27", "28e", LESS); + } else { check(argv[1], argv[2], UNDEFINED, false); }