Skip to content

Instantly share code, notes, and snippets.

@Gottox
Created March 24, 2014 07:40
Show Gist options
  • Save Gottox/9735753 to your computer and use it in GitHub Desktop.
Save Gottox/9735753 to your computer and use it in GitHub Desktop.
diff --git a/common/hooks/post-install/99-pkglint.sh b/common/hooks/post-install/99-pkglint.sh
index bee6a90..2b2d076 100644
--- a/common/hooks/post-install/99-pkglint.sh
+++ b/common/hooks/post-install/99-pkglint.sh
@@ -1,7 +1,8 @@
# This hook checks for common issues related to void.
hook() {
- local error=0
+ local error=0 filename= rev= libname= conflictPkg= conflictFile=
+ conflictRev= mapshlibs=$XBPS_COMMONDIR/shlibs
for f in bin sbin lib lib32; do
if [ -d ${PKGDESTDIR}/${f} ]; then
@@ -18,4 +19,18 @@ hook() {
if [ $error -gt 0 ]; then
msg_error "${pkgver}: cannot continue with installation!\n"
fi
+
+ # checks for sobumps and warns the user if there are any
+ for filename in `cat "${PKGDESTDIR}/shlib-provides"`; do
+ rev=${filename#*.so.}
+ libname=${filename%.so.*}
+ grep -E "^${libname}\.so\..*[[:blank:]]$pkgname" $mapshlibs | \
+ while read conflictFile conflictPkg; do
+ conflictRev=${conflictFile#*.so.}
+ [ "$rev" = "$conflictRev" ] || \
+ [[ "$rev".* =~ "$conflictRev" ]] && \
+ continue
+ msg_warn "SOBUMP: ${libname}.so: old: $conflictRev new: $rev\n"
+ done
+ done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment