Skip to content

Instantly share code, notes, and snippets.

@Gottox
Created March 24, 2014 00:54
Show Gist options
  • Save Gottox/9732362 to your computer and use it in GitHub Desktop.
Save Gottox/9732362 to your computer and use it in GitHub Desktop.
# This hook checks for sobumps and warns the user if there are any
hook() {
local filename= rev= libname= conflictPkg= conflictFile= conflictRev= \
mapshlibs=$XBPS_COMMONDIR/shlibs
find $DESTDIR -name '*.so.*' -type f | while read filename; do
rev=${filename#*.so.}
libname=`basename ${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: old: $conflictRev new: $rev\n"
done
done
if [ "$XBPS_SOBUMP_FATAL" -a "$conflictPkg" ]; then
return 1;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment