fix for os-release containing quotes
authorElan Ruusamäe <glen@delfi.ee>
Tue, 25 Aug 2015 08:11:33 +0000 (11:11 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 25 Aug 2015 08:11:45 +0000 (11:11 +0300)
https://github.com/fedora-ruby/gem2rpm/pull/48

gem2rpm.spec
os-release-quotes.patch [new file with mode: 0644]

index 710b1b3..77da151 100644 (file)
@@ -12,6 +12,7 @@ Source0:      https://github.com/fedora-ruby/gem2rpm/archive/v%{version}/%{name}-%{ve
 # Source0-md5: b1b60ade93fd61c22c17cfe4b95c3609
 Source2:       pld.spec.erb
 Patch0:                gems.patch
+Patch1:                os-release-quotes.patch
 Patch2:                style.patch
 URL:           https://github.com/fedora-ruby/gem2rpm
 BuildRequires: rpm-rubyprov
@@ -21,6 +22,7 @@ BuildRequires:        rpmbuild(macros) >= 1.656
 BuildRequires: glibc-localedb-all
 %endif
 %endif
+Requires:      pld-release
 Requires:      ruby-rubygems
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -42,6 +44,7 @@ Documentation for %{name}.
 %setup -q
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 %patch0 -p1
+%patch1 -p1
 %patch2 -p1
 cp -p %{SOURCE2} templates
 
diff --git a/os-release-quotes.patch b/os-release-quotes.patch
new file mode 100644 (file)
index 0000000..427c0bd
--- /dev/null
@@ -0,0 +1,10 @@
+--- gem2rpm-0.11.1/lib/gem2rpm/distro.rb       2015-05-06 17:43:19.000000000 +0300
++++ gem2rpm-0.11.1/lib/gem2rpm/distro.rb       2015-08-25 11:07:03.137289555 +0300
+@@ -33,5 +35,5 @@
+           begin
+-            os_release.os = content[/^ID=(.*)$/, 1].to_sym
+-            os_release.version = content[/^VERSION_ID=(.*)$/, 1]
++            os_release.os = content[/^ID=['"]?(.*?)['"]?$/, 1].to_sym
++            os_release.version = content[/^VERSION_ID=['"]?(.*?)['"]?$/, 1]
+           rescue
+           end
This page took 0.317144 seconds and 4 git commands to generate.