diff --git a/scripts/checkcves.py b/scripts/checkcves.py index 5910cf6..de8e9ab 100755 --- a/scripts/checkcves.py +++ b/scripts/checkcves.py @@ -3,12 +3,7 @@ import os import sys -# need to add our lib folder to import path -bindir = os.path.dirname(os.path.abspath(__file__)) -topdir = os.path.dirname(bindir) -sys.path.insert(1, os.path.join(topdir, 'lib')) - -import llapi +from lib import llapi NVD_BASE_URL = 'https://nvd.nist.gov/vuln/detail/' diff --git a/lib/.gitignore b/scripts/lib/.gitignore similarity index 100% rename from lib/.gitignore rename to scripts/lib/.gitignore diff --git a/lib/__init__.py b/scripts/lib/__init__.py similarity index 100% rename from lib/__init__.py rename to scripts/lib/__init__.py diff --git a/lib/backport.py b/scripts/lib/backport.py similarity index 100% rename from lib/backport.py rename to scripts/lib/backport.py diff --git a/lib/llapi.py b/scripts/lib/llapi.py similarity index 100% rename from lib/llapi.py rename to scripts/lib/llapi.py diff --git a/scripts/manifest.py b/scripts/lib/manifest.py similarity index 96% rename from scripts/manifest.py rename to scripts/lib/manifest.py index b86e0f4..fe45e05 100755 --- a/scripts/manifest.py +++ b/scripts/lib/manifest.py @@ -13,10 +13,7 @@ target = sys.argv[2] ofile = sys.argv[3] -# add bitbake's lib and our layer's lib folders to import path -bindir = os.path.dirname(__file__) -topdir = os.path.dirname(bindir) -sys.path[0:0] = [os.path.join(broot, 'lib'), os.path.join(topdir, 'lib')] +sys.path.insert(0, os.path.join(broot, 'lib')) import bb import bb.tinfoil diff --git a/lib/utils.py b/scripts/lib/utils.py similarity index 100% rename from lib/utils.py rename to scripts/lib/utils.py diff --git a/scripts/manifest.sh b/scripts/manifest.sh index e7e8972..886dadf 100755 --- a/scripts/manifest.sh +++ b/scripts/manifest.sh @@ -22,8 +22,8 @@ if [ -z "${BITBAKE}" ]; then exit 1 fi -BBLIBDIR=$(readlink -f $(dirname ${BITBAKE})/..) -MANIFEST_PY=$(dirname $0)/manifest.py +BBLIBDIR=$(readlink -f "$(dirname "${BITBAKE}")/..") +MANIFEST_PY=$(dirname "$(readlink -f "$0")")/lib/manifest.py echo "Running manifest script. This takes some time using bitbake: ${BBLIBDIR}" ${MANIFEST_PY} ${BBLIBDIR} $@