Skip to content

Commit

Permalink
pkg:debsrc: write identical build dependency list to dsc/control file
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Lange committed Feb 7, 2012
1 parent f9bf666 commit 56bf58f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion priv/templates/deb/control
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion priv/templates/deb_erlrc/control
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions priv/templates/deb_src/control
Expand Up @@ -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@@
10 changes: 4 additions & 6 deletions src/tetrapak_task_pkg_deb.erl
Expand Up @@ -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(),
Expand Down Expand Up @@ -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, _) ->
Expand All @@ -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")},
Expand Down

0 comments on commit 56bf58f

Please sign in to comment.