From b36e6eba494fa187270fb7d25e85347cc7a652c9 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 17 Oct 2010 04:10:16 -0500 Subject: [PATCH] script/makepkg, todo: todo maintenance --- script/makepkg | 60 +++++++++++++++++++++++++++++++++++++++++--------- todo | 45 ------------------------------------- 2 files changed, 49 insertions(+), 56 deletions(-) diff --git a/script/makepkg b/script/makepkg index 0332723..915e087 100755 --- a/script/makepkg +++ b/script/makepkg @@ -4,17 +4,6 @@ _root="$(dirname "${0}")"; . "${_root}/lib/env.sh" want log root -# Dump a list of leaf ports from a working system -# Leaf ports are ports that have nothing depending upon them -# These are generally the top-level ports; everything else should -# be pulled in by them -leaf_ports() { - ( cd /var/db/pkg; ls -1 ) | while read pkg - do - pkg_info -Rq "${pkg}" | grep -q '' || pkg_info -oq "${pkg}" - done | sort -} - ######## # # Chroot handling @@ -237,6 +226,51 @@ pkg_deps() { port2pkg $(port_all_deps "${@}") } +# Dump a list of leaf ports from a working system +# Leaf ports are ports that have nothing depending upon them +# These are generally the top-level ports; everything else should +# be pulled in by them; on a system that has had updates applied +# this may pick up orphaned packages as well, so try cutleaves? +leaf_ports() { + ( cd /var/db/pkg; ls -1 ) | while read pkg + do + pkg_info -Rq "${pkg}" | grep -q '' || pkg_info -oq "${pkg}" + done | sort +} + +# Display a tree of all build dependencies (and +# any runtime dependencies those build dependencies +# depend upon). Individual ports may appear more than +# once, as it is a tree and not a list. +port_bdep_tree() { + port="${1##/usr/ports/}" + printf "%${2}s%s\n" "" "${port}" + + ( cd /usr/ports/${port} + ( make build-depends-list + [ "${2:-0}" -gt 0 ] && make run-depends-list + ) | sort -u | while read port + do + bdep_tree "${port}" $(( ${2:-0} + 1 )) + done + ) +} + +# Display a tree of all runtime dependencies. Individual +# ports may appear more than once, as it is a tree and +# not a list. +port_rdep_tree() { + port="${1##/usr/ports/}" + printf "%${2}s%s\n" "" "${port}" + + ( cd /usr/ports/${port} + make run-depends-list | sort -u | while read port + do + rdep_tree "${port}" $(( ${2:-0} + 1 )) + done + ) +} + ######## # # Port Configuration Handling @@ -482,3 +516,7 @@ TERM=${TERM} # Blind passthru for testing [ "${#}" ] && "${@}" + +# Todo: Clean up entrypoint to support proper options +# Todo: Add methods to autoprocess a ports.lst file to produce packages +# Todo: Unify chroot handling with makeworld diff --git a/todo b/todo index 8dcb7a0..9d6b2e6 100644 --- a/todo +++ b/todo @@ -17,48 +17,3 @@ Nabihi (remember (understand, perceive, notice)) Alter conf stuff to support tmpfs_size as well as md_size, to use tmpfs mounts instead of mdmfs mounts for diskless-remount storage Try makefs? - While makefs does allow non-root manipulation, it does not provide nearly enough control over the resultant filesystem size to make it useful for packing. - -# Try to work these into the library somewhere - -# Leaf ports are ports that have nothing depending upon them -# These are generally the top-level ports; everything else should -# be pulled in by them -leaf_ports() { - ( cd /var/db/pkg; ls -1 ) | while read pkg - do - pkg_info -Rq "${pkg}" | grep -q '' || pkg_info -oq "${pkg}" - done | sort -} - -# Display a tree of all build dependencies (and -# any runtime dependencies those build dependencies -# depend upon). Individual ports may appear more than -# once, as it is a tree and not a list. -bdep_tree() { - port="${1##/usr/ports/}" - printf "%${2}s%s\n" "" "${port}" - - ( cd /usr/ports/${port} - ( make build-depends-list - [ "${2:-0}" -gt 0 ] && make run-depends-list - ) | sort -u | while read port - do - bdep_tree "${port}" $(( ${2:-0} + 1 )) - done - ) -} - -# Display a tree of all runtime dependencies. Individual -# ports may appear more than once, as it is a tree and -# not a list. -rdep_tree() { - port="${1##/usr/ports/}" - printf "%${2}s%s\n" "" "${port}" - - ( cd /usr/ports/${port} - make run-depends-list | sort -u | while read port - do - rdep_tree "${port}" $(( ${2:-0} + 1 )) - done - ) -} -- 2.42.0