commit b012dc654b555d36b557416b2d78f3a98e5c22b9
Author: Elan Ruusamäe <[email protected]>
Date:   Tue Mar 5 01:05:40 2013 +0200

    validate that man links point to something resolveable
    
    for now, links to "outside" current package are not allowed

 rpm.macros | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/rpm.macros b/rpm.macros
index d45501c..d7063b0 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -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; \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/b012dc654b555d36b557416b2d78f3a98e5c22b9

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to