Skip to content

Instantly share code, notes, and snippets.

@Gottox
Created March 24, 2014 08:28
Show Gist options
  • Save Gottox/9736341 to your computer and use it in GitHub Desktop.
Save Gottox/9736341 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..a747e95 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= found= mapshlibs=$XBPS_COMMONDIR/shlibs
for f in bin sbin lib lib32; do
if [ -d ${PKGDESTDIR}/${f} ]; then
@@ -18,4 +19,27 @@ 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
+ if [ -f "${PKGDESTDIR}/shlib-provides" ]; then
+ for filename in `cat "${PKGDESTDIR}/shlib-provides"`; do
+ rev=${filename#*.so.}
+ libname=${filename%.so.*}
+ grep -E "^${libname}\.so\.[0-9.]*[[:blank:]]+${pkgname}-[^-]+_[0-9]+$" $mapshlibs | { \
+ while read conflictFile conflictPkg; do
+ found=1
+ conflictRev=${conflictFile#*.so.}
+ [ "$rev" = "$conflictRev" ] || \
+ [[ "$rev".* =~ "$conflictRev" ]] && \
+ :
+ #continue
+
+ msg_error "SOBUMP: ${libname}.so: old: $conflictRev new: $rev\n"
+ done
+ if [ -z "$found" ]; then
+ msg_error "${libname}.so.$rev not found in shlibs. Please add it."
+ fi;
+ }
+ done
+ fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment