Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Unified Diff: src/scripts/import_native_build.sh

Issue 543059: Native build import script (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/import_native_build.sh
diff --git a/src/scripts/import_native_build.sh b/src/scripts/import_native_build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..f7c2b5b8af5a07ae1d8b7729d8f68653df958f0f
--- /dev/null
+++ b/src/scripts/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" <<EOF
+Version: $VER
+Fake: yes
+EOF
+done
+
+if [ "$DEBS" ]; then
+ chromiumos-build --convert -a "${FLAGS_architecture}" $DEBS
+fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698