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.
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:
And so we end up with:
And maven-powered branches across the Elasticsearch build farm die.