mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Allow for case insensitive matching on the name of packages.
This mimics the behavior of 'pkg search', which performs a case insensitive search.
This commit is contained in:
@@ -231,6 +231,7 @@ while(found.isEmpty() && numtry<2){
|
||||
q_string = "SELECT origin FROM packages WHERE name = '"+searchterm+"' OR origin LIKE '%/"+searchterm+"'";
|
||||
if(!category.isEmpty()){ q_string.append(" AND origin LIKE '"+category+"/%'"); }
|
||||
if(!searchexcludes.isEmpty()){ q_string.append(" AND name NOT LIKE '%"+searchexcludes.join("%' AND name NOT LIKE '%")+"%'"); }
|
||||
q_string.append(" COLLATE NOCASE"); // Case insensitive
|
||||
QSqlQuery query(q_string, DB);
|
||||
while(query.next()){
|
||||
found << query.value("origin").toString(); //need the origin for later
|
||||
|
||||
Reference in New Issue
Block a user