#!/bin/bash # # pkglist - create a list of packages to be merged with mergelist # if no parameters are given, just create a full list of pkgs on the system (w/ versions) if [[ $# -lt 1 ]]; then ACTION="full" else ACTION="$@" fi case $ACTION in "full" ) echo "Creating list of all installed packages in ~/pkg.list..." qlist -ICv > ~/pkg.list sort ~/pkg.list -o ~/pkg.list ;; "random" ) echo "Creating randomized list of all installed packages in ~/pkg.list..." qlist -ICv > ~/pkg.list sort -R ~/pkg.list -o ~/pkg.list ;; * ) echo "Creating list for target \"$@\" in ~/pkg.list..." emerge -ep --ignore-default-opts "$@" \ | sed -e '/^\[.*/!d' \ > ~/pkg.list ;; esac # this bit should sanitize ~/pkg.list for use by mergelist. # after passing through here, ~/pkg.list will be a list in the form: # # ~category/pkgname-version-rev sed -i -e 's:\.ebuild$::g' \ -e 's:\[ebuild.*\].::g' \ -e 's:\[.*\]::g' \ -e '/^$/d' \ -e 's:USE=.*$::g' \ -e 's:\(^.*$\):~\1:g' \ -e '/^.*\/gcc.*$/d' \ -e '/^.*\/glibc.*$/d' \ -e '/^.*\/linux-headers.*$/d' \ -e '/^.*\/gentoo-sources.*$/d' \ -e '/^.*\/ccache.*$/d' \ ~/pkg.list # -e '/^.*x11-proto\/.*$/d' \ # -e '/^.*dev-perl\/.*$/d' \ # -e '/^.*virtual\/.*$/d' \ # -e '/perl/d' \