Skip to content

Commit

Permalink
removed all trailing whitespace: for i in $(git ls-files); do sed -i …
Browse files Browse the repository at this point in the history
…tmp -e "s/ *$//" $i; done
  • Loading branch information
tmm1 committed Jul 8, 2011
1 parent 8ab101d commit bf4752c
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CHANGELIST
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
Example:
--python-bin=/usr/bin/python2.7
--python-easyinstall=/usr/bin/easy_install2.7

0.2.26 and earlier
No changelist tracked. My bad, yo.
2 changes: 1 addition & 1 deletion NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ packages with fpm in debian. It will likely require a one-time addition to
site.py (/usr/lib/python2.6/site.py) or some other PYTHONPATH hackery, though
I don't know just yet.

It will also require special setup.py invocations as Debian has patched distutils to
It will also require special setup.py invocations as Debian has patched distutils to
install python packages, by default, to a place that requires again the
python-central/support tools to run to make them work.
6 changes: 3 additions & 3 deletions bin/fpm-npm
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Dir.glob("#{builddir}/usr/lib/node/.npm/*/*") do |path|
# So we'll specify deps of {v}-1 <= x <= {v}-999999....
depends = Dir.glob("#{path}/dependson/*@*") \
.collect { |p| PACKAGEPREFIX + File.basename(p) } \
.collect { |p| n,v = p.split("@");
["#{n} (>= #{v}-1)", "#{n} (<= #{v}-99999999999999)"]
.collect { |p| n,v = p.split("@");
["#{n} (>= #{v}-1)", "#{n} (<= #{v}-99999999999999)"]
}.flatten

if package["author"]
Expand All @@ -73,7 +73,7 @@ Dir.glob("#{builddir}/usr/lib/node/.npm/*/*") do |path|
maintainer = "#{m["name"]} <#{m["email"]}>"
end

pkgcmd = [ "fpm",
pkgcmd = [ "fpm",
"-n", "#{PACKAGEPREFIX}#{package["name"]}",
"-v", package["version"],
"-m", maintainer,
Expand Down
2 changes: 1 addition & 1 deletion examples/fpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Should make the package. Try installing:

Now try it:

$ /opt/fpm/bin/fpm --help
$ /opt/fpm/bin/fpm --help
2 changes: 1 addition & 1 deletion examples/jruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Should make the package. Try installing:

Now try it:

% /opt/jruby/bin/jirb
% /opt/jruby/bin/jirb
>> require "java"
=> true
>> java.lang.System.out.println("Hello")
Expand Down
2 changes: 1 addition & 1 deletion examples/python/twisted/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ usr: twisted
cd twisted; python setup.py bdist
tar -zxf twisted/dist/Twisted-$(VERSION).linux-$(shell uname -m).tar.gz

package: usr
package: usr
fpm -s dir -t deb -n $(NAME) -v $(VERSION) \
-p python-$(NAME)-VERSION_ARCH.deb -d "python" \
usr
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def initialize(settings, paths=[])
@edit = !!settings.edit

@paths = paths
@package = package_class_for(settings.package_type).new(@source,
@package = package_class_for(settings.package_type).new(@source,
:settings => settings.target
)
# Append dependencies given from settings (-d flag for fpm)
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(opts, flag_prefix, help_prefix)
def on(*args, &block)
fixed_args = args.collect do |arg|
if arg =~ /^--/
"--#{@flag_prefix}-#{arg.gsub(/^--/, "")}"
"--#{@flag_prefix}-#{arg.gsub(/^--/, "")}"
else
"(#{@help_prefix}) #{arg}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def default_output
end # def default_output

def fixpath(path)
if path[0,1] != "/"
if path[0,1] != "/"
path = File.join(@source.root, path)
end
return path if File.symlink?(path)
Expand Down
4 changes: 2 additions & 2 deletions lib/fpm/program.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def default_options(opts)

opts.on("-v VERSION", "--version VERSION",
"version to give the package") do |version|
@settings.version = version
@settings.version = version
end # --version

opts.on("--iteration ITERATION",
Expand Down Expand Up @@ -152,7 +152,7 @@ def default_options(opts)

opts.on("-s SOURCE_TYPE", "what to build the package from") do |st|
@settings.source_type = st
end # -s
end # -s

opts.on("-S PACKAGE_SUFFIX", "which suffix to append to package and dependencies") do |sfx|
@settings.suffix = sfx
Expand Down
6 changes: 3 additions & 3 deletions lib/fpm/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def tar(output, paths, chdir=".")
paths = [ paths ] if paths.is_a? String
paths.each do |path|
while path != "/" and path != "."
dirs << path if !dirs.include?(path)
dirs << path if !dirs.include?(path)
path = File.dirname(path)
end
end # paths.each

# Want directories to be sorted thusly: [ "/usr", "/usr/bin" ]
# Why? tar and some package managers sometimes fail if the tar is created
# like: [ "/opt/fizz", "/opt" ]
Expand Down Expand Up @@ -136,7 +136,7 @@ def tar(output, paths, chdir=".")
end
end # def tar

def tar_cmd
def tar_cmd
# Rely on gnu tar for solaris.
case %x{uname -s}.chomp
when "SunOS"
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/source/dir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def make_tarball!(tar_path, builddir)
@paths.each do |path|
# Trim @root (--chdir)
if @root != "." and path.start_with?(@root)
path = path[@root.size .. -1]
path = path[@root.size .. -1]
end

# Copy to self[:prefix] (aka --prefix)
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/source/pyfpm/get_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run(self):
dependencies = self.distribution.install_requires
except:
pass

# In some cases (Mysql-Python) 'dependencies' is none, not empty.
if dependencies is None:
dependencies = []
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/source/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_source(params)
return
end

if !File.exists?(package)
if !File.exists?(package)
download(package, params[:version])
else
@paths = [ File.expand_path(package) ]
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/target/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def fix_dependency(dep)
end

name_re = /^[^ \(]+/
name = dep[name_re]
name = dep[name_re]
if name =~ /[A-Z]/
@logger.warn("Downcasing dependency '#{name}' because deb packages " \
" don't work so good with uppercase names")
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/target/puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generate_specfile(builddir)
dir = File.join(builddir, "manifests", File.dirname(manifest))
@logger.info("manifests targeting: #{dir}")
::Dir.mkdir(dir) if !File.directory?(dir)

File.open(File.join(builddir, "manifests", manifest), "w") do |f|
@logger.info("manifest: #{f.path}")
template = template(File.join("puppet", "#{manifest}.erb"))
Expand Down
4 changes: 2 additions & 2 deletions lib/fpm/target/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def architecture
when "all"
# Translate fpm "all" arch to what it means in RPM.
return "noarch"
else
else
return @architecture
end
end # def architecture
Expand All @@ -30,7 +30,7 @@ def build!(params)
end

%w(BUILD RPMS SRPMS SOURCES SPECS).each { |d| Dir.mkdir(d) }
args = ["rpmbuild", "-ba",
args = ["rpmbuild", "-ba",
"--define", "buildroot #{Dir.pwd}/BUILD",
"--define", "_topdir #{Dir.pwd}",
"--define", "_sourcedir #{Dir.pwd}",
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/target/solaris.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def architecture
when nil, "native"
@architecture = %x{uname -p}.chomp
end
# "all" is a valid arch according to
# "all" is a valid arch according to
# http://www.bolthole.com/solaris/makeapackage.html

return @architecture
Expand Down
8 changes: 4 additions & 4 deletions lib/rpm/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def read
# At this point assume we've read and consumed the lead and signature.
#len = @rpm.signature.index_length + @rpm.signature
#
# header size is
# header size is
# ( @rpm.signature.index_length * size of a header entry )
# + @rpm.signature.data_length
#
# header 'entries' are an
# header 'entries' are an
# int32 (tag id), int32 (tag type), int32 (offset), uint32 (count)
#
# See rpm's header.c, the headerLoad method function for reference.
Expand All @@ -43,7 +43,7 @@ def read
@index_size = @index_count * entry_size
tag_data = @rpm.file.read(@index_size)
data = @rpm.file.read(@data_length)

#ap :data => data

(0 ... @index_count).each do |i|
Expand All @@ -55,7 +55,7 @@ def read
@tags << tag

#ap tag.tag => {
#:type => tag.type,
#:type => tag.type,
#:offset => tag.offset,
#:count => tag.count,
#:value => (tag.value rescue "???"),
Expand Down
6 changes: 3 additions & 3 deletions lib/rpm/lead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class RPMFile::Lead
#struct rpmlead {
attr_accessor :magic #unsigned char magic[4];
attr_accessor :magic #unsigned char magic[4];
attr_accessor :major #unsigned char major;
attr_accessor :minor #unsigned char minor;
attr_accessor :type #short type;
Expand All @@ -12,7 +12,7 @@ class RPMFile::Lead
attr_accessor :signature_type #short signature_type;
attr_accessor :reserved #char reserved[16];
#}

attr_accessor :length

def initialize(rpm)
Expand All @@ -29,7 +29,7 @@ def type
raise "Unknown package 'type' value #{@type}"
end
end # def type

def read
# Use 'A' here instead of 'a' to trim nulls.
@length = 96
Expand Down
2 changes: 1 addition & 1 deletion lib/rpm/rpmfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# source code, but mostly it started making more sense after reading this site:
# http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html

class RPMFile
class RPMFile
attr_reader :file

def initialize(file)
Expand Down
16 changes: 8 additions & 8 deletions misc/pkgsrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ ! -f "build/usr/local/bin/bmake" ] ; then
# TODO(sissel): Maybe bootstrap ourselves.
echo "This script requires pkgsrc to be bootstrapped in a specific way."
echo "I expected to find file: build/usr/local/bin/bmake and did not"
echo
echo
echo "Bootstrap with:"
echo "SH=/bin/bash ./bootstrap/bootstrap --unprivileged --prefix $PWD/build/usr/local --pkgdbdir $PWD/pkgdb"
exit 1
Expand All @@ -37,7 +37,7 @@ for target in $TARGETS; do
set --

eval "$(bmake -C $target show-vars-eval VARS="PKGNAME PKGVERSION")"
name="$(echo "$PKGNAME" | sed -e "s/-$PKGVERSION\$//")"
name="$(echo "$PKGNAME" | sed -e "s/-$PKGVERSION\$//")"
orig_version=${PKGVERSION}
version=${PKGVERSION}-pkgsrc

Expand All @@ -52,8 +52,8 @@ for target in $TARGETS; do
clean package || exit 1

# Start building fpm args
set -- -n "$name" -v "$version" --prefix $LOCALBASE
set -- -n "$name" -v "$version" --prefix $LOCALBASE

# Skip the pkgsrc package metadata files
set -- "$@" --exclude '+*'

Expand All @@ -64,9 +64,9 @@ for target in $TARGETS; do
set -- "$@" -d "$PKGNAME (= $PKGVERSION-pkgsrc)"
done

set -- -s tar -t deb "$@"
set -- "$@" packages/All/$name-$orig_version.tgz
fpm "$@"
set -- -s tar -t deb "$@"
set -- "$@" packages/All/$name-$orig_version.tgz
fpm "$@"
done


2 changes: 1 addition & 1 deletion templates/deb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Provides: <%= provides.join(", ") -%>
Replaces: <%= properrepl.flatten.join(", ") %>
<% end -%>
Standards-Version: 3.9.1
Section: <%= category or "unknown" %>
Section: <%= category or "unknown" %>
Priority: extra
Homepage: <%= url or "http://nourlgiven.example.com/" %>
Description: <%= name %> (FPM-generated package)
Expand Down
4 changes: 2 additions & 2 deletions templates/rpm.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Group: <%= category %>
TODO: [Jay] rpms require a license
let's detect it intelligently
-%>
License: <%= license %>
License: <%= license %>
URL: <%= url or "http://nourlgiven.example.com/" %>
Source0: %{_sourcedir}/data.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Expand All @@ -28,7 +28,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
nextversion = version.split(".").collect { |v| v.to_i }
l = nextversion.length
nextversion[l-2] += 1
nextversion[l-1] = 0
nextversion[l-1] = 0
nextversion = nextversion.join(".")
["#{name} >= #{version}", "#{name} < #{nextversion}"]
# Convert gem >= A.B.C <= X.Y.Z to '>= A.B.C' and '<= X.Y.Z'
Expand Down

0 comments on commit bf4752c

Please sign in to comment.