diff options
author | Bryan Drewery <bryan@shatow.net> | 2014-04-17 08:58:03 +0400 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2014-04-17 08:58:03 +0400 |
commit | 714670e20a50ea091aac7861a268aee7e227a68e (patch) | |
tree | 574fc7d63dfad4a1979ad5f0269d6badcb6fe7f4 /src/share | |
parent | 76a2db60558a732a4645e48e1a6f44f8a339f386 (diff) |
leftovers: Use new check_leftover.sh from ports r351446
MFH
Diffstat (limited to 'src/share')
-rwxr-xr-x | src/share/poudriere/common.sh | 174 |
1 files changed, 95 insertions, 79 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 0a6075af..e441f4c1 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1656,7 +1656,6 @@ Try testport with -n to use PREFIX=LOCALBASE" local mod=$(mktemp ${mnt}/tmp/mod.XXXXXX) local mod1=$(mktemp ${mnt}/tmp/mod1.XXXXXX) local die=0 - local users user homedirs tmpplist # Check stage-qa first if [ -z "${no_stage}" ]; then @@ -1673,89 +1672,106 @@ Try testport with -n to use PREFIX=LOCALBASE" msg "Checking for extra files and directories" bset ${MY_JOBID} status "leftovers:${port}" - tmpplist=$(injail make -C ${portdir} -VTMPPLIST) - users=$(injail make -C ${portdir} -VUSERS) - homedirs="" - for user in ${users}; do - user=$(grep ^${user}: ${mnt}/usr/ports/UIDs | cut -f 9 -d : | sed -e "s|/usr/local|${PREFIX}| ; s|^|${mnt}|") - homedirs="${homedirs} ${user}" - done + if [ -f "${mnt}/usr/ports/Mk/Scripts/check_leftovers.sh" ]; then + check_leftovers ${mnt} | sed -e "s|${mnt}||" | + injail env PORTSDIR=/usr/ports \ + ${PORT_FLAGS} /bin/sh \ + /usr/ports/Mk/Scripts/check_leftovers.sh \ + ${port} | while read modtype data; do + case "${modtype}" in + +) echo "${data}" >> ${add} ;; + -) echo "${data}" >> ${del} ;; + M) echo "${data}" >> ${mod} ;; + esac + done + else + # LEGACY - Support for older ports tree. + local users user homedirs + + users=$(injail make -C ${portdir} -VUSERS) + homedirs="" + for user in ${users}; do + user=$(grep ^${user}: ${mnt}/usr/ports/UIDs | cut -f 9 -d : | sed -e "s|/usr/local|${PREFIX}| ; s|^|${mnt}|") + homedirs="${homedirs} ${user}" + done - check_leftovers ${mnt} | \ - while read modtype path extra; do - local ppath ignore_path=0 - - # If this is a directory, use @dirrm in output - if [ -d "${path}" ]; then - ppath="@dirrm "`echo $path | sed \ - -e "s,^${mnt},," \ - -e "s,^${PREFIX}/,," \ - ${plistsub_sed} \ - ` - else - ppath=`echo "$path" | sed \ - -e "s,^${mnt},," \ - -e "s,^${PREFIX}/,," \ - ${plistsub_sed} \ - ` - fi - case $modtype in - +) + check_leftovers ${mnt} | \ + while read modtype path extra; do + local ppath ignore_path=0 + + # If this is a directory, use @dirrm in output if [ -d "${path}" ]; then - # home directory of users created - case " ${homedirs} " in - *\ ${path}\ *) continue;; - *\ ${path}/*\ *) continue;; - esac + ppath="@dirrm "`echo $path | sed \ + -e "s,^${mnt},," \ + -e "s,^${PREFIX}/,," \ + ${plistsub_sed} \ + ` + else + ppath=`echo "$path" | sed \ + -e "s,^${mnt},," \ + -e "s,^${PREFIX}/,," \ + ${plistsub_sed} \ + ` fi - case "${ppath}" in - # gconftool-2 --makefile-uninstall-rule is unpredictable - etc/gconf/gconf.xml.defaults/%gconf-tree*.xml) ;; - # fc-cache - skip for now - /var/db/fontconfig/*) ;; - *) echo "${ppath}" >> ${add} ;; - esac - ;; - -) - # Skip if it is PREFIX and non-LOCALBASE. See misc/kdehier4 - # or mail/qmail for examples - [ "${path#${mnt}}" = "${PREFIX}" -a \ - "${LOCALBASE}" != "${PREFIX}" ] && ignore_path=1 - - # fc-cache - skip for now - case "${ppath}" in - /var/db/fontconfig/*) ignore_path=1 ;; - esac + case $modtype in + +) + if [ -d "${path}" ]; then + # home directory of users created + case " ${homedirs} " in + *\ ${path}\ *) continue;; + *\ ${path}/*\ *) continue;; + esac + fi + case "${ppath}" in + # gconftool-2 --makefile-uninstall-rule is unpredictable + etc/gconf/gconf.xml.defaults/%gconf-tree*.xml) ;; + # fc-cache - skip for now + /var/db/fontconfig/*) ;; + *) echo "${ppath}" >> ${add} ;; + esac + ;; + -) + # Skip if it is PREFIX and non-LOCALBASE. See misc/kdehier4 + # or mail/qmail for examples + [ "${path#${mnt}}" = "${PREFIX}" -a \ + "${LOCALBASE}" != "${PREFIX}" ] && ignore_path=1 + + # fc-cache - skip for now + case "${ppath}" in + /var/db/fontconfig/*) ignore_path=1 ;; + esac - if [ $ignore_path -eq 0 ]; then - echo "${ppath}" >> ${del} - fi - ;; - M) - case "${ppath}" in - # gconftool-2 --makefile-uninstall-rule is unpredictable - etc/gconf/gconf.xml.defaults/%gconf-tree*.xml) ;; - # This is a cache file for gio modules could be modified for any gio modules - lib/gio/modules/giomodule.cache) ;; - # removal of info files leaves entry uneasy to cleanup in info/dir - # accept a modification of this file - info/dir) ;; - */info/dir) ;; - # The is pear database cache - %%PEARDIR%%/.depdb|%%PEARDIR%%/.filemap) ;; - #ls-R files from texmf are often regenerated - */ls-R);; - # Octave packages database, blank lines can be inserted between pre-install and post-deinstall - share/octave/octave_packages) ;; - # xmlcatmgr is constantly updating catalog.ports ignore modification to that file - share/xml/catalog.ports);; - # fc-cache - skip for now - /var/db/fontconfig/*) ;; - *) echo "${ppath#@dirrm } ${extra}" >> ${mod} ;; + if [ $ignore_path -eq 0 ]; then + echo "${ppath}" >> ${del} + fi + ;; + M) + case "${ppath}" in + # gconftool-2 --makefile-uninstall-rule is unpredictable + etc/gconf/gconf.xml.defaults/%gconf-tree*.xml) ;; + # This is a cache file for gio modules could be modified for any gio modules + lib/gio/modules/giomodule.cache) ;; + # removal of info files leaves entry uneasy to cleanup in info/dir + # accept a modification of this file + info/dir) ;; + */info/dir) ;; + # The is pear database cache + %%PEARDIR%%/.depdb|%%PEARDIR%%/.filemap) ;; + #ls-R files from texmf are often regenerated + */ls-R);; + # Octave packages database, blank lines can be inserted between pre-install and post-deinstall + share/octave/octave_packages) ;; + # xmlcatmgr is constantly updating catalog.ports ignore modification to that file + share/xml/catalog.ports);; + # fc-cache - skip for now + /var/db/fontconfig/*) ;; + *) echo "${ppath#@dirrm } ${extra}" >> ${mod} ;; + esac + ;; esac - ;; - esac - done + done + fi + sort ${add} > ${add1} sort ${del} > ${del1} sort ${mod} > ${mod1} |