Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 5 files changed
  • 0 comments
  • 1 contributor
1  .gitignore
... ...
@@ -1,3 +1,2 @@
1  
-ebin
2 1
 *.beam
3 2
 *~
10  apps/dummy_app/ebin/dummy_app.appup
... ...
@@ -0,0 +1,10 @@
  1
+{"2",
  2
+    %% Upgrade instructions from 1 to 2
  3
+    [{"1", [
  4
+        {load_module, dummy_app_server}
  5
+    ]}],
  6
+    %% Downgrade instructions from 2 to 1
  7
+    [{"1",[
  8
+        {load_module, dummy_app_server}
  9
+    ]}]
  10
+}.
2  apps/dummy_app/src/dummy_app.app.src
... ...
@@ -1,7 +1,7 @@
1 1
 {application, dummy_app,
2 2
  [
3 3
   {description, "Dummy project to test release process"},
4  
-  {vsn, "1"},
  4
+  {vsn, "2"},
5 5
   {registered, []},
6 6
   {applications, [
7 7
                   kernel,
15  apps/dummy_app/src/dummy_app_server.erl
@@ -3,7 +3,7 @@
3 3
 -behaviour(gen_server).
4 4
 
5 5
 %% API
6  
--export([start_link/0, poke/0, num_pokes/0]).
  6
+-export([start_link/0, poke/0, num_pokes/0, poke_twice/0]).
7 7
 
8 8
 %% gen_server callbacks
9 9
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -18,6 +18,9 @@ start_link() ->
18 18
 poke() ->
19 19
     gen_server:call(?MODULE, poke).
20 20
 
  21
+poke_twice() ->
  22
+    gen_server:call(?MODULE, poke_twice).
  23
+
21 24
 num_pokes() ->
22 25
     gen_server:call(?MODULE, num_pokes).
23 26
 
@@ -29,6 +32,12 @@ init([]) ->
29 32
 handle_call(num_pokes, _From, State = #state{ num_pokes = PokeCount }) ->
30 33
     {reply, PokeCount, State};
31 34
 
  35
+handle_call(poke_twice, _From, State) ->
  36
+    NewPokeCount = State#state.num_pokes + 2,
  37
+    NewState     = State#state{num_pokes = NewPokeCount},
  38
+    Reply        = {ok, NewPokeCount},
  39
+    {reply, Reply, NewState};
  40
+
32 41
 handle_call(poke, _From, State) ->
33 42
     NewPokeCount = State#state.num_pokes + 1,
34 43
     NewState     = State#state{num_pokes = NewPokeCount},
@@ -44,7 +53,9 @@ handle_info(_Info, State) ->
44 53
 terminate(_Reason, _State) ->
45 54
     ok.
46 55
 
47  
-code_change(_OldVsn, State, _Extra) ->
  56
+code_change(OldVsn, State, Extra) ->
  57
+    error_logger:info_msg("code_change, oldvsn:~p state:~p extra:~p~n",
  58
+                          [OldVsn, State, Extra]),
48 59
     {ok, State}.
49 60
 
50 61
 %%% Internal functions
3  rel/reltool.config
... ...
@@ -1,6 +1,6 @@
1 1
 {sys, [
2 2
        {lib_dirs, ["../apps"]},
3  
-       {rel, "dummy", "1",
  3
+       {rel, "dummy", "2",
4 4
         [
5 5
          kernel,
6 6
          stdlib,
@@ -31,3 +31,4 @@
31 31
            {copy, "files/app.config", "etc/app.config"},
32 32
            {copy, "files/vm.args", "etc/vm.args"}
33 33
            ]}.
  34
+

No commit comments for this range

Something went wrong with that request. Please try again.