Skip to content

Commit

Permalink
fixed the remove-release problem and fixed docs
Browse files Browse the repository at this point in the history
remove release failed to function properly when an app spec in a release was greater than size 2
fixed docs and bumped versions
  • Loading branch information
Martin Logan committed May 17, 2008
1 parent 5ece8e0 commit 95aca14
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/epkg/src/epkg_installed_paths.erl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ get_installation_path() ->

%%--------------------------------------------------------------------
%% @doc Return the path to a config file within an installed release.
%% @spec config_file_path(RelName, RelVsn) -> ConfigFilePath
%% @spec find_config_file_path(RelName, RelVsn) -> ConfigFilePath
%% @end
%%--------------------------------------------------------------------
find_config_file_path(RelName, RelVsn) ->
Expand Down
26 changes: 14 additions & 12 deletions lib/epkg/src/epkg_manage.erl
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,19 @@ remove_release(InstallationPath, RelName, RelVsn, Force) ->
case question_removal(UniqueSpecs, RelName, RelVsn) of
true ->
%blast_executable_files(InstallationPath, RelName, RelVsn),
io:format("removing ~s-~s~n"),
blast_app_and_release_packages(UniqueSpecs, InstallationPath, RelName, RelVsn);
false ->
ok
end
end.

question_removal([], PackageName, PackageVsn) ->
true;
question_removal(UniqueSpecs, PackageName, PackageVsn) ->
CleansedSpecs = [{element(1, AppSpec), element(2, AppSpec)} || AppSpec <- UniqueSpecs],
case ewl_talk:ask([lists:flatten(
io_lib:fwrite("To remove ~s-~s you must delete the following apps:~n~p?~n~n Please answer [yes|no]",
[PackageName, PackageVsn, CleansedSpecs]))]) of
[PackageName, PackageVsn, UniqueSpecs]))]) of
Yes when Yes == $y; Yes == $Y; Yes == "yes" ->
true;
No when No == $n; No == $N; No == "no" ->
Expand Down Expand Up @@ -225,16 +227,16 @@ name_and_vsn(Paths) ->
%%--------------------------------------------------------------------
find_non_shared_app_specs(InstallationPath, RelName, RelVsn) ->
{ok, TargetSpecs} = fetch_app_specs(InstallationPath, RelName, RelVsn),
RelVsns = lists:delete(RelVsn, epkg_installed_paths:list_release_vsns(InstallationPath, RelName)),
ReleaseNames = epkg_installed_paths:list_releases(InstallationPath),
ReleaseTuples =
[{RelName, RelVsns}|
lists:keydelete(RelName, 1,
lists:map(fun(ReleaseName) ->
ReleaseVersions = epkg_installed_paths:list_release_vsns(InstallationPath, ReleaseName),
{ReleaseName, ReleaseVersions}
end, ReleaseNames))],
ReleaseNames = epkg_installed_paths:list_releases(InstallationPath),
ReleaseTuples = lists:map(fun(ReleaseName) when ReleaseName == RelName ->
ReleaseVersions = epkg_installed_paths:list_release_vsns(InstallationPath, ReleaseName),
{ReleaseName, lists:delete(RelVsn, ReleaseVersions)};
(ReleaseName) ->
ReleaseVersions = epkg_installed_paths:list_release_vsns(InstallationPath, ReleaseName),
{ReleaseName, ReleaseVersions}
end, ReleaseNames),
FlatSpecs = fetch_flat_list_app_specs(InstallationPath, ReleaseTuples),
?INFO_MSG("flat app ~p target ~p~n", [FlatSpecs, TargetSpecs]),
TargetSpecs -- FlatSpecs.

fetch_flat_list_app_specs(InstallationPath, ReleaseTuples) ->
Expand All @@ -256,7 +258,7 @@ fetch_app_specs(InstallationPath, RelName, RelVsn) ->
RelFilePath = epkg_installed_paths:installed_release_rel_file_path(InstallationPath, RelName, RelVsn),
case catch epkg_util:consult_rel_file(app_specs, RelFilePath) of
{'EXIT', Reason} -> {error, {"could not find app specs for the release specified", Reason}};
AppSpecs -> {ok, AppSpecs}
AppSpecs -> {ok, [{element(1, AS), element(2, AS)} || AS <- AppSpecs]}
end.

%%--------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/epkg/vsn.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EPKG_VSN=0.3.9.1
EPKG_VSN=0.3.9.2
2 changes: 1 addition & 1 deletion lib/faxien/src/fax_manage.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ add_repo_to_fetch_from(Repo, ConfigFilePath) ->
%% @spec get_signature(ConfigFilePath) -> {ok, Sig}
%% where
%% ConfigFilePath = string()
%% Sig = {{public_key, {Mod, ExpPub}}, {private_key, {Mod, ExpPriv}}
%% Sig = {{public_key, {Mod, ExpPub}}, {private_key, {Mod, ExpPriv}}}
%% @end
%%--------------------------------------------------------------------
get_signature(ConfigFilePath) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/faxien/vsn.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FAXIEN_VSN=0.29.5.1
FAXIEN_VSN=0.29.5.2
2 changes: 1 addition & 1 deletion release/faxien/vsn.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REL_VSN=0.29.5.1
REL_VSN=0.29.5.2

0 comments on commit 95aca14

Please sign in to comment.