Index: build/linux/sysroot_scripts/sysroot-creator.sh |
diff --git a/build/linux/sysroot_scripts/sysroot-creator.sh b/build/linux/sysroot_scripts/sysroot-creator.sh |
index 2be45bb43b688601ecaaf4aa81974a02fffd6895..39f7b7f5a55d13bb3d607e88002032305c527c33 100644 |
--- a/build/linux/sysroot_scripts/sysroot-creator.sh |
+++ b/build/linux/sysroot_scripts/sysroot-creator.sh |
@@ -7,6 +7,7 @@ |
# to define certain environment variables: e.g. |
# DISTRO=ubuntu |
# DIST=trusty |
+# DIST_UPDATES=trusty-updates |
# APT_REPO=http://archive.ubuntu.com/ubuntu |
# KEYRING_FILE=/usr/share/keyrings/ubuntu-archive-keyring.gpg |
# DEBIAN_PACKAGES="gcc libz libssl" |
@@ -103,8 +104,10 @@ DownloadOrCopy() { |
echo "$1" | grep -qs ^http:// && HTTP=1 |
if [ "$HTTP" = "1" ]; then |
SubBanner "downloading from $1 -> $2" |
- wget "$1" -O "${2}.partial" |
- mv "${2}.partial" $2 |
+ # Appending the "$$" shell pid is necessary here to prevent concurrent |
+ # instances of sysroot-creator.sh from trying to write to the same file. |
+ wget "$1" -O "${2}.partial.$$" |
+ mv "${2}.partial.$$" $2 |
Sam Clegg
2016/12/12 22:11:52
Under what circumstances might that happen? Shou
Tom (Use chromium acct)
2016/12/13 00:06:19
It happens when downloading eg jessie-Release and
|
else |
SubBanner "copying from $1" |
cp "$1" "$2" |
@@ -554,7 +557,7 @@ BuildSysrootMips() { |
return |
fi |
ClearInstallDir |
- local package_file="$BUILD_DIR/package_with_sha256sum_arm" |
+ local package_file="$BUILD_DIR/package_with_sha256sum_mips" |
GeneratePackageListMips "$package_file" |
local files_and_sha256sums="$(cat ${package_file})" |
StripChecksumsFromPackageList "$package_file" |
@@ -813,6 +816,89 @@ UpdatePackageListsAll() { |
RunCommand UpdatePackageListsMips |
} |
+DumpStringsStderr() { |
+ echo "$1" | xargs echo | tr ' ' '\n' | sort 1>&2 |
+} |
+ |
+#@ |
+#@ DumpPackageListsAmd64 |
+#@ |
+#@ Prints required packages for amd64 architecture to stderr. |
+DumpPackageListsAmd64() { |
+ DumpStringsStderr "${DEBIAN_PACKAGES} ${DEBIAN_PACKAGES_X86:=} |
+ ${DEBIAN_PACKAGES_AMD64:=}" |
+} |
+ |
+#@ |
+#@ DumpPackageListsI386 |
+#@ |
+#@ Prints required packages for i386 architecture to stderr. |
+DumpPackageListsI386() { |
+ DumpStringsStderr "${DEBIAN_PACKAGES} ${DEBIAN_PACKAGES_X86:=}" |
+} |
+ |
+#@ |
+#@ DumpPackageListsARM |
+#@ |
+#@ Prints required packages for arm architecture to stderr. |
+DumpPackageListsARM() { |
+ DumpStringsStderr "${DEBIAN_PACKAGES} ${DEBIAN_PACKAGES_ARM:=}" |
+} |
+ |
+#@ |
+#@ DumpPackageListsARM64 |
+#@ |
+#@ Prints required packages for arm64 architecture to stderr. |
+DumpPackageListsARM64() { |
+ DumpStringsStderr "${DEBIAN_PACKAGES} ${DEBIAN_PACKAGES_ARM64:=}" |
+} |
+ |
+#@ |
+#@ DumpPackageListsMips |
+#@ |
+#@ Prints required packages for mips architecture to stderr. |
+DumpPackageListsMips() { |
+ DumpStringsStderr "${DEBIAN_PACKAGES}" |
+} |
Sam Clegg
2016/12/12 22:11:52
Are any of these new Dump* functions used anywhere
Tom (Use chromium acct)
2016/12/13 00:06:19
No, forgot to remove them :)
|
+ |
+#@ |
+#@ PrintArchitectures |
+#@ |
+#@ Prints supported architectures. |
+PrintArchitectures() { |
+ if [ "$HAS_ARCH_AMD64" = "1" ]; then |
+ echo Amd64 |
+ fi |
+ if [ "$HAS_ARCH_I386" = "1" ]; then |
+ echo I386 |
+ fi |
+ if [ "$HAS_ARCH_ARM" = "1" ]; then |
+ echo ARM |
+ fi |
+ if [ "$HAS_ARCH_ARM64" = "1" ]; then |
+ echo ARM64 |
+ fi |
+ if [ "$HAS_ARCH_MIPS" = "1" ]; then |
+ echo Mips |
+ fi |
+} |
+ |
+#@ |
+#@ PrintDistro |
+#@ |
+#@ Prints distro. eg: ubuntu |
+PrintDistro() { |
+ echo ${DISTRO} |
+} |
+ |
+#@ |
+#@ DumpRelease |
+#@ |
+#@ Prints disto release. eg: trusty |
+PrintRelease() { |
+ echo ${DIST} |
+} |
+ |
RunCommand() { |
SetEnvironmentVariables "$1" |
SanityCheck |
@@ -831,7 +917,7 @@ elif [ "$(type -t $1)" != "function" ]; then |
exit 1 |
else |
ChangeDirectory |
- if echo $1 | grep -qs "All$"; then |
+ if echo $1 | grep -qs --regexp='\(^Print\)\|\(All$\)'; then |
"$@" |
else |
RunCommand "$@" |