forked from pool/rubygem-gem2rpm
Marcus Rueckert
ec53805b8a
M 0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch M 0002-added-basic-config-file-support-to-gem2rpm-in-yaml-f.patch A 0003-new-opensuse-templates.-they-require-the-config-file.patch A 0004-added-example-gem2rpm.yml.patch A 0005-properly-shorten-description-and-summary.patch A 0006-Preserve-the-license-header-found-in-the-output-file.patch A 0007-fixes-for-the-opensuse-template.patch A 0008-do-not-use-not-.-not-supported-on-1.8-e.g.patch D 0003-sle-12-templates.-they-require-the-config-file-suppo.patch D 0004-openSUSE-template-fixes.patch D 0005-added-example-gem2rpm.yml.patch D 0006-properly-shorten-description-and-summary.patch D 0007-Preserve-the-license-header-found-in-the-output-file.patch D 0008-dont-allow-suffixes-with-just-a-plain-number.-prefix.patch D 0009-rubinius-has-no-extensions-docdir.patch D 0010-switch-to-new-packaging-scheme-by-default.patch D 0011-fixes-for-the-opensuse-template.patch - new patch for fixing usage of not() which breaks on 1.8 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=8
59 lines
1.8 KiB
Diff
59 lines
1.8 KiB
Diff
From da07cd470611c3c6b70fc863e2d82a2862a068e4 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
|
|
Date: Thu, 24 Jul 2014 17:09:35 +0200
|
|
Subject: [PATCH 5/8] properly shorten description and summary
|
|
|
|
This also includes the description if we reuse the summary.
|
|
---
|
|
lib/gem2rpm.rb | 1 -
|
|
lib/gem2rpm/specification.rb | 14 ++++++++++++++
|
|
2 files changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb
|
|
index e5e2693..5261ae1 100644
|
|
--- a/lib/gem2rpm.rb
|
|
+++ b/lib/gem2rpm.rb
|
|
@@ -36,7 +36,6 @@ module Gem2Rpm
|
|
# Deprecate, kept just for backward compatibility.
|
|
format = Gem2Rpm::Format.new(package)
|
|
spec = Gem2Rpm::Specification.new(package.spec)
|
|
- spec.description ||= spec.summary
|
|
config ||= {}
|
|
download_path = ""
|
|
unless local
|
|
diff --git a/lib/gem2rpm/specification.rb b/lib/gem2rpm/specification.rb
|
|
index 9a8d5a1..2e4f7b2 100644
|
|
--- a/lib/gem2rpm/specification.rb
|
|
+++ b/lib/gem2rpm/specification.rb
|
|
@@ -7,6 +7,9 @@ module Gem2Rpm
|
|
# A long description of gem wrapped to 78 characters.
|
|
def description
|
|
d = super.to_s.chomp
|
|
+ if d.nil? or d.empty?
|
|
+ d=self.__getobj__().summary
|
|
+ end
|
|
d.gsub!(/([^.])\Z/, "\\1.")
|
|
Helpers::word_wrap(d, 78) + "\n"
|
|
end
|
|
@@ -17,6 +20,17 @@ module Gem2Rpm
|
|
super.map {|d| Gem2Rpm::Dependency.new d}
|
|
end
|
|
|
|
+ # a short summary trimmed to 70 characters
|
|
+ def summary
|
|
+ text = super
|
|
+ if text.length >= 70
|
|
+ text = text[0,70].split(/\s/)
|
|
+ text = text[0, text.length-1].join(" ")
|
|
+ end
|
|
+ text = text[0, text.length-1] if text[-1] == '.'
|
|
+ text
|
|
+ end
|
|
+
|
|
# List of dependencies that are used for development.
|
|
def development_dependencies
|
|
super.map {|d| Gem2Rpm::Dependency.new d}
|
|
--
|
|
1.8.4.5
|
|
|