summaryrefslogtreecommitdiff
path: root/habitat
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2017-01-24 19:17:13 +0000
committerGitHub <noreply@github.com>2017-01-24 19:17:13 +0000
commit6e0f2e616e18b892e28672d53f9c8bef89f59116 (patch)
tree9de520f961dd61084eb0371599ab29215913b79e /habitat
parent70e91314625adf2c373c8bfc39ce6fbd4e7c0edf (diff)
parent0faa99824f3dcf47984f1c178f006c5f033f14b2 (diff)
downloadchef-6e0f2e616e18b892e28672d53f9c8bef89f59116.tar.gz
Merge pull request #5730 from robbkidd/speed-up-unpack
use git archive to speed up putting source in place
Diffstat (limited to 'habitat')
-rw-r--r--habitat/plan.sh36
1 files changed, 19 insertions, 17 deletions
diff --git a/habitat/plan.sh b/habitat/plan.sh
index 32c5943217..7a797842e2 100644
--- a/habitat/plan.sh
+++ b/habitat/plan.sh
@@ -4,12 +4,27 @@ pkg_maintainer="The Chef Maintainers <humans@chef.io>"
pkg_description="The Chef Client"
pkg_version=$(cat ../VERSION)
pkg_source=nosuchfile.tar.gz
+pkg_filename=${pkg_dirname}.tar.gz
pkg_license=('Apache-2.0')
pkg_bin_dirs=(bin)
-pkg_build_deps=(core/make core/gcc core/coreutils core/rsync core/git)
+pkg_build_deps=(core/make core/gcc core/coreutils core/git)
pkg_deps=(core/glibc core/ruby core/libxml2 core/libxslt core/libiconv core/xz core/zlib core/bundler core/openssl core/cacerts core/libffi)
pkg_svc_user=root
+do_download() {
+ build_line "Fake download! Creating archive of latest repository commit."
+ # source is in this repo, so we're going to create an archive from the
+ # appropriate path within the repo and place the generated tarball in the
+ # location expected by do_unpack
+ cd $PLAN_CONTEXT/../
+ git archive --prefix=${pkg_name}-${pkg_version}/ --output=$HAB_CACHE_SRC_PATH/${pkg_filename} HEAD
+}
+
+do_verify() {
+ build_line "Skipping checksum verification on the archive we just created."
+ return 0
+}
+
do_prepare() {
export OPENSSL_LIB_DIR=$(pkg_path_for openssl)/lib
export OPENSSL_INCLUDE_DIR=$(pkg_path_for openssl)/include
@@ -18,7 +33,6 @@ do_prepare() {
build_line "Setting link for /usr/bin/env to 'coreutils'"
[[ ! -f /usr/bin/env ]] && ln -s $(pkg_path_for coreutils)/bin/env /usr/bin/env
- rsync -vaP --delete --exclude habitat --exclude results --exclude .git --exclude Gemfile.lock $PLAN_CONTEXT/../ $HAB_CACHE_SRC_PATH/$pkg_dirname
return 0
}
@@ -30,7 +44,7 @@ do_build() {
local _libxslt_dir=$(pkg_path_for libxslt)
local _zlib_dir=$(pkg_path_for zlib)
- export GEM_HOME=${pkg_path}
+ export GEM_HOME=${pkg_prefix}
export GEM_PATH=${_bundler_dir}:${GEM_HOME}
export NOKOGIRI_CONFIG="--use-system-libraries --with-zlib-dir=${_zlib_dir} --with-xslt-dir=${_libxslt_dir} --with-xml2-include=${_libxml2_dir}/include/libxml2 --with-xml2-lib=${_libxml2_dir}/lib"
@@ -53,8 +67,8 @@ do_build() {
cp chef-config/pkg/chef-config-$pkg_version.gem gems-suck/gems
bundle exec gem generate_index -d gems-suck
- sed -e "s#gem \"chef\".*#gem \"chef\", source: \"file://$HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck\"#" -i Gemfile
- sed -e "s#gem \"chef-config\".*#gem \"chef-config\", source: \"file://$HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck\"#" -i Gemfile
+ sed -e "s#gem \"chef\".*#gem \"chef\", source: \"file://$HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck\"#" -i Gemfile
+ sed -e "s#gem \"chef-config\".*#gem \"chef-config\", source: \"file://$HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck\"#" -i Gemfile
#bundle config --local local.chef $HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck
#bundle config --local local.chef-config $HAB_CACHE_SRC_PATH/$pkg_dirname/gems-suck
@@ -81,18 +95,6 @@ do_install() {
}
# Stubs
-do_verify() {
- return 0
-}
-
-do_download() {
- return 0
-}
-
-do_unpack() {
- return 0
-}
-
do_strip() {
return 0
}