@@ -5,6 +5,7 @@ tests_init \
5
5
config \
6
6
config_fileexist \
7
7
config_fileexist_notinpkg \
8
+ config_hardlink \
8
9
config_morecomplicated
9
10
10
11
config_body ()
@@ -84,6 +85,57 @@ config_fileexist_body()
84
85
test -f ${TMPDIR} /target/${TMPDIR} /a.pkgnew || atf_fail " file overwritten when it should not have"
85
86
}
86
87
88
+ config_hardlink_body ()
89
+ {
90
+ # Create a pkg
91
+ atf_check -s exit:0 ${RESOURCEDIR} /test_subr.sh new_pkg " test" " test" " 1.0"
92
+ echo " line 1" > a
93
+ echo " line 2" >> a
94
+ ln a b
95
+ echo " @config /a" > plist
96
+ echo " /b" >> plist
97
+ atf_check \
98
+ -o empty \
99
+ -e empty \
100
+ pkg create -M test.ucl -p plist -r .
101
+ atf_check -o ignore pkg repo .
102
+ echo " local: { url: file://${TMPDIR} }" > local.conf
103
+ mkdir ${TMPDIR} /target
104
+
105
+ # Install the pkg
106
+ atf_check \
107
+ -e match:" .*load error: access repo file.*" \
108
+ pkg -o REPOS_DIR=${TMPDIR} -r ${TMPDIR} /target install -qy test
109
+ rm * .txz
110
+
111
+ # Modify the local config
112
+ echo " line 1a" > target/a
113
+ echo " line 2" >> target/a
114
+
115
+ # Create an updated pkg
116
+ atf_check -s exit:0 ${RESOURCEDIR} /test_subr.sh new_pkg " test" " test" " 1.1"
117
+ echo " line 1" > a
118
+ echo " line 2" >> a
119
+ echo " @config /a" > plist
120
+ echo " /b" >> plist
121
+ atf_check \
122
+ -o empty \
123
+ -e empty \
124
+ pkg create -M test.ucl -p plist -r .
125
+ atf_check -o ignore pkg repo .
126
+ atf_check -e ignore -o ignore pkg -o REPOS_DIR=${TMPDIR} update -f
127
+
128
+ # Upgrade
129
+ atf_check \
130
+ -o ignore \
131
+ pkg -o REPOS_DIR=${TMPDIR} -r ${TMPDIR} /target upgrade -y
132
+
133
+ atf_check \
134
+ -o match:" test-1.1*" \
135
+ pkg -r ${TMPDIR} /target info
136
+
137
+ }
138
+
87
139
config_fileexist_notinpkg_body ()
88
140
{
89
141
mkdir -p ${TMPDIR} /target/${TMPDIR}
0 commit comments