summaryrefslogtreecommitdiffstats
path: root/debian/move_links_to_correct_package
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:40:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:40:17 +0000
commitf989b53289cd1370b64ab3a11dc49582601141c4 (patch)
tree889d592e33bad65a274746ad6c925a69ff19c30c /debian/move_links_to_correct_package
parentAdding upstream version 6.05.01. (diff)
downloadmanpages-f989b53289cd1370b64ab3a11dc49582601141c4.tar.xz
manpages-f989b53289cd1370b64ab3a11dc49582601141c4.zip
Adding debian version 6.05.01-1.debian/6.05.01-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/move_links_to_correct_package')
-rw-r--r--debian/move_links_to_correct_package77
1 files changed, 77 insertions, 0 deletions
diff --git a/debian/move_links_to_correct_package b/debian/move_links_to_correct_package
new file mode 100644
index 0000000..1503f48
--- /dev/null
+++ b/debian/move_links_to_correct_package
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# In order to not ship broken symlinks, every manpage needs
+# to be checked for a link. If there is a link, ensure
+# that the destination file exists in the Debian
+# package. See bug #876047 for an example.
+
+# Ensure that the given file is alread handled.
+# After the necessery Breaks/Replaces are added
+# to debian/control, the file needs to be added
+# manually to the list of known files.
+check_breaks_replaces () {
+ known_files="
+ man3/queue.3
+ man3/stpecpy.3
+ man3/stpecpyx.3
+ man3/ustpcpy.3
+ man3/ustr2stp.3
+ man3/zustr2stp.3
+ man3/zustr2ustp.3
+ man4/console_ioctl.4
+ man4/tty_ioctl.4
+ man3type/epoll_data.3type
+ man3type/epoll_data_t.3type
+ man3type/sigset_t.3type
+ man3type/sigevent.3type
+ man3type/sigval.3type
+ man3type/siginfo_t.3type
+ man3/const/EXIT_FAILURE.3const"
+ file_is_known="no"
+ for file in $known_files; do
+ if [ "x$1" = "x$file" ]; then
+ file_is_known="yes"
+ fi
+ done
+ if [ $file_is_known = "no" ]; then
+ echo
+ echo "Error: The file $1 is not in the list of known files."
+ echo "Probably you need to add Breaks/Replaces for the packages."
+ echo "Afterwards, please add the file to the list of known files."
+ echo
+ exit 1
+ fi
+}
+
+for src_section in man*; do
+ #echo "$orig_section **********************************************************************************************************************"
+ src_section_strip=$(echo $src_section | cut -c 1-4)
+ for file in $src_section/*; do
+ destination=`grep "^\.so " $file`
+ file_strip=$(echo $file | xargs basename)
+ if [ -n "$destination" ]; then
+ dest_section=`echo "$destination" | sed -e "s/.*\(man.\).*/\1/"`
+ if [ "$dest_section" != "$src_section" ]; then
+ # The destination is in the package manpages
+ if [ "$dest_section" != "man2" -a "$dest_section" != "man3" -a "$dest_section" != "man3type" -a "$dest_section" != "man3const" -a "$dest_section" != "man3head" ]; then
+ # Ensure the source link is not in package manpages-dev
+ if [ "$src_section" = "man2" -o "$src_section" = "man3" -o "$src_section" = "man3type" -o "$src_section" = "man3const" -o "$src_section" = "man3head" ]; then
+ echo "Moving $file to package manpages."
+ mkdir -p "debian/manpages/usr/share/man/$src_section_strip"
+ mv "debian/manpages-dev/usr/share/man/$src_section_strip/$file_strip" "debian/manpages/usr/share/man/$src_section_strip/$file_strip"
+ check_breaks_replaces "$file"
+ fi
+ else
+ # The destination is in the package manpages-dev
+ # Ensure the source link is not in package manpages
+ if [ "$src_section" != "man2" -a "$src_section" != "man3" -a "$src_section" != "man3type" -a "$src_section" != "man3const" -a "$src_section" != "man3head" ]; then
+ echo "Moving $file to package manpages-dev."
+ mkdir -p "debian/manpages-dev/usr/share/man/$src_section_strip"
+ mv "debian/manpages/usr/share/man/$src_section_strip/$file_strip" "debian/manpages-dev/usr/share/man/$src_section_strip/$file_strip"
+ check_breaks_replaces "$file"
+ fi
+ fi
+ fi
+ fi
+ done
+done