Skip to content

Commit

Permalink
Merge pull request #138 from larchunix/libalpm-11.0.0
Browse files Browse the repository at this point in the history
Add support for new functions of libalpm 11.0.0
  • Loading branch information
f2404 authored May 31, 2018
2 parents 3addf91 + 501f1f1 commit 59133b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AC_CHECK_HEADERS([ctype.h getopt.h glob.h libintl.h limits.h locale.h regex.h si

AC_CHECK_LIB([alpm], [alpm_version], ,
AC_MSG_ERROR([pacman is needed to compile package-query]))
PKG_CHECK_MODULES([alpm], [libalpm >= 10.0.0])
PKG_CHECK_MODULES([alpm], [libalpm >= 11.0.0])

AC_CHECK_LIB([yajl], [yajl_free], ,
AC_MSG_ERROR([yajl is needed to compile package-query]))
Expand Down
4 changes: 2 additions & 2 deletions doc/package-query.8
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Format can contain:
%a: architecture
%b: base package
%B: backups file
%c: check dependencies (AUR)
%c: check dependencies (AUR and local package tarball)
%C: conflicts with
%d: description
%D: depends on
Expand All @@ -263,7 +263,7 @@ Format can contain:
%l: local version
%L: last submission (AUR)
%m: maintainer or packager
%M: make dependencies (AUR)
%M: make dependencies (AUR and local package tarball)
%n: name
%N: required by (Needed by)
%o: out of date (1 for true)
Expand Down
14 changes: 14 additions & 0 deletions src/alpm-query.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,13 @@ const char *alpm_pkg_get_str (const void *p, unsigned char c)
info = concat_backup_list (alpm_pkg_get_backup (pkg));
free_info = true;
break;
case 'c':
if (alpm_pkg_get_origin (pkg) != ALPM_PKG_FROM_FILE) {
return NULL;
}
info = concat_dep_list (alpm_pkg_get_checkdepends (pkg));
free_info = true;
break;
case 'C':
info = concat_dep_list (alpm_pkg_get_conflicts (pkg));
free_info = true;
Expand Down Expand Up @@ -588,6 +595,13 @@ const char *alpm_pkg_get_str (const void *p, unsigned char c)
case 'm':
info = (char *) alpm_pkg_get_packager (pkg);
break;
case 'M':
if (alpm_pkg_get_origin (pkg) != ALPM_PKG_FROM_FILE) {
return NULL;
}
info = concat_dep_list (alpm_pkg_get_makedepends (pkg));
free_info = true;
break;
case 'n':
info = (char *) alpm_pkg_get_name (pkg);
break;
Expand Down

0 comments on commit 59133b5

Please sign in to comment.