Skip to content

Commit

Permalink
beeversion: Add prefix char to print formatted extraname and extraver…
Browse files Browse the repository at this point in the history
…sion

To prefix extraname and extraversion just add the prefix char before
e or x in the formatstring: e.g.

pkg_subname-1.0_extra1-0

%-e =>  -extra1
%_e =>  _extra1

%-x =>  -subname
%_x =>  _subname

This is only supposed to be used with '-' or '_' even if you may use other
chars here. But the behavior may change in future version. Only '_' and '-'
are stable for the moment.
  • Loading branch information
mariux committed Jun 4, 2012
1 parent 6b02ed3 commit 351ca9a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/bee_version_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ void print_format(char* s, struct beeversion *v, char *filter_pkgfullname)
printf(".%s", v->arch);
break;
}
if (*p) {
switch(*(p+1)) {
case 'x':
if (*(v->subname))
printf("%c%s", *p, v->subname);
p++;
continue;
case 'e':
if (*(v->extraversion))
printf("%c%s", *p, v->extraversion);
p++;
continue;
}
}
continue;
} /* if '%' */

Expand Down

0 comments on commit 351ca9a

Please sign in to comment.