neon/replace_manpage_with_links.sh
Adam Majer 989cd53bd5 - Install license
- replace_manpage_with_links.sh: replace named links with symlinks
  and stop using fdupes as it just linked linked manpages

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/neon?expand=0&rev=43
2018-03-20 09:27:04 +00:00

19 lines
366 B
Bash

#!/bin/bash
# Is this just a linked manpage?
echo "Processing $1"
grep '^\.so man\([0-7]\?\)/.*\1$' "$1" || exit 0
# extract target name
TARGET=`sed -e 's/^\.so man\([0-7]\?\)\///' "$1"`
MANDIR=`dirname "$1"`
# verify that target exists
[ -e "$MANDIR"/"$TARGET" ] || exit 1
# replace manpage reload with symlink
echo " -> $TARGET"
rm "$1"
ln -s $TARGET "$1"