3 # Extract the source files
4 mkdir
-p "build/usr/share/texmf-dist"
5 find .
-maxdepth 1 -print -name "*.tar.xz" \
8 -C "build/usr/share/texmf-dist" \
10 cd "build/usr/share/texmf-dist/"
11 # LICENSEs are unneeded
14 # We have some conflicting files between different packages. To work
15 # around this, we use an ownership file that maps which conflicting
16 # files should be in which packages. Here, each file in the map list is
17 # checked whether it is in the package, and if it shouldn't be it is
19 while IFS
=' ' read -r f p
; do
20 if [ "$p" = "$pkgname" ] && ! [ -e "$f" ]; then
21 # Error out if the ownership map expects this package to have a
23 msg_error
"$pkgver: missing file $f\n"
24 elif [ "$p" != "$pkgname" ] && [ -e "$f" ]; then
25 # Remove a file that according to the ownership map belongs to
28 # Install a file that lists the removed packages
29 mkdir
-p ..
/texlive
/removed
30 echo "$f" >> ..
/texlive
/removed
/$pkgname.txt
33 done < "${XBPS_COMMONDIR}/environment/build-style/texmf/ownership.txt"
37 # This is essentially a helper for generating the ownership map. It checks
38 # to see if there are any conflicts between all of the different packages.
39 local f p current_ver current_rev exitcode
=0
43 # Don't check against the texlive-bin* packages, ourselves, -dbg or -32bit pkgs
44 if [[ ${p%-*} =~ .*-bin$ ]] || [ "${p%-*}" = "$pkgname" ] || [[ ${p%-*} =~ .*-dbg$ ]] || [[ ${p%-*} =~ .
*-32bit$
]]; then
47 # Don't check against any version other than the version in the source tree
48 current_ver
="$(grep -m 1 version= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)"
49 current_rev
="$(grep -m 1 revision= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)"
50 if [ "${p%-*}-${current_ver}_${current_rev}" != "${p}" ]; then
51 # They are not the same version
54 echo checking conflicts with
${p}...
55 while IFS
= read -r f
; do
57 msg_red
"both contain file $f\n"
60 done < <(xbps-query
-Rf $p |
sed 's/ -> .*//')
61 done < <(xbps-query
-Rs texlive
-p pkgver | cut
-d : -f 1)