From 222b6c8940dfe32bd59d751a443c09f0b46daf08 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 21 Mar 2017 15:52:49 +0100 Subject: [PATCH] =?UTF-8?q?Utilisation=20du=20nom=20de=20paquet=20si=20le?= =?UTF-8?q?=20nom=20de=20projet=20diff=C3=A8re=20avec=20celui=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/01-fix-project-name-prebuild | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 hooks/01-fix-project-name-prebuild diff --git a/hooks/01-fix-project-name-prebuild b/hooks/01-fix-project-name-prebuild new file mode 100755 index 0000000..ff7411d --- /dev/null +++ b/hooks/01-fix-project-name-prebuild @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source "${TAMARIN_UTIL}" + +if [ ! -f debian/control ]; then + fatal "No debian/control file found !" +fi + +package_name=$(grep -E '^Package:' debian/control | awk '{ print $2 }') +project_name=$(get_opt project_name) + +if [ "${package_name}" != "${project_name}" ]; then + warn "The project's name '${project_name}' differs from the package one ('${package_name}'). Using package's one..." + set_opt project_name "${package_name}" + exit +fi