From 56bf58f274a46a66ac5b4fa3b8a9762e417ea962 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 7 Feb 2012 16:33:32 +0100 Subject: [PATCH] pkg:debsrc: write identical build dependency list to dsc/control file --- priv/templates/deb/control | 2 +- priv/templates/deb_erlrc/control | 2 +- priv/templates/deb_src/control | 4 ++-- src/tetrapak_task_pkg_deb.erl | 10 ++++------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/priv/templates/deb/control b/priv/templates/deb/control index e51de1f..cf9a431 100644 --- a/priv/templates/deb/control +++ b/priv/templates/deb/control @@ -4,6 +4,6 @@ Architecture: @@arch@@ Section: @@section@@ Priority: @@priority@@ Maintainer: @@maintainer@@ -Depends: erlang-base|erlang-base-hipe @@appdeps@@ +Depends: @@appdeps@@ Description: @@desc@@ Auto-generated package, no long description. diff --git a/priv/templates/deb_erlrc/control b/priv/templates/deb_erlrc/control index 96bf0dd..68e3b06 100644 --- a/priv/templates/deb_erlrc/control +++ b/priv/templates/deb_erlrc/control @@ -4,7 +4,7 @@ Architecture: @@arch@@ Section: @@section@@ Priority: @@priority@@ Maintainer: @@maintainer@@ -Depends: erlang-base|erlang-base-hipe, erlang-erlrc (>= 0.2.5) @@appdeps@@ +Depends: erlang-erlrc (>= 0.2.5), @@appdeps@@ Conflicts: erlang-erlrc (>= 0.3) Description: @@desc@@ Auto-generated package, no long description. diff --git a/priv/templates/deb_src/control b/priv/templates/deb_src/control index f1f4787..4994471 100644 --- a/priv/templates/deb_src/control +++ b/priv/templates/deb_src/control @@ -3,11 +3,11 @@ Maintainer: @@maintainer@@ Standards-Version: 3.9.1 Priority: @@priority@@ Section: @@section@@ -Build-Depends: erlang-base|erlang-base-hipe, erlang-tetrapak (>= 0.3.0) +Build-Depends: @builddeps@ Package: @@name@@ Architecture: any Priority: @@priority@@ Section: @@section@@ -Depends: erlang-base|erlang-base-hipe @@appdeps@@ +Depends: @@appdeps@@ Description: @@desc@@ diff --git a/src/tetrapak_task_pkg_deb.erl b/src/tetrapak_task_pkg_deb.erl index eaf7be2..3b7b61b 100644 --- a/src/tetrapak_task_pkg_deb.erl +++ b/src/tetrapak_task_pkg_deb.erl @@ -179,7 +179,8 @@ in_dir(Dir, Path) -> debian_deps() -> AppDeps = tetrapak:get("config:appfile:deps") ++ tetrapak:config("package.extra_apps", []), OtherDeps = tetrapak:config("package.deb.dependencies", []), - lists:usort(OtherDeps ++ [no_underscores(tpk_util:f("erlang-~s", [S])) || S <- AppDeps, not in_erlang_base(S)]). + lists:usort(["erlang-base|erlang-base-hipe"] + ++ OtherDeps ++ [no_underscores(tpk_util:f("erlang-~s", [S])) || S <- AppDeps, not in_erlang_base(S)]). debian_build_deps() -> DebianDeps = debian_deps(), @@ -218,10 +219,6 @@ copy_files(Tarball, InstallDir, IsExcludedFunction) -> copy_control_template(Tarball, Template, ExtractDir, Variables) -> Pkg = "erlang-" ++ no_underscores(atom_to_list(tetrapak:get("config:appfile:name"))), - case debian_deps() of - [] -> DepString = ""; - Deps -> DepString = ", " ++ string:join(Deps, ", ") - end, FileOptions = [{mode, 8#0744}, {owner, "root"}, {group, "root"}], TemplateDir = filename:join([code:priv_dir(tetrapak), "templates", Template]), tpk_file:walk(fun (CFile, _) -> @@ -237,7 +234,8 @@ copy_control_template(Tarball, Template, ExtractDir, Variables) -> {"version", tetrapak:get("config:appfile:vsn")}, {"arch", tetrapak:config("package.architecture")}, {"appname", tetrapak:get("config:appfile:name")}, - {"appdeps", DepString}, + {"appdeps", string:join(debian_deps(), ", ")}, + {"builddeps", string:join(debian_build_deps(), ", ")}, {"section", tetrapak:config("package.deb.section")}, {"priority", tetrapak:config("package.deb.priority")}, {"maintainer", tetrapak:config("package.maintainer")},