From a2400d48ca3d82690a22b4d938e495884b21bbe1 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 14 Jan 2010 20:49:12 +0000 Subject: [PATCH] Native build import script Add a script to import all binary packages for a given source package from ports.ubuntu.com, convert and install them using 'chromiumos-build --convert', and write out a fake .changes file so that chromiumos-build doesn't try to re-import them. Use it like this: ./import_native_build.sh anthy libchewing For the moment, there are a number of source packages that won't cross-build successfully but that can be imported from native Ubuntu builds, and this wraps up the process of doing so. Review URL: http://codereview.chromium.org/543059 --- import_native_build.sh | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 import_native_build.sh diff --git a/import_native_build.sh b/import_native_build.sh new file mode 100755 index 0000000000..f7c2b5b8af --- /dev/null +++ b/import_native_build.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright (c) 2010 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" + +assert_inside_chroot +assert_not_root_user + +# Flags +DEFINE_string architecture armel "The architecture to fetch." a + +# Parse command line +FLAGS "$@" || exit 1 +eval set -- "${FLAGS_ARGV}" + +# Die on error +set -e + +cd "${DEFAULT_BUILD_ROOT}/${FLAGS_architecture}/local_packages" + +DEB_BUILD_ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)" + +DEBS= +for SRC; do + SRCCACHE="$(apt-cache showsrc "$SRC")" + BINS="$(echo "$SRCCACHE" | grep -m1 ^Binary: | cut -d' ' -f2- | sed 's/,//g')" + VER="$(echo "$SRCCACHE" | grep -m1 ^Version: | cut -d' ' -f2)" + for BIN in $BINS; do + BINCACHE="$(apt-cache show "$BIN")" || continue # might be a udeb + DEB="$(echo "$BINCACHE" | grep -m1 ^Filename: | cut -d' ' -f2 | sed "s/_${DEB_BUILD_ARCH}\.deb/_${FLAGS_architecture}.deb/")" + wget -N "http://ports.ubuntu.com/ubuntu-ports/${DEB}" + DEBS="$DEBS ${DEB##*/}" + done + cat >"${SRC}_${VER#*:}_${FLAGS_architecture}.changes" <