]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
validate that man links point to something resolveable
authorElan Ruusamäe <glen@delfi.ee>
Mon, 4 Mar 2013 23:05:40 +0000 (01:05 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 4 Mar 2013 23:05:40 +0000 (01:05 +0200)
for now, links to "outside" current package are not allowed

rpm.macros

index d45501cf8be649a8a4847b1d34e355a8cb452c7c..d7063b002428e69370eb247f27ce1813271ca039 100644 (file)
@@ -534,6 +534,14 @@ Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}
                                echo ".so $l" > $a; \
                                echo >&2 "Converted ${a#$RPM_BUILD_ROOT} from symlink to man link: $l"; \
                        done; \
+                       # verify that .so links point to existing files (not allowed to point to "other package")
+                       err=$(grep -rl '^\.so ' "$RPM_BUILD_ROOT$i" | while read doc; do \
+                               l=$(cat "$doc"); \
+                               l=${l#.so }; \
+                               # TODO: iterate over all man dirs, but in Th there's only one true man dir \
+                               test -e $RPM_BUILD_ROOT$i/$l || echo "  ${doc#$RPM_BUILD_ROOT} points to inexistent manpage: $l"; \
+                       done); \
+                       test "$err" != "" && { echo >&2 "Man page link errors:"; echo >&2 "$err"; exit 1; }; \
                        find "$RPM_BUILD_ROOT$i" -type f -size +%{_min_compress_bytes}c -print | xargs -r %{__gzip} -9nf; \
                fi; \
        done; \
This page took 0.034511 seconds and 4 git commands to generate.