Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Special characters in filepaths break RPM #209

Open
vStone opened this Issue · 11 comments

3 participants

@vStone
$ mkdir test
$ touch 'test/Funky [filename].txt'
$ fpm -t rpm -s dir -n funky -v 0.1 test/

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.JPg6o1
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.I67MV8
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.vNEstg
Processing files: funky-0.1-1.x86_64
error: File not found by glob: /tmp/package-rpm-build20120420-2234-1g4fcsm/BUILD/test/Funky [\[]filename].txt


RPM build errors:
    File not found by glob: /tmp/package-rpm-build20120420-2234-1g4fcsm/BUILD/test/Funky [\[]filename].txt
/home/jan/.gem/ruby/1.8/gems/fpm-0.4.6/lib/fpm/util.rb:33:in `safesystem': rpmbuild failed (exit code 1). Full command was:["rpmbuild", "-bb", "--define", "buildroot /tmp/package-rpm-build20120420-2234-1g4fcsm/BUILD", "--define", "_topdir /tmp/package-rpm-build20120420-2234-1g4fcsm", "--define", "_sourcedir /tmp/package-rpm-build20120420-2234-1g4fcsm", "--define", "_rpmdir /tmp/package-rpm-build20120420-2234-1g4fcsm/RPMS", "/tmp/package-rpm-build20120420-2234-1g4fcsm/SPECS/funky.spec"] (FPM::Util::ProcessFailed)
    from /home/jan/.gem/ruby/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:172:in `output'
    from /home/jan/.gem/ruby/1.8/gems/fpm-0.4.6/lib/fpm/command.rb:332:in `execute'
    from /home/jan/.gem/ruby/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in `run'
    from /home/jan/.gem/ruby/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
    from /home/jan/.gem/ruby/1.8/gems/fpm-0.4.6/bin/fpm:8
    from /home/jan/.local/bin/fpm:19:in `load'
    from /home/jan/.local/bin/fpm:19

@jordansissel

I swear I already fixed this. Hm...

@jordansissel

What OS and what's the output of rpmbuild --version?

@jordansissel

Yeah in theory this was fixed by #202, and I even wrote tests for it (fa062f0).

@jordansissel

I think this is a bug in rpm, unless there's a way to solve this. The problem is a filename with a space and a glob ([) character are in use.

I know of no way to present this filename in a way that rpm will use. I"ll ask the rpm folks.

@jordansissel

I emailed the rpm mailing list; hopeful for a good solution :)

@vStone

A bit late in my responses it seems ;)

Running on gentoo,
RPM version 4.9.1.2
ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]

@jordansissel

no worries, having the versions is very useful :)

@jordansissel
Owner

Solving this appropriately will require writing my own rpm creation library (basically, add write support to the 'arr-pm' gem I maintain)

@cckweiss

Was this ever resolved? I just tripped over it myself. I'm trying to package a custom application that incorporates the mini_magick-3.6.0 gem. Under .../mini_magick-3.6.0/test/files is a file named, exactly:

special! "chars'.gif

When fpm asks rpm to process this, rpm chokes and dies with the following error:

Two files on one line: /shared/bundle/ruby/2.0.0/gems/mini_magick-3.6.0/test/files/special! {:level=>:error}
File must begin with "/": chars'.gif" {:level=>:error}

I'm running RPM version 4.4.2.3 on SUSE (actually SLES) 11.3 and Ruby 1.8.7 (2013-06-27 patchlevel 374)

I guess I can just rename the file to eliminate the special characters, as it is only part of a test suite and not actually used for anything in production, but if there's a fix for this I'd like to do it right. Thanks!

@jordansissel
Owner

Not yet. Best I can tell, there are certain file names that you cannot possibly use with rpmbuild. I've made escapes for all the possible options I know of, but the next step is to eliminate rpmbuild itself.

So no proper fix yet, but you can exclude files in packaging with fpm with the --exclude flag, if that helps :\

@cckweiss

OK, thanks for the update. And thanks for all your work on FPM. I like it. I'm a sysadmin, and I want my developers to start using packages to migrate from development into staging and production, so I can manage everything with Puppet and versioned objects instead of having them build from source into each environment.

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.