AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

RPM Build error when spaces exist in file name #3

Closed jyhi closed 9 years ago

jyhi commented 9 years ago

For example, when building scribus 1.4.4:

RPM build errors:

File must begin with "/": Farbe
File must begin with "/": erleben_bs01_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Kunstdruck_bs01_3.eps
File must begin with "/": System
File must begin with "/": Prase_bs00_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Naturpapier_bs00_3.eps
File must begin with "/": Farbe
File must begin with "/": erleben_kd01_4.eps
File must begin with "/": K_kd01_4.eps
File must begin with "/": System
File must begin with "/": Prase_bs01_3.eps
File must begin with "/": 6510_zd01_4.eps
File must begin with "/": Color_bs00_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Kunstdruck_kd01_4.eps
File must begin with "/": Colour-Line_kd01_4.eps
File must begin with "/": Colour-Line_bs01_3.eps
File must begin with "/": 451_bs01_3.eps
File must begin with "/": 6510_kd01_4.eps
File must begin with "/": ip
File must begin with "/": Oberputze_bs00_3.eps
File must begin with "/": ip
File must begin with "/": Oberputze_zd01_4.eps
File must begin with "/": 840_np01_4.eps
File must begin with "/": Collection
File must begin with "/": 4000_zd01_4.eps
File must begin with "/": Collection
File must begin with "/": 3000_kd01_4.eps
File must begin with "/": 840_bs00_3.eps
File must begin with "/": 840_kd01_4.eps
File must begin with "/": Color_bs01_3.eps
File must begin with "/": 451_zd01_4.eps
File must begin with "/": 6510_bs01_3.eps
File must begin with "/": Wood
File must begin with "/": Stains_zd01_4.eps
File must begin with "/": 840_zd01_4.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Kunstdruck_zd01_4.eps
File must begin with "/": 2001_bs01_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Naturpapier_zd01_4.eps
File must begin with "/": 451_np01_4.eps
File must begin with "/": ip
File must begin with "/": Oberputze_bs01_3.eps
File must begin with "/": Wood
File must begin with "/": Stains_kd01_4.eps
File must begin with "/": 451_bs00_3.eps
File must begin with "/": Farbe
File must begin with "/": erleben_np01_4.eps
File must begin with "/": 2001_zd01_4.eps
File must begin with "/": POLYA_np01_4.eps
File must begin with "/": System
File must begin with "/": Prase_zd01_4.eps
File must begin with "/": 2001_bs00_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Naturpapier_kd01_4.eps
File must begin with "/": POLYA_kd01_4.eps
File must begin with "/": Einmallasur_bs01_3.eps
File must begin with "/": Color_np01_4.eps
File must begin with "/": Farbe
File must begin with "/": erleben_zd01_4.eps
File must begin with "/": Collection
File must begin with "/": 4000_kd01_4.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Kunstdruck_bs00_3.eps
File must begin with "/": Keramik-Druck_zd01_4.eps
File must begin with "/": 2001_kd01_4.eps
File must begin with "/": Keramik-Druck_kd01_4.eps
File must begin with "/": 6510_np01_4.eps
File must begin with "/": K_bs00_3.eps
File must begin with "/": POLYA_zd01_4.eps
File must begin with "/": K_zd01_4.eps
File must begin with "/": Color_kd01_4.eps
File must begin with "/": Einmallasur_zd01_4.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Naturpapier_bs01_3.eps
File must begin with "/": Einmallasur_bs00_3.eps
File must begin with "/": Keramik-Druck_bs00_3.eps
File must begin with "/": Collection
File must begin with "/": 4000_np01_4.eps
File must begin with "/": Collection
File must begin with "/": 4000_bs01_3.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Kunstdruck_np01_4.eps
File must begin with "/": Wood
File must begin with "/": Stains_bs00_3.eps
File must begin with "/": Wood
File must begin with "/": Stains_bs01_3.eps
File must begin with "/": System
File must begin with "/": Prase_kd01_4.eps
File must begin with "/": Colour-Line_np01_4.eps
File must begin with "/": Keramik-Druck_np01_4.eps
File must begin with "/": Colour-Line_bs00_3.eps
File must begin with "/": Einmallasur_kd01_4.eps
File must begin with "/": 6510_bs00_3.eps
File must begin with "/": POLYA_bs01_3.eps
File must begin with "/": 451_kd01_4.eps
File must begin with "/": Collection
File must begin with "/": 4000_bs00_3.eps
File must begin with "/": 840_bs01_3.eps
File must begin with "/": 2001_np01_4.eps
File must begin with "/": Keramik-Druck_bs01_3.eps
File must begin with "/": Color_zd01_4.eps
File must begin with "/": ip
File must begin with "/": Oberputze_np01_4.eps
File must begin with "/": Collection
File must begin with "/": 3000_zd01_4.eps
File must begin with "/": ip
File must begin with "/": Oberputze_kd01_4.eps
File must begin with "/": Wood
File must begin with "/": Stains_np01_4.eps
File must begin with "/": Collection
File must begin with "/": 3000_bs00_3.eps
File must begin with "/": Collection
File must begin with "/": 3000_np01_4.eps
File must begin with "/": Colour-Line_zd01_4.eps
File must begin with "/": Palette
File must begin with "/": 141
File must begin with "/": Naturpapier_np01_4.eps
File must begin with "/": K_np01_4.eps
File must begin with "/": K_bs01_3.eps
File must begin with "/": Einmallasur_np01_4.eps
File must begin with "/": Farbe
File must begin with "/": erleben_bs00_3.eps
File must begin with "/": POLYA_bs00_3.eps
File must begin with "/": Collection
File must begin with "/": 3000_bs01_3.eps
File must begin with "/": System
File must begin with "/": Prase_np01_4.eps

[ERROR]: RPM PACKING FAILED.

It seems that RPM does not support spaces in file name, and it does cause RPM packing failing.

Artoria2e5 commented 9 years ago

Marked as TODO. Will be added in rpm/glob-escapes.

By the way Icenowy said that she (?) is planning to forbid me to make changes in autobuild. Shall I make a fork?

TO OTHER CONTRIBUTORS

The best and easiest way to perform such escape is to include a python script and do the glob.escape(pathname) job, and pass the escaped stuffs to bash. WTF, glob.escape(pathname) is only available since Py 4.3. Wow such dependency tree, let's make it bash. (Or include it? Not so graceful then.)

Well, we can pass stdin to python so there is no #!/usr/bin/env python. (。)

@TheNextProject Maybe you can add this. It should replace rpmspace stuffs.

MingcongBai commented 9 years ago

...Just change it... He's never called down when going by ab3. He should make fixes to suit his "philosophies", when he can make changes.

-----原始邮件----- 发件人: "Mingye Wang" notifications@github.com 发送时间: ‎2014/‎10/‎12 5:36 收件人: "AOSC-Dev/autobuild3" autobuild3@noreply.github.com 主题: Re: [autobuild3] RPM Build error when spaces exist in file name (#3)

Marked as TODO. Will be added in rpm/glob-escapes. By the way Icenowy said that she (?) is planning to forbid me to make changes in autobuild. Shall I make a fork? TO OTHER CONTRIBUTORS The best and easiest way to perform such escape is to include a python script and do the glob.escape(pathname) job, and pass the escaped stuffs to bash. Well, we can pass stdin to python so there is no #!/usr/bin/env python. (。) — Reply to this email directly or view it on GitHub.=

Artoria2e5 commented 9 years ago

And here are my `philosophies':

2-space indents, fuck the tabs (Essential for 72-col terminal users like me)
Use a one-liner on short functions
Use lowercase letters. (my Shift key will soon break if I use autobuild every day)
Keep it small and simple and make clever extensions.
MingcongBai commented 9 years ago

Just calm down... No need for a fight over this

-----原始邮件----- 发件人: "Mingye Wang" notifications@github.com 发送时间: ‎2014/‎10/‎12 5:58 收件人: "AOSC-Dev/autobuild3" autobuild3@noreply.github.com 抄送: "Jeff Bai" jeffbaichina@members.fsf.org 主题: Re: [autobuild3] RPM Build error when spaces exist in file name (#3)

And here are my `philosophies': 2-space indents and fuck the tabs Use a one-liner on short functions Use lowercase letters. (my Shift key will soon break if I use autobuild every day) — Reply to this email directly or view it on GitHub.

Artoria2e5 commented 9 years ago

INDENT WAR (. 2014-10-12 下午10:39于 "Jeff Bai" notifications@github.com写道:

Just calm down... No need for a fight over this

-----原始邮件----- 发件人: "Mingye Wang" notifications@github.com 发送时间: ‎2014/‎10/‎12 5:58 收件人: "AOSC-Dev/autobuild3" autobuild3@noreply.github.com 抄送: "Jeff Bai" jeffbaichina@members.fsf.org 主题: Re: [autobuild3] RPM Build error when spaces exist in file name (#3)

And here are my `philosophies': 2-space indents and fuck the tabs Use a one-liner on short functions Use lowercase letters. (my Shift key will soon break if I use autobuild every day) — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/AOSC-Dev/autobuild3/issues/3#issuecomment-58802237.

Artoria2e5 commented 9 years ago

@TheNextProject 这次变成我挖坑不填了 OAO

Artoria2e5 commented 9 years ago

@TheNextProject Good News: OS3 has Py3.4

# lib/pyglob.sh
abreqexe python3
pyglob(){
  python3 << _EOF
import glob
print(glob.escape("$1"))
_EOF
  # "'" + glob.escape("$1") + "'" ?
  # echo "'$1'" ?
}
# Also try:
# while read line => Redirect code to a temporary buffer like &5
# python3 <&5

Or shall we just use ' ' to wrap the files?

Artoria2e5 commented 9 years ago

Read http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html

MingcongBai commented 9 years ago

I am just not sure how to implement this.

在 2014年10月19日,上午7:24,Mingye Wang notifications@github.com 写道:

Read http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html

— Reply to this email directly or view it on GitHub.

MingcongBai commented 9 years ago

Fixed.