dnbert / prm

PRM Allows you to quickly build package repositories, inspired by Jordan Sissels' FPM
MIT License
250 stars 33 forks source link

Invalid Packages File #33

Closed klen closed 10 years ago

klen commented 10 years ago

Hello,

Thank you for the tool. I try to setup repository and using fpm and prm.

My Makefile shortcut looks like:

TARGET?=$(CURDIR)/deb
PACKAGE_VERSION?=$(shell git describe --tags `git rev-list master --tags --max-count=1`) 
PACKAGE_NAME="vim-python-mode"
PACKAGE_MAINTAINER="Kirill Klenov <horneds@gmail.com>"
PACKAGE_URL=http://github.com/klen/python-mode
deb: clean $(CURDIR)/build
    @fpm -s dir -t deb -a all \
    -n $(PACKAGE_NAME) \
    -v $(PACKAGE_VERSION) \
    -m $(PACKAGE_MAINTAINER) \
    --url $(PACKAGE_URL) \
    --license "GNU lesser general public license" \
    --description "Vim-Swissknife for python" \
    --deb-user root \
    --deb-group root \
    -C $(CURDIR)/build \
    -d "python2.7" \
    -d "vim-addon-manager" \
    usr
    @mkdir -p $(TARGET)
    @prm --type deb --path $(TARGET) \
    --release precise \
    --arch amd64,i386,all \
    --component main \
    --directory $(CURDIR) \
    --gpg horneds@gmail.com

Fpm makes build as well and prm prepares repo. But generated Packages have error:

Package: vim-python-mode
Version: 0.7.4b
License: GNU lesser general public license
Vendor: horneds@pulsar-22.local
Architecture: all
Maintainer: Kirill Klenov <horneds@gmail.com>
Installed-Size: 2297
Depends: python2.7, vim-addon-manager
Section: default
Priority: extra
Homepage: http://github.com/klen/python-mode
Description: Vim-Swissknife for pythonFilename: dists/precise/main/binary-amd64/vim-python-mode_0.7.4b_all.deb
MD5sum: a0647e24058288ad9c7159bf8fdb2137
Size: 522308

Description and Filename are merged in one string. So, the generated repository is invalid.

My gem list:

$ gem list

*** LOCAL GEMS ***

addressable (2.3.5)
arr-pm (0.0.8)
aws-s3 (0.6.3)
backports (3.3.5)
bigdecimal (1.2.0)
builder (3.2.2)
cabin (0.6.1)
childprocess (0.3.9)
clamp (0.6.3)
ffi (1.9.3)
fpm (0.4.42)
ftw (0.0.36)
http_parser.rb (0.5.3)
io-console (0.4.2)
json (1.7.7)
mime-types (2.0)
minitest (4.3.2)
peach (0.5.1)
prm (0.2.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
test-unit (2.0.0.0)
xml-simple (1.1.2)
klen commented 10 years ago

As temporary solution I just add another one '\n' to Packages file generation. And it fix my problem.

diff --git a/lib/prm/repo.rb b/lib/prm/repo.rb
index 1a055e2..6e9a727 100755
--- a/lib/prm/repo.rb
+++ b/lib/prm/repo.rb
@@ -131,6 +131,7 @@ module Debian
            write_mutex.synchronize do
                # Copy the control file data into the Packages list
                d.write(File.read("tmp/#{tdeb}/control").chomp)
+                d.write("\n")
                d.write(package_info.join("\n"))
                d.write("\n") # blank line between package info in the Packages file
            end
saintaardvark commented 10 years ago

I just tripped over this as well. Worse, I think it was my patch adding the chomp that might've caused this. :-(

dnbert commented 10 years ago

Sorry for the delay! Holiday season has got me rolling over.

I've merged this latest pull request from saintaardvark. I'll be uploading the new gem to rubygems.org shortly