3 Commits

Author SHA1 Message Date
Tim Biermann
8bc31c0745 Fix segfault in prt-cache
Co-authored-by: Alexandr Savca <alexandr.savca89@gmail.com>
2022-02-27 22:30:23 +01:00
Juergen Daubert
da6bfb0a60 move prt-get.aliases to /etc, update version to 5.19.5 2020-10-16 10:27:37 +02:00
Matt Housh
ac030e3530 Added a regex fix for listinst, updated to version 5.19.4 2020-10-13 09:44:00 -05:00
4 changed files with 11 additions and 5 deletions

2
configure vendored
View File

@@ -2585,7 +2585,7 @@ fi
# Define the identity of the package.
PACKAGE=prt-get
VERSION=5.19.3
VERSION=5.19.5
cat >>confdefs.h <<_ACEOF

View File

@@ -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.19.3)
AM_INIT_AUTOMAKE(prt-get,5.19.5)
dnl Determine default prefix

View File

@@ -27,7 +27,7 @@ using namespace std;
const string PkgDB::PKGDB = "/var/lib/pkg/db";
const string PkgDB::ALIAS_STORE = LOCALSTATEDIR"/lib/pkg/prt-get.aliases";
const string PkgDB::ALIAS_STORE = SYSCONFDIR"/prt-get.aliases";
/*!
Create a PkgDB object

View File

@@ -524,7 +524,8 @@ void PrtGet::listInstalled()
{
assertMaxArgCount(1);
string arg = "*";
string arg = m_useRegex ? ".*" : "*";
if ( m_parser->otherArgs().size() == 1 ) {
arg = *(m_parser->otherArgs().begin());
}
@@ -1805,6 +1806,11 @@ void PrtGet::ls()
if ( p ) {
string dirname = p->path() + "/" + p->name();
DIR* dir = opendir(dirname.c_str());
if (dir == NULL) {
cerr << "Directory " << dirname << " not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}
struct dirent* entry;
vector<string> files;
while ((entry = readdir(dir))) {
@@ -1847,7 +1853,7 @@ void PrtGet::cat()
}
string file = p->path() + "/" + p->name() + "/" + fileName;
if (!printFile(file)) {
cerr << "File '" << *it << "' not found" << endl;
cerr << "File '" << fileName << "' not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}