Add support for a QA_PREBUILT variable should contain a list of
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 13:24:50 +0000 (06:24 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 13:24:50 +0000 (06:24 -0700)
pre-built binaries. Paths listed here will be appended to each of
the other QA_* variables. Thanks to Diego Pettenò <flameeyes@g.o>
for the suggestion.

bin/ebuild.sh
man/ebuild.5

index de3c80bef30ac118c2e822147c7213a46880514f..2fbd612bd2c1a74018f316120ea1473e5c23310f 100755 (executable)
@@ -1995,6 +1995,26 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
                        fi
                fi
 
+               if [[ -n $QA_PREBUILT ]] ; then
+
+                       # these ones support fnmatch patterns
+                       QA_EXECSTAC+=" $QA_PREBUILT"
+                       QA_TEXTRELS+=" $QA_PREBUILT"
+                       QA_WX_LOAD+=" $QA_PREBUILT"
+
+                       # these ones support regular expressions, so translate
+                       # fnmatch patterns to regular expressions
+                       for x in QA_DT_HASH QA_DT_NEEDED QA_PRESTRIPPED QA_SONAME ; do
+                               if [[ $(declare -p $x 2>/dev/null) = declare\ -a* ]] ; then
+                                       eval "$x=(\${$x[@]} ${QA_PREBUILT//\*/.*})"
+                               else
+                                       eval "$x+=\" ${QA_PREBUILT//\*/.*}\""
+                               fi
+                       done
+
+                       unset x
+               fi
+
                # This needs to be exported since prepstrip is a separate shell script.
                [[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
                eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && export QA_PRESTRIPPED_${ARCH/-/_}"
index 8fa32e23ffa18e931f04806787a0c062b52b8902..d9d3943093a1e3e8a6186cd120e36192e7970780 100644 (file)
@@ -496,6 +496,16 @@ binary objects that cannot be altered.
 .br
 Note that objects that violate these rules may fail on some architectures.
 .TP
+\fBQA_PREBUILT\fR
+This should contain a list of file paths, relative to the image
+directory, of files that are pre\-built binaries. Paths
+listed here will be appended to each of the QA_* variables
+listed below. The paths may contain fnmatch\-like patterns
+which will be internally translated to regular expressions for
+the QA_* variables that support regular expressions instead
+of fnmatch patterns. The translation mechanism simply replaces
+'*' with '.*'.
+.TP
 \fBQA_TEXTRELS\fR
 This variable can be set to a list of file paths, relative to the image
 directory, of files that contain text relocations that cannot be eliminated.