bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Create package from write protected directory #185

Open ma3xxx3 opened 7 years ago

ma3xxx3 commented 7 years ago

Hello,

I am trying to create package for cross compiler that contains directories with permission 555 and it produce the following error:

/ ===> Installing into /home/dev/fpm-test/tmp-dest
/usr/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir': Permission denied @ dir_s_mkdir - /tmp/package-dir-    staging-a46f4d4b9162b3969cef27b2f40d191fa368a72670d31db42c9d0e5f50d9/opt/x-tools/raspbpi_musl/arm-rpi-linux-musleabihf (Errno::EACCES)
    from /usr/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
    from /usr/lib/ruby/2.3.0/fileutils.rb:182:in `block in mkdir'
    from /usr/lib/ruby/2.3.0/fileutils.rb:181:in `each'
    from /usr/lib/ruby/2.3.0/fileutils.rb:181:in `mkdir'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:192:in `copy'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:162:in `block in clone'
    from /usr/lib/ruby/2.3.0/find.rb:49:in `block (2 levels) in find'
    from /usr/lib/ruby/2.3.0/find.rb:48:in `catch'
    from /usr/lib/ruby/2.3.0/find.rb:48:in `block in find'
    from /usr/lib/ruby/2.3.0/find.rb:43:in `each'
    from /usr/lib/ruby/2.3.0/find.rb:43:in `find'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:160:in `clone'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:71:in `block in input'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:69:in `chdir'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/package/dir.rb:69:in `input'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/command.rb:338:in `block in execute'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/command.rb:337:in `each'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/command.rb:337:in `execute'
    from /var/lib/gems/2.3.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/lib/fpm/command.rb:560:in `run'
    from /var/lib/gems/2.3.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
    from /var/lib/gems/2.3.0/gems/fpm-1.8.1/bin/fpm:8:in `<top (required)>'
    from /usr/local/bin/fpm:23:in `load'
    from /usr/local/bin/fpm:23:in `<main>'

When I try to create package from directory with fpm as fakeroot everithing works, but I can't compile cross compiler as root therefore I can't run fpm-cook as root.

Is there any way how to use fpm from fpm-cookery as fakeroot? Thanks