@@ -175,11 +175,67 @@ reproducible_body() {
175175 atf_check_equal $? 1
176176}
177177
178+ atf_test_case install_msg
179+
180+ install_msg_head () {
181+ atf_set " descr" " xbps-install(1): show install message"
182+ }
183+
184+ install_msg_body () {
185+ mkdir -p some_repo pkg_A
186+
187+ # install will now show the message
188+ cat << -EOF >pkg_A/INSTALL.msg
189+ foobar-install-msg
190+ EOF
191+ cd some_repo
192+ xbps-create -A noarch -n A-1.0_1 -s " A pkg" ../pkg_A
193+ atf_check_equal $? 0
194+ xbps-rindex -d -a $PWD /* .xbps
195+ atf_check_equal $? 0
196+ cd ..
197+
198+ atf_check -s exit:0 \
199+ -o ' match:foobar-install-msg' \
200+ -e ignore \
201+ -- xbps-install -r root -C empty.conf --repository=$PWD /some_repo -y A
202+
203+ # update with the same message will not show the message
204+ cd some_repo
205+ xbps-create -A noarch -n A-1.0_2 -s " A pkg" ../pkg_A
206+ atf_check_equal $? 0
207+ xbps-rindex -d -a $PWD /* .xbps
208+ atf_check_equal $? 0
209+ cd ..
210+
211+ atf_check -s exit:0 \
212+ -o ' not-match:foobar-install-msg' \
213+ -e ignore \
214+ -- xbps-install -r root -C empty.conf --repository=$PWD /some_repo -yu
215+
216+ # update with new message will show the message
217+ cat << -EOF >pkg_A/INSTALL.msg
218+ fizzbuzz-install-msg
219+ EOF
220+ cd some_repo
221+ xbps-create -A noarch -n A-1.1_1 -s " A pkg" ../pkg_A
222+ atf_check_equal $? 0
223+ xbps-rindex -d -a $PWD /* .xbps
224+ atf_check_equal $? 0
225+ cd ..
226+
227+ atf_check -s exit:0 \
228+ -o ' match:fizzbuzz-install-msg' \
229+ -e ignore \
230+ -- xbps-install -r root -C empty.conf --repository=$PWD /some_repo -yu
231+ }
232+
178233atf_init_test_cases () {
179234 atf_add_test_case install_existent
180235 atf_add_test_case update_existent
181236 atf_add_test_case update_unpacked
182237 atf_add_test_case unpacked_dep
183238 atf_add_test_case reinstall_unpacked_unpack_only
184239 atf_add_test_case reproducible
240+ atf_add_test_case install_msg
185241}
0 commit comments