Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- only wrap system() if we're in debug mode

- fix a bug in dir target regarding handling "." and "./"
- clean up some verbosity
- solaris: parse pkgproto output ourselves
  • Loading branch information...
commit 67257a6bcfa94a58a4b54bfe7ad931cd8871cefe 1 parent d54f728
Jordan Sissel authored
Showing with 25 additions and 18 deletions.
  1. +7 −5 bin/fpm
  2. +3 −1 lib/fpm/source/dir.rb
  3. +15 −12 lib/fpm/target/solaris.rb
12 bin/fpm
View
@@ -6,11 +6,13 @@ $: << File.join(File.dirname(__FILE__), "..", "lib")
require "fpm"
require "fpm/program"
-module Kernel
- alias :orig_system :system
- def system(*args)
- p :system => args
- orig_system(*args)
+if $DEBUG
+ module Kernel
+ alias :orig_system :system
+ def system(*args)
+ p :system => args
+ orig_system(*args)
+ end
end
end
4 lib/fpm/source/dir.rb
View
@@ -15,7 +15,9 @@ def make_tarball!(tar_path, builddir)
# Prefix all files with a path if given.
@paths.each do |path|
# Trim @root (--chdir)
- path = path[@root.size .. -1] if path.start_with?(@root)
+ if @root != "." and path.start_with?(@root)
+ path = path[@root.size .. -1]
+ end
# Copy to self[:prefix] (aka --prefix)
if File.directory?(path)
27 lib/fpm/target/solaris.rb
View
@@ -45,24 +45,27 @@ def build!(params)
Dir.mkdir("data")
system("gzip -d data.tar.gz");
Dir.chdir("data") do
- system("tar -vxf ../data.tar");
+ system("tar -xf ../data.tar");
end
- system("(echo 'i pkginfo'; pkgproto data=/) > Prototype")
+ #system("(echo 'i pkginfo'; pkgproto data=/) > Prototype")
# Generate the package 'Prototype' file
# TODO(sissel): allow setting default file owner.
- #File.open("Prototype", "w") do |prototype|
- #IO.popen("tar -tf data.tar | pkgproto").each_line do |line|
- #type, klass, path, mode, user, group = line.split
- ## Override pkgproto
- #user = "root"
- #group = "root"
- #prototype.puts([type, klass, "/#{path}", mode, user, group].join(" "))
- #end
- #end
+ File.open("Prototype", "w") do |prototype|
+ prototype.puts("i pkginfo")
+ # TODO(sissel): preinstall/postinstall
+ IO.popen("pkgproto data=/").each_line do |line|
+ type, klass, path, mode, user, group = line.split
+ # Override stuff in pkgproto
+ # TODO(sissel): Make this tunable?
+ user = "root"
+ group = "root"
+ prototype.puts([type, klass, path, mode, user, group].join(" "))
+ end # popen "pkgproto ..."
+ end # File prototype
- # Should create a directory named by the package name.
+ # Should create a package directory named by the package name.
system("pkgmk -o -d .")
# Convert the 'package directory' built above to a real solaris package.
Please sign in to comment.
Something went wrong with that request. Please try again.