xbps-src: added an optional arg to rshlibs, to make SONAME arch specific.

This commit is contained in:
Juan RP 2011-11-16 13:35:48 +01:00
parent 1f3cae43cf
commit 3be2a5f852
2 changed files with 18 additions and 7 deletions

View file

@ -154,7 +154,7 @@ verify_rundeps()
# #
# Update package's rshlibs file. # Update package's rshlibs file.
# #
unset broken unset broken f
msg_normal "$pkgver: updating rshlibs file...\n" msg_normal "$pkgver: updating rshlibs file...\n"
rsonamef=${XBPS_SRCPKGDIR}/${pkgname}/${pkgname}.rshlibs rsonamef=${XBPS_SRCPKGDIR}/${pkgname}/${pkgname}.rshlibs
if [ ! -f $rsonamef ]; then if [ ! -f $rsonamef ]; then
@ -173,12 +173,16 @@ verify_rundeps()
broken=1 broken=1
fi fi
done done
unset f
exec 3<&0 # save stdin exec 3<&0 # save stdin
exec < $rsonamef exec < $rsonamef
# now check if any soname in the rshlibs file is unnecessary. # now check if any soname in the rshlibs file is unnecessary.
while read f; do while read f; do
local _soname=$(echo "$f"|awk '{print $1}')
local _soname_arch=$(echo "$f"|awk '{print $2}')
for j in ${soname_list}; do for j in ${soname_list}; do
if [ "$f" = "$j" ]; then if [ "${_soname}" = "$j" ]; then
found=1 found=1
continue continue
fi fi
@ -187,15 +191,22 @@ verify_rundeps()
unset found unset found
continue continue
fi fi
# Sometimes a required SONAME is arch dependent, so
# ignore it in such case.
if [ -n "${_soname_arch}" -a "${_soname_arch}" != "$XBPS_MACHINE" ]; then
continue
fi
# If SONAME is arch specific, only remove it if # If SONAME is arch specific, only remove it if
# matching on the target arch. # matching on the target arch.
soname_arch=$(grep "$f" $maplib|awk '{print $4}') _soname_arch=$(grep "$f" $maplib|awk '{print $4}')
if [ -z "$soname_arch" ] || \ if [ -z "${_soname_arch}" ] || \
[ -n "$soname_arch" -a "$soname_arch" = "$XBPS_MACHINE" ]; then [ -n "${_soname_arch}" -a "${_soname_arch}" = "$XBPS_MACHINE" ]; then
echo " SONAME: $f (removed, not required)" echo " SONAME: $f (removed, not required)"
sed -i "/^${f}$/d" $rsonamef sed -i "/^${_soname}$/d" $rsonamef
broken=1 broken=1
fi fi
unset _soname _soname_arch
done done
exec 0<&3 # restore stdin exec 0<&3 # restore stdin
fi fi

View file

@ -23,7 +23,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#- #-
readonly XBPS_SRC_BUILD_VERSION=20111115-2 readonly XBPS_SRC_BUILD_VERSION=20111116
XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
PROGNAME=$(basename $0) PROGNAME=$(basename $0)