Fix #31 and add new test case to reproduce it.

This commit is contained in:
Juan RP 2014-02-25 22:55:39 +01:00
parent a511292316
commit 8c47021ec3
5 changed files with 47 additions and 1 deletions

2
NEWS
View File

@ -1,5 +1,7 @@
xbps-0.33 (???):
* Fixed issue #31: https://github.com/voidlinux/xbps/issues/31
* New configuration file format with a custom C parser, simpler
and does not need any additional external dependency. confuse is
not necessary anymore.

View File

@ -364,7 +364,7 @@ unpack_archive(struct xbps_handle *xhp,
if (!force && (entry_type == AE_IFREG)) {
buf = strchr(entry_pname, '.') + 1;
assert(buf != NULL);
if (file_exists) {
if (file_exists && S_ISREG(st.st_mode)) {
/*
* Handle configuration files. Check if current
* entry is a configuration file and take action

View File

@ -11,6 +11,7 @@ atf_test_program{name="find_pkg_obsoletes_test"}
atf_test_program{name="issue6_test"}
atf_test_program{name="issue18_test"}
atf_test_program{name="issue20_test"}
atf_test_program{name="issue31_test"}
atf_test_program{name="conf_files_test"}
atf_test_program{name="remove_test"}
atf_test_program{name="replace_test"}

View File

@ -3,6 +3,7 @@ TOPDIR = ../../../..
TESTSHELL = conf_files_test issue6_test issue18_test issue20_test remove_test
TESTSHELL+= replace_test installmode_test obsoletefiles_test
TESTSHELL+= issue31_test
include ../Makefile.inc
include $(TOPDIR)/mk/test.mk

View File

@ -0,0 +1,42 @@
#! /usr/bin/env atf-sh
# xbps issue #31.
# How to reproduce it:
# Generate pkg A-0.1_1:
# /dir/dir/foo
# Install pkg A.
# Generate pkg A-0.2_1:
# /dir/foo
# Update pkg A to 0.2_1
atf_test_case issue31
issue31_head() {
atf_set "descr" "xbps issue #31 (https://github.com/xtraeme/xbps/issues/31)"
}
issue31_body() {
mkdir -p pkg_A/usr/share/licenses/chromium/license.html
echo random > pkg_A/usr/share/licenses/chromium/license.html/eula.html
xbps-create -A noarch -n A-0.1_1 -s "pkg A" pkg_A
atf_check_equal $? 0
xbps-rindex -a *.xbps
atf_check_equal $? 0
xbps-install -r root -C null.conf --repository=$PWD -y A
atf_check_equal $? 0
mkdir -p pkg_B/usr/share/licenses/chromium
echo "morerandom" > pkg_B/usr/share/licenses/chromium/license.html
xbps-create -A noarch -n A-0.2_1 -s "pkg A" pkg_B
atf_check_equal $? 0
xbps-rindex -a A-0.2_1.noarch.xbps
atf_check_equal $? 0
xbps-install -r root -C null.conf --repository=$PWD -yuvd A
atf_check_equal $? 0
}
atf_init_test_cases() {
atf_add_test_case issue31
}