@@ -759,6 +759,7 @@ changelog=
759
759
changelog_markup=" text"
760
760
enable_nolib_creation=
761
761
ignore=
762
+ unchanged=
762
763
contents=
763
764
nolib_exclude=
764
765
wowi_gen_changelog=" true"
@@ -798,7 +799,7 @@ parse_ignore() {
798
799
yaml_line=${yaml_line# " ${yaml_line%% [! ]* } " } # trim leading whitespace
799
800
# Get the YAML list item.
800
801
yaml_listitem " $yaml_line "
801
- if [ " $pkgmeta_phase " = " ignore" ]; then
802
+ if [[ " $pkgmeta_phase " == " ignore" || " $pkgmeta_phase " == " plain-copy " ] ]; then
802
803
pattern=$yaml_item
803
804
if [ -d " $checkpath /$pattern " ]; then
804
805
pattern=" $copypath$pattern /*"
@@ -808,10 +809,18 @@ parse_ignore() {
808
809
else
809
810
pattern=" $copypath$pattern "
810
811
fi
811
- if [ -z " $ignore " ]; then
812
- ignore=" $pattern "
813
- else
814
- ignore=" $ignore :$pattern "
812
+ if [[ " $pkgmeta_phase " == " ignore" ]]; then
813
+ if [ -z " $ignore " ]; then
814
+ ignore=" $pattern "
815
+ else
816
+ ignore=" $ignore :$pattern "
817
+ fi
818
+ elif [[ " $pkgmeta_phase " == " plain-copy" ]]; then
819
+ if [ -z " $unchanged " ]; then
820
+ unchanged=" $pattern "
821
+ else
822
+ unchanged=" $unchanged :$pattern "
823
+ fi
815
824
fi
816
825
fi
817
826
;;
@@ -903,6 +912,20 @@ if [ -f "$pkgmeta_file" ]; then
903
912
ignore=" $ignore :$pattern "
904
913
fi
905
914
;;
915
+ plain-copy)
916
+ pattern=$yaml_item
917
+ if [ -d " $topdir /$pattern " ]; then
918
+ pattern=" $pattern /*"
919
+ elif [ ! -f " $topdir /$pattern " ]; then
920
+ # doesn't exist so match both a file and a path
921
+ pattern=" $pattern :$pattern /*"
922
+ fi
923
+ if [ -z " $unchanged " ]; then
924
+ unchanged=" $pattern "
925
+ else
926
+ unchanged=" $unchanged :$pattern "
927
+ fi
928
+ ;;
906
929
tools-used)
907
930
relations[" $yaml_item " ]=" tool"
908
931
;;
@@ -1579,33 +1602,32 @@ copy_directory_tree() {
1579
1602
( cd " $_cdt_srcdir " && eval " $_cdt_find_cmd " ) | while read -r file; do
1580
1603
file=${file# ./ }
1581
1604
if [ -f " $_cdt_srcdir /$file " ]; then
1582
- # Check if the file should be ignored.
1583
- skip_copy =
1605
+ _cdt_skip_copy=
1606
+ _cdt_only_copy =
1584
1607
# Prefix external files with the relative pkgdir path
1585
1608
_cdt_check_file=$file
1586
1609
if [ -n " ${_cdt_destdir# $pkgdir } " ]; then
1587
1610
_cdt_check_file=" ${_cdt_destdir# $pkgdir / } /$file "
1588
1611
fi
1589
1612
# Skip files matching the colon-separated "ignored" shell wildcard patterns.
1590
- if [ -z " $skip_copy " ] && match_pattern " $_cdt_check_file " " $_cdt_ignored_patterns " ; then
1591
- skip_copy =" true"
1613
+ if match_pattern " $_cdt_check_file " " $_cdt_ignored_patterns " ; then
1614
+ _cdt_skip_copy =" true"
1592
1615
fi
1593
1616
# Never skip files that match the colon-separated "unchanged" shell wildcard patterns.
1594
- unchanged=
1595
- if [ -n " $skip_copy " ] && match_pattern " $file " " $_cdt_unchanged_patterns " ; then
1596
- skip_copy=
1597
- unchanged=" true"
1617
+ if match_pattern " $file " " $_cdt_unchanged_patterns " ; then
1618
+ _cdt_skip_copy=
1619
+ _cdt_only_copy=" true"
1598
1620
fi
1599
1621
# Copy unskipped files into $_cdt_destdir.
1600
- if [ -n " $skip_copy " ]; then
1622
+ if [ -n " $_cdt_skip_copy " ]; then
1601
1623
echo " Ignoring: $file "
1602
1624
else
1603
1625
dir=${file%/* }
1604
1626
if [ " $dir " != " $file " ]; then
1605
1627
mkdir -p " $_cdt_destdir /$dir "
1606
1628
fi
1607
1629
# Check if the file matches a pattern for keyword replacement.
1608
- if [ -n " $unchanged " ] || ! match_pattern " $file " " *.lua:*.md:*.toc:*.txt:*.xml" ; then
1630
+ if [ -n " $_cdt_only_copy " ] || ! match_pattern " $file " " *.lua:*.md:*.toc:*.txt:*.xml" ; then
1609
1631
echo " Copying: $file (unchanged)"
1610
1632
cp " $_cdt_srcdir /$file " " $_cdt_destdir /$dir "
1611
1633
else
@@ -1728,12 +1750,20 @@ if [ -z "$skip_copying" ]; then
1728
1750
[ -n " $split " ] && cdt_args+=" S"
1729
1751
[ -n " $game_type " ] && cdt_args+=" -g $game_type "
1730
1752
[ -n " $ignore " ] && cdt_args+=" -i \" $ignore \" "
1731
- [ -n " $changelog " ] && cdt_args+=" -u \" $changelog \" "
1753
+ if [ -n " $changelog " ]; then
1754
+ if [ -z " $unchanged " ]; then
1755
+ unchanged=" $changelog "
1756
+ else
1757
+ unchanged=" $unchanged :$changelog "
1758
+ fi
1759
+ fi
1760
+ [ -n " $unchanged " ] && cdt_args+=" -u \" $unchanged \" "
1732
1761
eval copy_directory_tree " $cdt_args " " \" $topdir \" " " \" $pkgdir \" "
1733
1762
fi
1734
1763
1735
1764
# Reset ignore and parse pkgmeta ignores again to handle ignoring external paths
1736
1765
ignore=
1766
+ unchanged=
1737
1767
parse_ignore " $pkgmeta_file "
1738
1768
1739
1769
# ##
@@ -1864,9 +1894,9 @@ checkout_external() {
1864
1894
if [[ " $_external_uri " == * " wowace.com" * || " $_external_uri " == * " curseforge.com" * ]]; then
1865
1895
project_site=" https://wow.curseforge.com"
1866
1896
fi
1867
- # If a .pkgmeta file is present, process it for an "ignore" list .
1897
+ # If a .pkgmeta file is present, process it for "ignore" and "plain-copy" lists .
1868
1898
parse_ignore " $_cqe_checkout_dir /.pkgmeta" " $_external_dir "
1869
- copy_directory_tree -dnpe -i " $ignore " " $_cqe_checkout_dir " " $pkgdir /$_external_dir "
1899
+ copy_directory_tree -dnpe -i " $ignore " -u " $unchanged " " $_cqe_checkout_dir " " $pkgdir /$_external_dir "
1870
1900
)
1871
1901
# Remove the ".checkout" subdirectory containing the full checkout.
1872
1902
if [ -d " $_cqe_checkout_dir " ]; then
0 commit comments