Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add %o for optdepends without descriptions

  • Loading branch information...
commit da0fbab34f740b8f180e6608e6667f9ebda96859 1 parent d818184
@falconindy authored
Showing with 16 additions and 0 deletions.
  1. +2 −0  README.pod
  2. +14 −0 expac.c
View
2  README.pod
@@ -90,6 +90,8 @@ The format argument allows the following interpreted sequences:
%O optional deps
+ %o optional deps (no descriptions)
+
%P provides
%R replaces
View
14 expac.c
@@ -88,6 +88,17 @@ static char *strtrim(char *str) {
return str;
}
+char *trim_optdep(char *optdep) {
+ char *colon;
+
+ colon = strchr(optdep, ':');
+ if (colon) {
+ *colon = '\0';
+ }
+
+ return optdep;
+}
+
static int alpm_init(void) {
int ret = 0;
FILE *fp;
@@ -446,6 +457,9 @@ static int print_pkg(pmpkg_t *pkg, const char *format) {
case 'O': /* optdepends */
out += print_list(alpm_pkg_get_optdepends(pkg), NULL, shortdeps);
break;
+ case 'o': /* optdepends (shortdeps) */
+ out += print_list(alpm_pkg_get_optdepends(pkg), (extractfn)trim_optdep, shortdeps);
+ break;
case 'C': /* conflicts */
out += print_list(alpm_pkg_get_conflicts(pkg), NULL, shortdeps);
break;
Please sign in to comment.
Something went wrong with that request. Please try again.