[Pkg-puppet-devel] [facter] 261/352: (FACT-332) Warn when the packaging tasks aren't loaded

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit aa9ee28bfb0480fbb76d7d3beeea4eab2728cfbf
Author: Matthaus Owens <matthaus at puppetlabs.com>
Date:   Fri Feb 14 10:24:38 2014 -0800

    (FACT-332) Warn when the packaging tasks aren't loaded
---
 tasks/cfppropertylist.rake | 11 -----------
 tasks/cfpropertylist.rake  | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/tasks/cfppropertylist.rake b/tasks/cfppropertylist.rake
deleted file mode 100644
index 4b2db3d..0000000
--- a/tasks/cfppropertylist.rake
+++ /dev/null
@@ -1,11 +0,0 @@
-task 'cfpropertylist' do
-  cfp_version = "2.2.7"
-  libdir = File.join(Pkg::Config.project_root, "lib")
-  source = "https://github.com/ckruse/CFPropertyList/archive/cfpropertylist-#{cfp_version}.tar.gz"
-  target_dir = Pkg::Util::File.mktemp
-  target = File.join(target_dir, "cfpropertylist")
-  Pkg::Util::Net.fetch_uri(source, target)
-  Pkg::Util::File.untar_into(target, target_dir, "--strip-components 1")
-  mv(Dir.glob("#{File.join(target_dir, "lib")}/cfpropertylist*"), libdir)
-  mv(Dir.glob("#{target_dir}/{LICENSE,README,THANKS}"), File.join(libdir, "cfpropertylist"))
-end
diff --git a/tasks/cfpropertylist.rake b/tasks/cfpropertylist.rake
new file mode 100644
index 0000000..907dd8d
--- /dev/null
+++ b/tasks/cfpropertylist.rake
@@ -0,0 +1,15 @@
+task 'cfpropertylist' do
+  if defined? Pkg::Config and Pkg::Config.project_root
+    cfp_version = "2.2.7"
+    libdir = File.join(Pkg::Config.project_root, "lib")
+    source = "https://github.com/ckruse/CFPropertyList/archive/cfpropertylist-#{cfp_version}.tar.gz"
+    target_dir = Pkg::Util::File.mktemp
+    target = File.join(target_dir, "cfpropertylist")
+    Pkg::Util::Net.fetch_uri(source, target)
+    Pkg::Util::File.untar_into(target, target_dir, "--strip-components 1")
+    mv(Dir.glob("#{File.join(target_dir, "lib")}/cfpropertylist*"), libdir)
+    mv(Dir.glob("#{target_dir}/{LICENSE,README,THANKS}"), File.join(libdir, "cfpropertylist"))
+  else
+    warn "It looks like the packaging tasks have not been loaded. You'll need to `rake package:bootstrap` before using this task"
+  end
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list