diff --git a/build_platform_packages.sh b/build_platform_packages.sh deleted file mode 100755 index 0f0a62b207..0000000000 --- a/build_platform_packages.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Load common constants. This should be the first executable line. -# The path to common.sh should be relative to your script's location. -. "$(dirname "$0")/common.sh" - -verbose() { - echo "$@" - "$@" -} - -assert_inside_chroot -assert_not_root_user - -# Flags -DEFINE_boolean stable $FLAGS_FALSE "Build with stable version of browser." -DEFINE_boolean new_build $FLAGS_FALSE "Use chromiumos-build." -DEFINE_string architecture i386 "The architecture to build for (--new_build only)." a - -# Fix up the command line and parse with shflags. -FIXED_FLAGS="$@" -FIXED_FLAGS=${FIXED_FLAGS/new-build/new_build} -FLAGS $FIXED_FLAGS || exit 1 -eval set -- "${FLAGS_ARGV}" - -# Die on error -set -e - -# Number of jobs for scons calls. -NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` - -PLATFORM_DIR="$SRC_ROOT/platform" - -PLATFORM_DIRS="acpi assets fake_hal init installer login_manager \ - memento_softwareupdate pam_google pam_offline window_manager \ - cros chrome screenlocker cryptohome \ - monitor_reconfig microbenchmark minijail metrics_collection \ - theme metrics_daemon" - -THIRD_PARTY_DIR="$SRC_ROOT/third_party" -THIRD_PARTY_PACKAGES="e2fsprogs/files flimflam \ - gflags google-breakpad gpt gtest gmock \ - ibus ibus-chewing ibus-anthy ibus-hangul ibus-m17n \ - ply-image slim/src synaptics \ - upstart/files wpa_supplicant \ - xscreensaver/xscreensaver-5.08 xserver-xorg-core \ - xserver-xorg-video-intel" - -if [ $FLAGS_stable -eq $FLAGS_TRUE ] -then - # Passed to copy_chrome_zip.sh to get stable version of the browser - export GET_STABLE_CHROME=1 -fi - -if [ $FLAGS_new_build -eq $FLAGS_TRUE ]; then - # chromiumos-build works out the build order for itself. - PACKAGES='dh-chromeos libchrome libchromeos' - for PKG in $PLATFORM_DIRS $THIRD_PARTY_PACKAGES; do - # Handle some special-case naming. - case $PKG in - e2fsprogs/files) - PACKAGES="$PACKAGES e4fsprogs-git" - ;; - ibus-anthy|ibus-chewing|ibus-hangul) - # These are difficult to cross-build right now, and we can live - # without them temporarily. - if [ "$FLAGS_architecture" = i386 ]; then - PACKAGES="$PACKAGES ${PKG%/*}" - else - echo "WARNING: Skipping $PKG on $FLAGS_architecture" - fi - ;; - *) - PACKAGES="$PACKAGES ${PKG%/*}" - ;; - esac - done - verbose chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES -else - # Build dh-chromeos really first. Some of third_party needs it. - echo "Building package dh-chromeos..." - cd "$PLATFORM_DIR/dh-chromeos" - ./make_pkg.sh - cd - - - # Build third_party packages first, since packages and libs depend on them. - for i in $THIRD_PARTY_PACKAGES - do - echo "Building package ${i}..." - cd "$THIRD_PARTY_DIR/$i" - ./make_pkg.sh - cd - - done - - # Build base lib next, since packages depend on it. - echo "Building base library..." - cd "$THIRD_PARTY_DIR/chrome" - ./make_pkg.sh - cd - - - #Build common lib next. - echo "Building common library..." - cd "$SRC_ROOT/common" - ./make_pkg.sh - cd - - - # Build platform packages - for i in $PLATFORM_DIRS - do - echo "Building package ${i}..." - cd "$PLATFORM_DIR/$i" - ./make_pkg.sh - cd - - done -fi - -echo "All packages built." diff --git a/customize_rootfs.sh b/customize_rootfs.sh deleted file mode 100755 index e6946febcf..0000000000 --- a/customize_rootfs.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Script to customize the root file system after packages have been installed. -# -# NOTE: This script should be called by build_image.sh. Do not run this -# on your own unless you know what you are doing. - -# Load common constants. This should be the first executable line. -# The path to common.sh should be relative to your script's location. -. "$(dirname "$0")/common.sh" - -# Script must be run inside the chroot -assert_inside_chroot - -# Flags -DEFINE_string arch "x86" \ - "The target architecture to build for. One of { x86, arm }." -DEFINE_string root "" \ - "The root file system to customize." - -# Parse command line -FLAGS "$@" || exit 1 -eval set -- "${FLAGS_ARGV}" - -# Die on any errors. -set -e - -ROOT_FS_DIR="$FLAGS_root" -if [[ -z "$ROOT_FS_DIR" ]]; then - echo "Error: --root is required." - exit 1 -fi -if [[ ! -d "$ROOT_FS_DIR" ]]; then - echo "Error: Root FS does not exist? ($ROOT_FS_DIR)" - exit 1 -fi - -# Determine default user full username. -if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then - FULLNAME="Google Chrome OS User" -else - FULLNAME="Chromium OS User" -fi - -# Determine what password to use for the default user. -CRYPTED_PASSWD_FILE="${SCRIPTS_DIR}/shared_user_passwd.txt" -if [ -f $CRYPTED_PASSWD_FILE ]; then - echo "Using password from $CRYPTED_PASSWD_FILE" - CRYPTED_PASSWD=$(cat $CRYPTED_PASSWD_FILE) -else - # Use a random password. unix_md5_crypt will generate a random salt. - echo "Using random password." - PASSWORD="$(base64 /dev/urandom | head -1)" - CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)" - PASSWORD="gone now" -fi - -# Set up a default user and add to sudo and the required groups. -ADD_USER="chronos" -ADD_GROUPS="audio video" -SHELL="/bin/sh" -if [[ -x "${ROOT_FS_DIR}/bin/bash" ]] ; then - SHELL="/bin/bash" -fi -echo "${ADD_USER}:x:1000:1000:${FULLNAME}:/home/${ADD_USER}/:${SHELL}" | \ - sudo dd of="${ROOT_FS_DIR}/etc/passwd" conv=notrunc oflag=append -echo "${ADD_USER}:${CRYPTED_PASSWD}:14500:0:99999::::" | \ - sudo dd of="${ROOT_FS_DIR}/etc/shadow" conv=notrunc oflag=append -echo "${ADD_USER}:x:1000:" | \ - sudo dd of="${ROOT_FS_DIR}/etc/group" conv=notrunc oflag=append -for i in $ADD_GROUPS; do - sudo sed -i "s/^\($i:x:[0-9]*:.*\)/\1,${ADD_USER}/g" \ - "${ROOT_FS_DIR}"/etc/group -done - -sudo mkdir -p "${ROOT_FS_DIR}/home/${ADD_USER}" -sudo chown 1000.1000 "${ROOT_FS_DIR}/home/${ADD_USER}" -cat < .*//; s,^/$,/.,; s,/$,,' > \ - "${dpkg_info}/${package}.list" - - # Mark the package as installed successfully. - echo "Status: install ok installed" >> "$dpkg_status" - cat "${tmpdir}/control" >> "$dpkg_status" - echo "" >> "$dpkg_status" - - rm -rf "$tmpdir" - - # Run our maintainer script for this package if we have one. - local chromium_preinst="${SRC_ROOT}/package_scripts/${package}.preinst" - if [ -f "$chromium_preinst" ]; then - echo "Running: ${chromium_preinst}" - ROOT="$FLAGS_root" SRC_ROOT="$SRC_ROOT" $chromium_preinst - fi - - echo "Unpacking: $p" - dpkg-deb --extract "$p" "$FLAGS_root" - done -} - -# This script requires at least "--root=" -if [ -z "$FLAGS_root" ]; then - echo "dpkg_no_scripts: Missing root directory." - exit 1 -fi - -if [ $FLAGS_configure -eq $FLAGS_TRUE ]; then - do_configure $@ -elif [ $FLAGS_unpack -eq $FLAGS_TRUE ]; then - do_unpack $@ -elif [ $FLAGS_remove -eq $FLAGS_TRUE ]; then - # We log but ignore remove requests. - echo "Ignoring remove: $@" -else - echo "dpkg_no_scripts.sh: Unknown or missing command." - exit 1 -fi - -exit 0 diff --git a/install_packages.sh b/install_packages.sh deleted file mode 100755 index 2ed454ab67..0000000000 --- a/install_packages.sh +++ /dev/null @@ -1,313 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Script to install packages into the target root file system. -# -# NOTE: This script should be called by build_image.sh. Do not run this -# on your own unless you know what you are doing. - -# Load common constants. This should be the first executable line. -# The path to common.sh should be relative to your script's location. -. "$(dirname "$0")/common.sh" - -# Script must be run inside the chroot -assert_inside_chroot -assert_not_root_user - -DEFAULT_PKGLIST="${SRC_ROOT}/package_repo/package-list-prod.txt" - -# Flags -DEFINE_string output_dir "" \ - "The location of the output directory to use [REQUIRED]." -DEFINE_string root "" \ - "The root file system to install packages in." -DEFINE_string arch "x86" \ - "The target architecture to build for. One of { x86, armel }." -DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ - "Root of build output" -DEFINE_string package_list "$DEFAULT_PKGLIST" \ - "Comma separated set of package-list files to use." -DEFINE_string mirror "$DEFAULT_IMG_MIRROR" \ - "The upstream package mirror to use." -DEFINE_string suite "$DEFAULT_IMG_SUITE" \ - "The upstream package suite to use." -DEFINE_string mirror2 "" "Additional package mirror to use (URL only)." -DEFINE_string suite2 "" "Package suite for additional mirror." - -# Parse command line -FLAGS "$@" || exit 1 -eval set -- "${FLAGS_ARGV}" - -# Die on any errors. -set -e - -KERNEL_DEB_PATH=$(find "${FLAGS_build_root}/${FLAGS_arch}/local_packages" \ - -name "linux-image-*.deb") -KERNEL_DEB=$(basename "${KERNEL_DEB_PATH}" .deb | sed -e 's/linux-image-//' \ - -e 's/_.*//') -KERNEL_VERSION=${KERNEL_VERSION:-${KERNEL_DEB}} - -if [[ -z "$FLAGS_output_dir" ]]; then - echo "Error: --output_dir is required." - exit 1 -fi -OUTPUT_DIR=$(readlink -f "$FLAGS_output_dir") -SETUP_DIR="${OUTPUT_DIR}/local_repo" -ROOT_FS_DIR="${OUTPUT_DIR}/rootfs" -if [[ -n "$FLAGS_root" ]]; then - ROOT_FS_DIR=$(readlink -f "$FLAGS_root") -fi -mkdir -p "$OUTPUT_DIR" "$SETUP_DIR" "$ROOT_FS_DIR" - -# Make sure anything mounted in the rootfs is cleaned up ok on exit. -cleanup_rootfs_mounts() { - # Occasionally there are some daemons left hanging around that have our - # root image file system open. We do a best effort attempt to kill them. - PIDS=`sudo lsof -t "$ROOT_FS_DIR" | sort | uniq` - for pid in $PIDS - do - local cmdline=`cat /proc/$pid/cmdline` - echo "Killing process that has open file on our rootfs: $cmdline" - ! sudo kill $pid # Preceded by ! to disable ERR trap. - done - - # Sometimes the volatile directory is left mounted and sometimes it is not, - # so we precede by '!' to disable the ERR trap. - ! sudo umount "$ROOT_FS_DIR"/lib/modules/2.6.*/volatile/ > /dev/null 2>&1 - - sudo umount "${ROOT_FS_DIR}/proc" -} - -# Set up repository for locally built packages; these take highest precedence. -mkdir -p "${SETUP_DIR}/local_packages" -cp "${FLAGS_build_root}/${FLAGS_arch}/local_packages"/*.deb \ - "${SETUP_DIR}/local_packages" -cd "$SETUP_DIR" -dpkg-scanpackages local_packages/ /dev/null | \ - gzip > local_packages/Packages.gz -cd - - -# Create the temporary apt source.list used to install packages. -APT_SOURCE="${OUTPUT_DIR}/sources.list" -cat < "$APT_SOURCE" -deb copy:"$SETUP_DIR" local_packages/ -deb $FLAGS_mirror $FLAGS_suite main restricted multiverse universe -EOF -if [ -n "$FLAGS_mirror2" ] && [ -n "$FLAGS_suite2" ]; then - cat <> "$APT_SOURCE" -deb $FLAGS_mirror2 $FLAGS_suite2 main restricted multiverse universe -EOF -fi -# Look for official file and use it if it exists -if [ -f ${SRC_ROOT}/package_repo/sources-official.list ]; then - cat ${SRC_ROOT}/package_repo/sources-official.list >> "$APT_SOURCE" -fi - -# Cache directory for APT to use. This cache is re-used across builds. We -# rely on the cache to reduce traffic to the hosted repositories. -APT_CACHE_DIR="${FLAGS_build_root}/apt_cache-${FLAGS_arch}/" -mkdir -p "${APT_CACHE_DIR}/archives/partial" - -if [ "${FLAGS_arch}" = x86 ]; then - APT_ARCH=i386 -else - APT_ARCH="${FLAGS_arch}" -fi - -# Create the apt configuration file. See "man apt.conf" -APT_PARTS="${OUTPUT_DIR}/apt.conf.d" -mkdir -p "$APT_PARTS" # An empty apt.conf.d to avoid other configs. -export APT_CONFIG="${OUTPUT_DIR}/apt.conf" -cat < "$APT_CONFIG" -APT -{ - Install-Recommends "0"; - Install-Suggests "0"; - Get - { - Assume-Yes "1"; - AllowUnauthenticated "1"; - }; - Architecture "${APT_ARCH}"; -}; -Dir -{ - Bin { - dpkg "${SCRIPTS_DIR}/dpkg_no_scripts.sh"; - }; - Cache "$APT_CACHE_DIR"; - Cache { - archives "${APT_CACHE_DIR}/archives"; - }; - Etc - { - sourcelist "$APT_SOURCE"; - parts "$APT_PARTS"; - }; - State "${ROOT_FS_DIR}/var/lib/apt/"; - State - { - status "${ROOT_FS_DIR}/var/lib/dpkg/status"; - }; -}; -DPkg -{ - options {"--root=${ROOT_FS_DIR}";}; -}; -EOF - -# TODO: Full audit of the apt conf dump to make sure things are ok. -apt-config dump > "${OUTPUT_DIR}/apt.conf.dump" - -# We do a rough equivalent to debootstrap that installs the minimal -# packages needed to be able to run apt to install the rest. We don't -# use debootstrap since it is geared toward having a second stage that -# needs to run package maintainer scripts. This is also simpler. - -# The set of required packages before apt can take over. -PACKAGES="debconf libacl1 libattr1 libc6 libgcc1 libselinux1" - -# Set of packages that we need to install early so that other packages -# maintainer scripts can still basically run. -# -# login - So that groupadd will work -# base-passwd/passwd - So that chmod and useradd/groupadd will work -# bash - So that scripts can run -# libpam-runtime/libuuid1 - Not exactly sure why -# sysv-rc - So that we can overwrite invoke-rc.d, update-rc.d -EXTRA_PACKAGES="base-files base-passwd bash libpam-runtime libuuid1 login passwd sysv-rc mawk" - -# Prep the rootfs to work with dpgk and apt -sudo mkdir -p "${ROOT_FS_DIR}/var/lib/dpkg/info" -sudo touch "${ROOT_FS_DIR}/var/lib/dpkg/available" \ - "${ROOT_FS_DIR}/var/lib/dpkg/diversions" \ - "${ROOT_FS_DIR}/var/lib/dpkg/status" -sudo mkdir -p "${ROOT_FS_DIR}/var/lib/apt/lists/partial" \ - "${ROOT_FS_DIR}/var/lib/dpkg/updates" - -# Download the initial packages into the apt cache if necessary. -REPO="${APT_CACHE_DIR}/archives" -sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive apt-get update -sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ - apt-get --download-only install $PACKAGES $EXTRA_PACKAGES - -# Install initial packages directly with dpkg_no_scripts.sh -ARCH="$FLAGS_arch" -if [ "$ARCH" = "x86" ]; then - ARCH="i?86" # Match i386 | i686 -fi -for p in $PACKAGES $EXTRA_PACKAGES; do - PKG=$(ls "${REPO}"/${p}_*_$ARCH.deb || /bin/true) - if [ -z "$PKG" ]; then - PKG=$(ls "${REPO}"/${p}_*_all.deb) - fi - sudo ARCH="$FLAGS_arch" "${SCRIPTS_DIR}"/dpkg_no_scripts.sh \ - --root="$ROOT_FS_DIR" --nodpkg_fallback --unpack "$PKG" - sudo ARCH="$FLAGS_arch" "${SCRIPTS_DIR}"/dpkg_no_scripts.sh \ - --root="$ROOT_FS_DIR" --nodpkg_fallback --configure "$p" -done - -# Make sure that apt is ready to work. We use --fix-broken to trigger apt -# to install additional critical packages. If there are any of these, we -# disable the maintainer scripts so they install ok. -TMP_FORCE_NO_SCRIPTS="-o=DPkg::options::=--nodpkg_fallback" -sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive ARCH="$FLAGS_arch"\ - apt-get $TMP_FORCE_NO_SCRIPTS --force-yes --fix-broken install - -# TODO: Remove these hacks when we stop having maintainer scripts altogether. -sudo cp -a /dev/* "${ROOT_FS_DIR}/dev" -sudo cp -a /etc/resolv.conf "${ROOT_FS_DIR}/etc/resolv.conf" -sudo ln -sf /bin/true "${ROOT_FS_DIR}/usr/sbin/invoke-rc.d" -sudo ln -sf /bin/true "${ROOT_FS_DIR}/usr/sbin/update-rc.d" - -# Set up mounts for working within the rootfs. We copy some basic -# network information from the host so that maintainer scripts can -# access the network as needed. -# TODO: All of this rootfs mount stuff can be removed as soon as we stop -# running the maintainer scripts on install. -sudo mount -t proc proc "${ROOT_FS_DIR}/proc" -trap cleanup_rootfs_mounts EXIT - -filter_pkgs() { - pkglist="$1" - arch="$2" - - # to read list of package + version skipping empty lines and comments, and - # convert "foo 1.2-3" to "foo=1.2-3", use: - #pkgs="$(grep '^[^#]' "$pkglist" | cut -d ' ' -f 1-2 | sed 's/ /=/')" - - # read list of "package [optional arch list]" skipping empty lines and - # comments - grep '^[^#]' "$pkglist" | while read pkg archspec; do - case "$archspec" in - ""|"[$arch "*|"[$arch]"|*" $arch]") - echo "$pkg" - ;; - *"!$arch "*|*"!$arch]") - : - ;; - "["*"!"*"]") - echo "$pkg" - ;; - esac - done -} - -# Install packages from the given package-lists -PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g') -PKG_LIST_ARCH="$FLAGS_arch" -if [ "$PKG_LIST_ARCH" = "x86" ]; then - PKG_LIST_ARCH="i386" - FORCE_NO_SCRIPTS="" -else - # For armel we forcefully disable all maintainer scripts. - # TODO: Remove this when everything is whitelisted for all build variants. - FORCE_NO_SCRIPTS="-o=DPkg::options::=--nodpkg_fallback" -fi -for p in $PACKAGE_LISTS; do - COMPONENTS=$(filter_pkgs "$p" "$PKG_LIST_ARCH") - sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ - ARCH="$FLAGS_arch" \ - apt-get $FORCE_NO_SCRIPTS --force-yes install $COMPONENTS -done - -# Create kernel installation configuration to suppress warnings, -# install the kernel in /boot, and manage symlinks. -cat < \ - "${OUTPUT_DIR}/package_list_installed.txt" - -cleanup_rootfs_mounts -trap - EXIT diff --git a/recursive_dep.py b/recursive_dep.py deleted file mode 100644 index 2bcfc637db..0000000000 --- a/recursive_dep.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -from sets import Set -import subprocess -import sys -import time - -preferred_virtual_pkg_providers = { - '': 'debconf', - '': 'libgl1-mesa-glx', - '': 'module-init-tools', - '': 'xvt', - '': 'xserver-xorg-input-kbd', - '': 'xserver-xorg-video-dummy' -} - -# if we have a set of packages to choose from, we see if any packages we -# can choose from are in this list (starting from element 0). if we find a -# match, we use that, otherwise the script just picks one from the set -preferred_packages = [ - 'debconf', - 'debconf-english', - 'ttf-bitstream-vera', - 'libgl1-mesa-glx', - 'module-init-tools', - '', - 'xserver-xorg-input-kbd', - 'xserver-xorg-video-dummy', - '', - '', - 'udev' -] - -def isVirtualPackage(packagename): - return packagename.startswith('<') and packagename.endswith('>') - -def providerForVirtualPkg(packagename): - # check for any pre-chosen packages - if packagename in preferred_virtual_pkg_providers: - return preferred_virtual_pkg_providers[packagename] - - name = packagename.strip('<>') - lines = subprocess.Popen(['apt-cache', 'showpkg', name], - stdout=subprocess.PIPE).communicate()[0].split('\n') - if len(lines) < 2: - print 'too few lines!', packagename - sys.exit(1) - got_reverse_provides_line = False - for line in lines: - if got_reverse_provides_line: - # just take the first one - provider = line.split(' ')[0] - if provider == '': - print 'no provider for', packagename - sys.exit(1) - print '"' + provider + '" provides "' + packagename + '"' - return provider - got_reverse_provides_line = line.startswith('Reverse Provides:') - print 'didn\'t find a provider for', packagename - sys.exit(1) - -def getDepsFor(packagename): - results = subprocess.Popen(['apt-cache', 'depends', packagename], - stdout=subprocess.PIPE).communicate()[0] - lines = results.split('\n') - if len(lines) < 2: - print 'too few lines!', packagename - sys.exit(1) - ret = Set() - prefix = ' Depends: ' - # If a package depends on any in a set of packages then each possible package - # in the set, except for the last one, will have a pipe before Depends. - # For example: - # Depends: foo - # Depends: bar - # |Depends: baz - # |Depends: bat - # |Depends: flower - # Depends: candle - # Depends: trunk - # means this package depends on foo, bar, trunk, and any one of baz, bat, - # flower, and candle. - # I couldn't find this documented anywhere. - set_prefix = ' |Depends: ' - dep_set = Set() - for line in lines: - if line.startswith(set_prefix): - dep_set.add(line[len(set_prefix):]) - continue - if not line.startswith(prefix): - dep_set.clear() - continue - pkgname = line[len(prefix):] - if len(dep_set) > 0: - dep_set.add(pkgname) - # we need to pick one from dep_set - found_pref = False - for pref in preferred_packages: - if pref in dep_set: - print 'using pref to choose "' + pref + '" from set ' + str(dep_set) - pkgname = pref - found_pref = True - break - if not found_pref: - print 'chose "' + pkgname + '" from set ' + str(dep_set) - dep_set.clear() - ret.add(pkgname) - print packagename + ' has deps: ' + str(ret) - return ret - -def main(argv): - checked = Set() - unchecked = Set() - for arg in argv[1:]: - unchecked.add(arg) - while True: - directdeps = Set() - for pkg in unchecked: - if isVirtualPackage(pkg): - pkg = providerForVirtualPkg(pkg) - directdeps = directdeps.union(getDepsFor(pkg)) - checked.add(pkg) - directdeps = directdeps.difference(checked) - unchecked = directdeps - if len(unchecked) == 0: - print 'done' - checked_list = list(checked) - checked_list.sort() - print 'all:', checked_list - print 'total of ' + str(len(checked_list)) + ' items' - sys.exit(0) - - -if __name__ == '__main__': - main(sys.argv)