short circuit install -l rs

When requesting install(1) to only make relative symlinks, by pass all the
done to actually compute the relative symlink if the path given in argument is
already a relative path
This commit is contained in:
Baptiste Daroussin
2015-06-26 23:55:02 +00:00
parent 4b1222a215
commit 9ebcef9a74
+8
View File
@@ -658,6 +658,14 @@ makelink(const char *from_name, const char *to_name,
if (dolink & LN_RELATIVE) {
char *cp, *d, *s;
if (*from_name != '/') {
/* this is already a relative link */
do_symlink(from_name, to_name, target_sb);
/* XXX: from_name may point outside of destdir. */
metadata_log(to_name, "link", NULL, from_name, NULL, 0);
return;
}
/* Resolve pathnames. */
if (realpath(from_name, src) == NULL)
err(EX_OSERR, "%s: realpath", from_name);