diff --git a/hooks/prebuild/debian/complete-project-db b/hooks/prebuild/debian/complete-project-db new file mode 100755 index 0000000..c86ef37 --- /dev/null +++ b/hooks/prebuild/debian/complete-project-db @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +cd src + +if [ -z "$(tamarin_db get project_name)" ]; then + if [ ! -d ".git" ]; then + tamarin_error "This project is not managed with Git ! Cannot extract the project's name without it !" + exit 1 + fi + project_name=$(basename $(git config --get remote.origin.url) | sed 's/.git$//' | tr '[:upper:]' '[:lower:]') + tamarin_info "Extracted project name from Git metadata: \"${project_name}\"" + tamarin_db set project_name "${project_name}" +fi diff --git a/lib/install.sh b/lib/install.sh deleted file mode 100644 index 78a5112..0000000 --- a/lib/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source "${DIR}/util.sh" - -info "Updating packages definition..." -apt-get update 2> >(stderr) 1> >(stdout) - -info "Installing package $1..." -gdebi --n "$1" 2> >(stderr) 1> >(stdout) diff --git a/profiles/debian.conf b/profiles/debian.conf index cc33185..f9afe98 100644 --- a/profiles/debian.conf +++ b/profiles/debian.conf @@ -12,6 +12,7 @@ hooks=containerbuild/debian/install-build-essential, [prebuild] hooks=prebuild/debian/load-project-db, prebuild/debian/copy-sources-to-workspace, + prebuild/debian/complete-project-db, prebuild/debian/create-changelog, prebuild/debian/create-dummy-changelog, prebuild/debian/add-package-version-suffix,