Warn on absolute symlinks at build-time

While supported of course, absolute symlinks are nasty in many ways
so issue a warning to packagers. Update two affected test-cases.
Related to #668.

(cherry picked from rpm.org commit 8359ded6784579b9f2527a09888132034783e1de)
This commit is contained in:
Panu Matilainen 2019-04-24 14:54:00 +03:00 committed by Dmitry V. Levin
parent 7dba4f2bba
commit 5f7fe6577f

View File

@ -1191,6 +1191,10 @@ static void genCpioListAndHeader(Spec spec, /*@partial@*/ FileList fl,
fl->processingFailed = 1;
} else {
buf[llen] = '\0';
if (buf[0] == '/') {
rpmlog(RPMLOG_WARNING, _("absolute symlink: %s -> %s\n"),
flp->diskURL, buf);
}
if (fl->buildRootURL) {
const char * buildRoot;
(void) urlPath(fl->buildRootURL, &buildRoot);