diff --git a/Makefile b/Makefile index 14c400e..1cd68f7 100644 --- a/Makefile +++ b/Makefile @@ -28,3 +28,5 @@ install: install -m 0755 sabayon-buildpackages $(DESTDIR)/$(UBINDIR)/ install -m 0755 sabayon-createrepo $(DESTDIR)/$(UBINDIR)/ install -m 0755 sabayon-entropypreservedlibs $(DESTDIR)/$(UBINDIR)/ + install -m 0755 sabayon-brokenlibs $(DESTDIR)/$(UBINDIR)/ + install -m 0755 sabayon-bz2brokenlibs $(DESTDIR)/$(UBINDIR)/ diff --git a/sabayon-brokenlibs b/sabayon-brokenlibs new file mode 100755 index 0000000..3822446 --- /dev/null +++ b/sabayon-brokenlibs @@ -0,0 +1,26 @@ +#!/bin/bash + +PACKAGES=() +bin=$1 + +. /sbin/sabayondevkit-functions.sh + +[ -z "$bin" ] && die "No Arg given" + +# Getting linked libraries +for i in $(ldd $1 | cut -d \( -f1 | cut -d \> -f2 | grep "/" | xargs echo) +do + package=$(equo q belongs -q $i) + [ -z "$package" ] && die "borked: $i" + PACKAGES+=($package) +done + +# Unique and ordered +U_PACKAGES=$(echo "${PACKAGES[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ') + +if [ "${#PACKAGES}" -ne 0 ]; then + for i in ${U_PACKAGES[@]} + do + echo " $i" + done +fi diff --git a/sabayon-bz2brokenlibs b/sabayon-bz2brokenlibs new file mode 100755 index 0000000..aaf9f58 --- /dev/null +++ b/sabayon-bz2brokenlibs @@ -0,0 +1,26 @@ +#!/bin/bash + +. /sbin/sabayondevkit-functions.sh + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# the temp directory used, within $DIR +WORK_DIR=`mktemp -d -p "$DIR"` + +# deletes the temp directory +function cleanup { + rm -rf "$WORK_DIR" +} + +# register the cleanup function to be called on the EXIT signal +trap cleanup EXIT + +tbz=$1 + +[ -z "$tbz" ] && die "No Arg given" + +tar xjf "$tbz" -C "$WORK_DIR" + +for file in $(find "$WORK_DIR" | xargs echo) +do + [ -f "$file" ] && /usr/bin/sabayon-brokenlibs "$file" +done diff --git a/sabayondevkit-functions.sh b/sabayondevkit-functions.sh index 3fad52e..608eeca 100644 --- a/sabayondevkit-functions.sh +++ b/sabayondevkit-functions.sh @@ -7,6 +7,8 @@ check_docker_requirements(){ ps aux | grep -q '[d]ocker' || echo "--> Be sure to have the docker daemon running (sudo systemctl start docker) of configure it to run on boot (sudo systemctl enable docker). Trying to start it anyway" && sudo systemctl start docker } +die() { echo "$@" 1>&2 ; exit 1; } + build() { local SEARCH=$1 local EMERGE_DEFAULT_ARGS=${2:---accept-properties=-interactive --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg}