Skip to content
This repository

fpm creates debs with underscores, but cannot consume them #340

Closed
ToddG opened this Issue · 10 comments

3 participants

Todd Greenwood-Geer Jordan Sissel Pranay Kanwar
Todd Greenwood-Geer
fpm -s dir -t deb -a all -n 'jdk6u' -v 1.6.0.37 /opt/local/java/java6/jdk1.6.0_37
fpm -s dir -t deb -a all -n 'product' -v 1.0 -d ./jdk6u_1.6.0.37_all.deb product

Where:
/opt/local/java/java6/... is a java6 jdk installation
and ./product is a dummy application src tree

Error:
Created deb package {"path":"/home/todd/releases/jdk6u_1.6.0.37_all.deb"}
Replacing underscores with dashes in './jdk6u_1.6.0.37_all.deb' because debs don't like underscores {"level":"warn"}
/var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:339:in `gsub!': can't modify frozen string (TypeError)
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:339:in `fix_dependency'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:304:in `converted_from'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:303:in `collect'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:303:in `converted_from'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package.rb:208:in `convert'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/command.rb:396:in `execute'
    from /var/lib/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in `run'
    from /var/lib/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/bin/fpm:8
    from /usr/local/bin/fpm:19:in `load'
    from /usr/local/bin/fpm:19

Q: Why is fpm creating a debian package that it cannot consume? Is there a workaround?

Jordan Sissel
Owner

I'm confused. The error "Replacing underscores ..." shows up after the "Created deb package" one?

Todd Greenwood-Geer
  1. This line executes fine
    fpm -s dir -t deb -a all -n 'jdk6u' -v 1.6.0.37 /opt/local/java/java6/jdk1.6.0_37

  2. It generates this artifact
    /home/todd/releases/jdk6u_1.6.0.37_all.deb

  3. But then, this line fails
    fpm -s dir -t deb -a all -n 'product' -v 1.0 -d ./jdk6u_1.6.0.37_all.deb product

  4. And returns this error:
    Created deb package {"path":"/home/todd/releases/jdk6u_1.6.0.37_all.deb"}
    Replacing underscores with dashes in './jdk6u_1.6.0.37_all.deb' because debs don't like underscores {"level":"warn"}
    /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:339:in gsub!': can't modify frozen string (TypeError)
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:339:in
    fix_dependency'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:304:in converted_from'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:303:in
    collect'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package/deb.rb:303:in converted_from'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/package.rb:208:in
    convert'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/lib/fpm/command.rb:396:in execute'
    from /var/lib/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in
    run'
    from /var/lib/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in run'
    from /var/lib/gems/1.8/gems/fpm-0.4.26/bin/fpm:8
    from /usr/local/bin/fpm:19:in
    load'
    from /usr/local/bin/fpm:19

  5. So basically, the deb created in line #1 cannot be used in line #3.

Jordan Sissel
Owner

Oooh, I see now.

Ok, so, I'll explain the intended operation first - The '-d' flag is meant to specify a dependency, such as -d 'jdk6u = 1.6.0.37 with a 'name operator version' style, where name is the name of the package to depend on, operator is "=", ">" etc, and version is the version of that package.

You're using -d in a strange (but perhaps a fair) way.

First thing, let's fix your command line so you can move on with your work:

fpm -s dir -t deb -a all -n 'product' -v 1.0 -d "jdk6u = 1.6.0.37" product

Second, I'm open to supporting your use case (specifying a dependency by giving the path to a package file), but only if the solution above isn't acceptable to you.

Let me know :)

Todd Greenwood-Geer
Todd Greenwood-Geer
Jordan Sissel
Owner

debian/ubuntu have "preseed" feature that lets you answer questions (like the mysql root password) about a package's installation before you install it. I don't know how to use this system since I do not use it, but I know it exists.

As for what happens during upgrades, I don't know and it may be implementation dependent (apt-get upgrade may do different things than yum, in different orders, etc) - no idea ;)

Jordan Sissel
Owner

debian/ubuntu have "preseed" feature that lets you answer questions (like the mysql root password) about a package's installation before you install it. I don't know how to use this system since I do not use it, but I know it exists.

As for what happens during upgrades, I don't know and it may be implementation dependent (apt-get upgrade may do different things than yum, in different orders, etc) - no idea ;)

Todd Greenwood-Geer
Todd Greenwood-Geer
Pranay Kanwar
Collaborator
r4um commented

@ToddG best way would be host your own repository of packages and then install from there, invoking package
manager in pre-install is a bad idea. For hosting/building your own repository consider

Pranay Kanwar r4um closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.