Skip to content

Commit

Permalink
cards depends
Browse files Browse the repository at this point in the history
Need to search in both place for Pkgfiles in depot and in git
  • Loading branch information
tnut committed Mar 25, 2024
1 parent 896b2de commit 3bda7f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
22 changes: 14 additions & 8 deletions src/cards_depends.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// cards_depends.cxx
//
// Copyright (c) 2013 - 2023 by NuTyX team (http://nutyx.org)
// Copyright (c) 2013 - 2024 by NuTyX team (http://nutyx.org)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -138,7 +138,7 @@ std::vector<LevelName*>& CardsDepends::getLevel()

#ifndef NDEBUG
for ( auto i : m_levelList ) {
std::cerr << i.name<< std::endl;
std::cerr << i->name<< std::endl;
}
#endif
return m_levelList;
Expand Down Expand Up @@ -271,8 +271,10 @@ int CardsDepends::level()
if ( DU.url.size() > 0)
continue;
std::string prtDir = DU.dir;
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
if ( (findDir(m_filesList,basename(const_cast<char*>(prtDir.c_str())))) != 0) {
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
}
}
#ifndef NDEBUG
std::cerr << DU.dir << " " << DU.url << std::endl;
Expand Down Expand Up @@ -331,8 +333,10 @@ int CardsDepends::depends()

for ( auto DU : config.dirUrl() ) {
std::string prtDir = DU.dir;
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
if ( (findDir(m_filesList,basename(const_cast<char*>(prtDir.c_str())))) != 0) {
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
}
}
}
char * longPackageName = NULL;
Expand Down Expand Up @@ -409,8 +413,10 @@ int CardsDepends::deptree()

for ( auto DU : config.dirUrl() ) {
std::string prtDir = DU.dir;
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
if ( (findDir(m_filesList,basename(const_cast<char*>(prtDir.c_str())))) != 0) {
if ( (findDir(m_filesList,prtDir.c_str())) != 0) {
treatErrors(cards::ERROR_ENUM_CANNOT_READ_DIRECTORY,prtDir);
}
}
}
char* longPackageName = NULL;
Expand Down
14 changes: 11 additions & 3 deletions src/pkgrepo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// pkgrepo.cxx
//
// Copyright (c) 2002 - 2005 by Johannes Winkelmann jw at tks6 dot net
// Copyright (c) 2014 - 2023 by NuTyX team (http://nutyx.org)
// Copyright (c) 2014 - 2024 by NuTyX team (http://nutyx.org)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -604,8 +604,16 @@ std::string Pkgrepo::getPortDir (const std::string& portName)
for (auto j : i.basePackageList) {
if ( j.basePackageName == portName ) {
portDir = i.dir + "/" + j.basePackageName;
found = true;
break;
if (checkFileExist(portDir + "/Pkgfile")) {
found = true;
break;
}
portDir = basename(const_cast<char*>(i.dir.c_str()));
portDir += "/" + j.basePackageName;
if (checkFileExist(portDir + "/Pkgfile")) {
found = true;
break;
}
}
}
if (found)
Expand Down

0 comments on commit 3bda7f1

Please sign in to comment.