mojohaus / rpm-maven-plugin

http://www.mojohaus.org/rpm-maven-plugin/
Other
56 stars 48 forks source link

Lack of directory quoting #32

Open drewr opened 8 years ago

drewr commented 8 years ago

We have the unfortunate scenario where we need to use the Jenkins matrix builder along with some label expressions. Long story short, we end up with workspace directory names that have && in them :sob:.

Most of our plugins can fortunately deal with this, but there is some code that rpm-maven-plugin generates which doesn't properly quote its source:

%install

if [ -d $RPM_BUILD_ROOT ];
then
  mv /home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/tmp-buildroot/* $RPM_BUILD_ROOT
else
  mv /home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/tmp-buildroot $RPM_BUILD_ROOT
fi
chmod -R +w $RPM_BUILD_ROOT

And so we end up with:

[INFO] Building target platforms: noarch-pc-linux
[INFO] Building for target noarch-pc-linux
[INFO] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.jhACBe
[INFO] + umask 022
[INFO] + cd /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/BUILD
[INFO] + [ -d /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/buildroot ]
[INFO] + mv /d/home/tmp/elasticsearch-bad
[INFO] mv: missing destination file operand after '/d/home/tmp/elasticsearch-bad'
[INFO] Try 'mv --help' for more information.
[INFO] + chmod -R +w /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/buildroot

And maven-powered branches across the Elasticsearch build farm die.

khmarbaise commented 8 years ago

May be you can offer an PR which fixes the problem..