From owner-svn-src-all@freebsd.org Fri Jun 26 23:55:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 895F898D1AE; Fri, 26 Jun 2015 23:55:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF711A9F; Fri, 26 Jun 2015 23:55:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5QNt3xb056999; Fri, 26 Jun 2015 23:55:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5QNt3Ii056998; Fri, 26 Jun 2015 23:55:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506262355.t5QNt3Ii056998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 26 Jun 2015 23:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284881 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 23:55:03 -0000 Author: bapt Date: Fri Jun 26 23:55:02 2015 New Revision: 284881 URL: https://svnweb.freebsd.org/changeset/base/284881 Log: 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 Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Fri Jun 26 21:35:36 2015 (r284880) +++ head/usr.bin/xinstall/xinstall.c Fri Jun 26 23:55:02 2015 (r284881) @@ -658,6 +658,14 @@ makelink(const char *from_name, const ch 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);