Browse code

* modernize release mechanism

Nat! authored on 19-09-2017 14:24:56
Showing 2 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 #! /usr/bin/env bash
2 2
 #
3
-#   Copyright (c) 2017 Nat! - Mulle kybernetiK
3
+#   Copyright (c) 2017 Nat! - Codeon GmbH
4 4
 #   All rights reserved.
5 5
 #
6 6
 #   Redistribution and use in source and binary forms, with or without
... ...
@@ -47,12 +47,9 @@
47 47
 generate_brew_formula_build()
48 48
 {
49 49
    cat <<EOF
50
-  def install
51
-     system "./install.sh", "#{prefix}"
52
-  end
53
-
54
-  test do
55
-  end
50
+def install
51
+  system "./install.sh", "#{prefix}"
52
+end
56 53
 EOF
57 54
 }
58 55
 
... ...
@@ -82,12 +79,8 @@ generate_brew_formula()
82 79
 #######
83 80
 
84 81
 MULLE_BOOTSTRAP_FAIL_PREFIX="`basename -- $0`"
85
-MULLE_HOMEBREW_VERSION="5.0.0"
82
+MULLE_HOMEBREW_VERSION="5.2.0"
86 83
 
87
-#
88
-# prefer local mulle-homebrew if available
89
-# Do not embed it anymore!
90
-#
91 84
 if [ -z "`command -v mulle-homebrew-env`" ]
92 85
 then
93 86
    cat <<EOF >&2
... ...
@@ -121,32 +114,50 @@ main()
121 114
       git_main "${BRANCH}" "${ORIGIN}" "${TAG}" "${GITHUB}" || exit 1
122 115
    fi
123 116
 
124
-   if [ "${DO_GENERATE_FORMULA}" != "YES" ]
117
+   if [ "${DO_GENERATE_FORMULA}" = "YES" ]
125 118
    then
126
-       return
119
+      if [ -z "${PUBLISHER}" ]
120
+      then
121
+         fail "You need to specify a publisher with --publisher (hint: https://github.com/<publisher>)"
122
+      fi
123
+
124
+      if [ -z "${PUBLISHER_TAP}" ]
125
+      then
126
+         fail "You need to specify a publisher tap with --tap (hint: <mulle-kybernetik/software>)"
127
+      fi
128
+
129
+      # generate the formula and push it
130
+      if ! homebrew_main "${PROJECT}" \
131
+                         "${NAME}" \
132
+                         "${VERSION}" \
133
+                         "${DEPENDENCIES}" \
134
+                         "${BUILD_DEPENDENCIES}" \
135
+                         "${HOMEPAGE_URL}" \
136
+                         "${DESC}" \
137
+                         "${ARCHIVE_URL}" \
138
+                         "${HOMEBREW_TAP}" \
139
+                         "${RBFILE}"
140
+      then
141
+         return 1
142
+      fi
127 143
    fi
128 144
 
129
-   if [ -z "${PUBLISHER}" ]
145
+   #
146
+   # check if someone installed a post_release function
147
+   # if yes call it (maybe calls mulle-homebrew-debian)
148
+   #
149
+   if [ "`type -t post_release`" = "function" ]
130 150
    then
131
-      fail "You need to specify a publisher with --publisher (hint: https://github.com/<publisher>)"
151
+      post_release "${PROJECT}" \
152
+                   "${NAME}" \
153
+                   "${VERSION}" \
154
+                   "${DEPENDENCIES}" \
155
+                   "${BUILD_DEPENDENCIES}" \
156
+                   "${HOMEPAGE_URL}" \
157
+                   "${DESC}" \
158
+                   "${ARCHIVE_URL}" \
159
+                   "${DEBIAN_DEPENDENCIES}"
132 160
    fi
133
-
134
-   if [ -z "${PUBLISHER_TAP}" ]
135
-   then
136
-      fail "You need to specify a publisher tap with --tap (hint: <mulle-kybernetik/software>)"
137
-   fi
138
-
139
-   # generate the formula and push it
140
-   homebrew_main "${PROJECT}" \
141
-                 "${NAME}" \
142
-                 "${VERSION}" \
143
-                 "${DEPENDENCIES}" \
144
-                 "${BUILD_DEPENDENCIES}" \
145
-                 "${HOMEPAGE_URL}" \
146
-                 "${DESC}" \
147
-                 "${ARCHIVE_URL}" \
148
-                 "${HOMEBREW_TAP}" \
149
-                 "${RBFILE}"
150 161
 }
151 162
 
152 163
 main "$@"
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=12
34
-MULLE_EXECUTABLE_VERSION_PATCH=1
34
+MULLE_EXECUTABLE_VERSION_PATCH=2
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37