Author: jw Date: 2006-09-10 20:22:31 +0200 (Sun, 10 Sep 2006) New Revision: 1862 Modified: tools/prt-get/trunk/src/installtransaction.cpp tools/prt-get/trunk/src/installtransaction.h Log: prt-get: use correct pkgmk.conf for PKGMK_PACKAGE_DIR (thanks Anton) Modified: tools/prt-get/trunk/src/installtransaction.cpp =================================================================== --- tools/prt-get/trunk/src/installtransaction.cpp 2006-09-10 17:16:39 UTC (rev 1861) +++ tools/prt-get/trunk/src/installtransaction.cpp 2006-09-10 18:22:31 UTC (rev 1862) @@ -246,7 +246,7 @@ if ( fdlog == -1 ) { return LOG_FILE_FAILURE; } - + write( fdlog, message.c_str(), message.length()); write( fdlog, "\n", 1); @@ -291,7 +291,7 @@ result = PKGMK_FAILURE; } else { // -- update - string pkgdest = getPkgDest(); + string pkgdest = getPkgDest(parser->installRoot()); if ( pkgdest != "" ) { // TODO: don't manipulate pkgdir pkgdir = pkgdest; @@ -582,10 +582,12 @@ return SUCCESS; } -string InstallTransaction::getPkgDest() +string InstallTransaction::getPkgDest(const string& installRoot) { string pkgdest = ""; - FILE* p = popen( ". /etc/pkgmk.conf && echo $PKGMK_PACKAGE_DIR", "r" ); + string cmd = ". %s/etc/pkgmk.conf && echo $PKGMK_PACKAGE_DIR"; + StringHelper::replaceAll(cmd, "%s", installRoot); + FILE* p = popen(cmd.c_str(), "r"); if ( p ) { char line[256]; fgets( line, 256, p ); Modified: tools/prt-get/trunk/src/installtransaction.h =================================================================== --- tools/prt-get/trunk/src/installtransaction.h 2006-09-10 17:16:39 UTC (rev 1861) +++ tools/prt-get/trunk/src/installtransaction.h 2006-09-10 18:22:31 UTC (rev 1862) @@ -103,7 +103,7 @@ bool update, InstallInfo& info ) const; - static string getPkgDest(); + static string getPkgDest(const string& installRoot); PkgDB* m_pkgDB; DepResolver m_resolver;
participants (1)
-
crux@crux.nu