about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rellns-sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/rellns-sh b/scripts/rellns-sh
index 0e861b5fa5..9a1496a9fd 100755
--- a/scripts/rellns-sh
+++ b/scripts/rellns-sh
@@ -16,8 +16,17 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
+# With -p, instead of creating the link print the computed relative link
+# name.
+do_print=false
+case $1 in
+  -p)
+    do_print=true
+    shift
+    ;;
+esac
 if test $# -ne 2; then
-  echo "Usage: rellns SOURCE DEST" >&2
+  echo "Usage: rellns [-p] SOURCE DEST" >&2
   exit 1
 fi
 
@@ -70,4 +79,8 @@ while test -n "$from"; do
   from=`echo $from | sed 's%^[^/]*/*%%'`
 done
 
-ln -s $rfrom$to $2
+if $do_print; then
+  echo "$rfrom$to"
+else
+  ln -s $rfrom$to $2
+fi