Author drunax
Recipients drunax
Date 2014-03-02.13:01:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393765276.38.0.208615952915.issue20824@psf.upfronthosting.co.za>
In-reply-to
Content
When having spaces in the path which represents the root for the build on going, rpmbuild from bdist_rpm will fail:


----------------------------------------------------
+ python setup.py install -O1 --root=/home/lex/Development/4. Test/11. ARTA/build/src/rpm/BUILDROOT/efw-arta-3.0.1_0.test0-0.x86_64 --record=INSTALLED_FILES
invalid command name 'Test/11.'
error: Bad exit status from /var/tmp/rpm-tmp.cbEEZl (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.cbEEZl (%install)
error: command 'rpmbuild' failed with exit status 1
----------------------------------------------------

With this patch it will work:

--- bdist_rpm-BAK.py	2014-03-02 14:52:31.501744617 +0200
+++ bdist_rpm.py	2014-03-02 14:53:10.705746243 +0200
@@ -512,8 +512,8 @@
         # that we open and interpolate into the spec file, but the defaults
         # are just text that we drop in as-is.  Hmmm.
 
-        install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
-                       '--record=INSTALLED_FILES') % def_setup_call
+        install_cmd = ('%s install -O1 --root="$RPM_BUILD_ROOT" '
+                       '--record="INSTALLED_FILES"') % def_setup_call
 
         script_options = [
             ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),


but then another roadblock is hit:


+ cp -pr CHANGELOG /home/lex/Development/4. Test/11. ARTA/build/src/rpm/BUILDROOT/efw-safi-3.0.1_0.test0-0.x86_64/usr/share/doc/efw-arta-3.0.1_0.test0
cp: cannot stat `CHANGELOG': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.1tO2OV (%doc)
error: File not found: /home/lex/Development/4. Test/11. ARTA/build/src/rpm/BUILDROOT/efw-arta-3.0.1_0.test0-0.x86_64/usr/share/doc/efw-arta-3.0.1_0.test0


seems stat also needs quoted path:

lex@hemvi:~/Development/4. Test/11. ARTA/build$ stat --format="%a" /home/lex/Development/4. Test/11. ARTA/build/CHANGELOG ; echo $?
755
stat: cannot stat `Test/11.': No such file or directory
stat: cannot stat `ARTA/build/CHANGELOG': No such file or directory
1

lex@hemvi:~/Development/4. Test/11. ARTA/build$ stat --format="%a" "/home/lex/Development/4. Test/11. ARTA/build/CHANGELOG" ; echo $?
644
0


I guess all the calls need to be rewritten to take into account spaces in the path. This would be too laborious, thus perhaps we should warn in documentation packagers/developers not to use spaces in path when building?
History
Date User Action Args
2014-03-02 13:01:16drunaxsetrecipients: + drunax
2014-03-02 13:01:16drunaxsetmessageid: <1393765276.38.0.208615952915.issue20824@psf.upfronthosting.co.za>
2014-03-02 13:01:16drunaxlinkissue20824 messages
2014-03-02 13:01:15drunaxcreate