xbps-checkvers: add %t format to get requested template name from path (ie subpackage)
This commit is contained in:
parent
db2eb29cbc
commit
dfa6e80d13
@ -635,6 +635,7 @@ static void
|
||||
rcv_printf(rcv_t *rcv, FILE *fp, const char *pkgname, const char *repover,
|
||||
const char *srcver)
|
||||
{
|
||||
char tmpl[128], *p;
|
||||
const char *f;
|
||||
|
||||
for (f = rcv->format; *f; f++) {
|
||||
@ -659,6 +660,12 @@ rcv_printf(rcv_t *rcv, FILE *fp, const char *pkgname, const char *repover,
|
||||
case 'n': fputs(pkgname, fp); break;
|
||||
case 'r': fputs(repover, fp); break;
|
||||
case 's': fputs(srcver, fp); break;
|
||||
case 't':
|
||||
xbps_strlcpy(tmpl, rcv->fname, sizeof tmpl);
|
||||
if ((p = strchr(tmpl, '/')))
|
||||
*p = '\0';
|
||||
fputs(tmpl, fp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fputc('\n', fp);
|
||||
|
@ -56,6 +56,8 @@ The package name.
|
||||
The repository version.
|
||||
.It Cm \&%s
|
||||
The source package version.
|
||||
.It Cm \&%t
|
||||
The requested template name (this can be a sub package).
|
||||
.El
|
||||
.Pp
|
||||
The default format is
|
||||
|
Loading…
Reference in New Issue
Block a user