prt-get: use correct pkgmk.conf for PKGMK_PACKAGE_DIR (thanks Anton)

git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1862 0b5ae1c7-2405-0410-a7fc-ba219f786e1e
This commit is contained in:
Johannes Winkelmann 2006-09-10 18:22:31 +00:00
parent 205624c78b
commit 9ca92fa2cd
2 changed files with 7 additions and 5 deletions

View File

@ -246,7 +246,7 @@ InstallTransaction::installPackage( const Package* package,
if ( fdlog == -1 ) {
return LOG_FILE_FAILURE;
}
write( fdlog, message.c_str(), message.length());
write( fdlog, "\n", 1);
@ -291,7 +291,7 @@ InstallTransaction::installPackage( const Package* package,
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 @@ InstallTransaction::calcDependencies( )
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 );

View File

@ -103,7 +103,7 @@ private:
bool update,
InstallInfo& info ) const;
static string getPkgDest();
static string getPkgDest(const string& installRoot);
PkgDB* m_pkgDB;
DepResolver m_resolver;