sbt/sbt-native-packager — Issue #3: Packaging fails for RPM & DEB if there is a space in the directory path
Author: randomcoder
Created: 2012-01-31 15:00:21+00:00
State: open

Both the `rpm:package-bin` and `debian:package-bin` targets fail if the project is located at a path that has a space in the filename.

Output from `debian:package-bin` for a project located in `/home/me/a/path with/spaces/project`
{{{
chmod: cannot access `/home/me/a/path': No such file or directory
chmod: cannot access `with/spaces/project/target/project-1.0.0-SNAPSHOT': No such file or directory
chmod: cannot access `/home/me/a/path: No such file or directory
chmod: cannot access `with/spaces/project/target/project-1.0.0-SNAPSHOT/DEBIAN': No such file or directory
}}}

Output from `rpm:package-bin for the same project
{{{
[info] Loading project definition from /home/me/a/path with/spaces/project
[info] Set current project to project (in build file:/home/me/a/path%20with/spaces/project/)
[info] Building target platforms: noarch-Us-Linux
[info] Building for target noarch-Us-Linux
[info] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.jlFbsx
[info]
[info]
[info] RPM build errors:
[error] + umask 022
[error] + cd /home/me/a/path with/spaces/project/target/rpm/BUILD
[error] + [ -e /home/me/a/path with/spaces/project/target/rpm/buildroot ]
[error] [: 1: /home/me/a/path: unexpected operator
[error] + mv /home/me/a/path with/spaces/project/target/rpm/tmp-buildroot /home/me/a/path with/spaces/project/target/rpm/buildroot
[error] mv: target `with/spaces/project/target/rpm/buildroot' is not a directory
[error] error: Bad exit status from /var/tmp/rpm-tmp.jlFbsx (%install)
[error] Bad exit status from /var/tmp/rpm-tmp.jlFbsx (%install)
[error] {file:/home/me/a/path%20with/spaces/project/}default-fe4988/rpm:package-bin: Unable to run rpmbuild, check output for details.
}}}