From: Stephen Date: Mon, 10 Jul 2017 16:28:51 +0000 (-0700) Subject: Continuous output and failure X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/commitdiff_plain/06e5ec1f12a9a70f0044f19d82633f4127666242 Continuous output and failure some attempt at using dpkg for termux package installs instead of rebuilding from source --- diff --git a/.travis.yml b/.travis.yml index 5e19cd0a..b23cca08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: ruby sudo: required -services: - - docker +cache: bundler +services: docker before_script: mkdir debs && chmod 777 debs - diff --git a/Rakefile b/Rakefile index ae966bfd..c0927c0f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ require 'rugged' +require 'pty' task default: %w[build] @@ -6,13 +7,32 @@ task :build do repo = Rugged::Repository.new('.') commit = repo.head.target parent = commit.parents.first - paths = commit.diff(parent).deltas.map { |d| d.new_file[:path] } - paths = paths.map { |p| Pathname.new(p).each_filename.to_a } - # looking for packages/[package]/... - packages = paths.map { |p| p[1] if p.length > 2 and p[0] == "packages" } - packages = packages.flatten.uniq - packages.each do |package| - puts package - printf `./scripts/run-docker.sh ./build-package.sh #{package}` + pkgs = commit.diff(parent).deltas.map { |d| d.new_file[:path] } + # Split paths into arrays + pkgs.map! { |p| Pathname.new(p).each_filename.to_a } + # looking for [disabled-]packages/(package_name)/... + pkgs.select! { |p| p.length > 2 and p[0] =~ /(?)packages/ } + # Get package_name + pkgs.map! { |p| p[1] } + # Remove duplicate packages + pkgs.uniq! + pkgs.each do |pkg| + puts "Building #{pkg}" + begin + # Start blocking build loop + PTY.spawn("./scripts/run-docker.sh ./build-package.sh #{pkg}") do |stdout, stdin, pid| + begin + stdout.each { |line| print line } + rescue Errno::EIO + end + end + rescue PTY::ChildExited + puts "Process exited" + end + # Exit if PTY return a non-zero code + if $?.exitstatus != 0 + STDERR.puts("Error building #{pkg}") + exit($?.exitstatus) + end end end diff --git a/build-package.sh b/build-package.sh index 325f1fb1..54a32d16 100755 --- a/build-package.sh +++ b/build-package.sh @@ -308,6 +308,21 @@ termux_step_start_build() { for p in $TERMUX_ALL_DEPS; do if [ "$p" != "$TERMUX_PKG_NAME" ]; then echo "Building dependency $p if necessary..." + # TODO use apt and dpkg to install instead of building + # Add apt repository and key, update + # TODO move this install to Dockerfile + sudo apt-get update && sudo apt-get install -y software-properties-common + sudo add-apt-repository "deb [arch=all,$TERMUX_ARCH] http://termux.net stable main" + cat $TERMUX_SCRIPTDIR/packages/apt/trusted.gpg | sudo apt-key add - + sudo apt-get update && sudo dpkg --add-architecture $TERMUX_ARCH + sudo apt-get -d install ${p}:${TERMUX_ARCH} + # TODO delete debug info + echo "SGROAT DEBUG" + ls -lah /var/cache/apt/archives + echo "SGROAT DEBUG" + # TODO figure out what the root is? + sudo dpkg --root $TERMUX_PREFIX --configure -a + sudo dpkg --root $TERMUX_PREFIX -i /var/cache/apt/archives/${p}_*_${TERMUX_ARCH}.deb ./build-package.sh -a $TERMUX_ARCH -s "$p" fi done diff --git a/packages/git/build.sh b/packages/git/build.sh index 6eb14a14..fb1ea697 100755 --- a/packages/git/build.sh +++ b/packages/git/build.sh @@ -1,6 +1,6 @@ TERMUX_PKG_HOMEPAGE=https://git-scm.com/ TERMUX_PKG_DESCRIPTION="Distributed version control system designed to handle everything from small to very large projects with speed and efficiency" -# less is required as a pager for git log, and the busybox less does not handle used escape sequences. +# less is required as a pager for git log, and the busybox less does not handle used escape sequences TERMUX_PKG_DEPENDS="libcurl, less" TERMUX_PKG_VERSION=2.13.3 TERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${TERMUX_PKG_VERSION}.tar.xz diff --git a/packages/libuv/build.sh b/packages/libuv/build.sh index 62acb348..c62acdd7 100644 --- a/packages/libuv/build.sh +++ b/packages/libuv/build.sh @@ -3,7 +3,6 @@ TERMUX_PKG_DESCRIPTION="Support library with a focus on asynchronous I/O" TERMUX_PKG_VERSION=1.13.1 TERMUX_PKG_SRCURL=http://dist.libuv.org/dist/v${TERMUX_PKG_VERSION}/libuv-v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=824fe07476a9cab519d2d3e2be6d49f1faa1e7bb59224f0d81a7d6a307ce3937 - termux_step_pre_configure () { export PLATFORM=android sh autogen.sh