Ticket #549: allow-undiversion-without-version-check.diff

File allow-undiversion-without-version-check.diff, 2.1 KB (added by broder, 14 years ago)
  • divert.mk

     
    7272               $(foreach file,$(divert_undivert_files), \ 
    7373                   $(if $(DEB_UNDIVERT_VERSION_$(file)),,\ 
    7474                       echo "ERROR!  Missing undivert version for $(file)!">&2; exit 1;) \ 
     75                   $(if $(DEB_UNDIVERT_VERSION_$(file)),all,\ 
     76                   echo -n "    always_undivert_unlink $(call divert_files_replace_name,$(file), )") \ 
    7577                   echo -n "    if [ -n \"\$$2\" ] && dpkg --compare-versions \"\$$2\" '<<' "; \ 
    7678                   echo "'$(DEB_UNDIVERT_VERSION_$(file))'; then"; \ 
    7779                   echo "        undivert_unlink $(call divert_files_replace_name,$(file), )"; \ 
     
    7981               $(foreach file,$(divert_unremove_files), \ 
    8082                   $(if $(DEB_UNREMOVE_VERSION_$(file)),,\ 
    8183                       echo "ERROR!  Missing unremove version for $(file)!">&2; exit 1;) \ 
     84                   $(if $(DEB_UNREMOVE_VERSION_$(file)),all,\ 
     85                   echo -n "    always_undivert_unremove $(file) /usr/share/$(cdbs_curpkg)/`$(DEB_DIVERT_ENCODER) $(file)`") \ 
    8286                   echo -n "    if [ -n \"\$$2\" ] && dpkg --compare-versions \"\$$2\" '<<' "; \ 
    8387                   echo "'$(DEB_UNREMOVE_VERSION_$(file))'; then"; \ 
    8488                   echo "        undivert_unremove $(file)"; \ 
  • divert.sh.in

     
    107107    undivert_unlink_divert "$file" 
    108108} 
    109109 
     110always_undivert_unlink() 
     111{ 
     112    file="$1" 
     113    if dpkg-divert --list "${file}" | grep -Fxq "diversion of ${file} to ${file}${theirs} by ${package}"; then 
     114       undivert_unlink "$file" 
     115    fi 
     116} 
     117 
     118always_undivert_unremove() 
     119{ 
     120    file="$1" 
     121    removedfile="$2" 
     122    if dpkg-divert --list "${file}" | grep -Fxq "diversion of ${file} to ${removedfile} by ${package}"; then 
     123       undivert_unremove "$file" 
     124    fi 
     125} 
     126