diff options
-rw-r--r-- | meta/classes/package_rpm.bbclass | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index c654cdb5e8..fa928ce042 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -534,7 +534,6 @@ def write_rpm_perfiledata(srcname, d): | |||
534 | 534 | ||
535 | 535 | ||
536 | python write_specfile () { | 536 | python write_specfile () { |
537 | import textwrap | ||
538 | import oe.packagedata | 537 | import oe.packagedata |
539 | 538 | ||
540 | # append information for logs and patches to %prep | 539 | # append information for logs and patches to %prep |
@@ -668,6 +667,19 @@ python write_specfile () { | |||
668 | deps.append(depends) | 667 | deps.append(depends) |
669 | return " ".join(deps) | 668 | return " ".join(deps) |
670 | 669 | ||
670 | def append_description(spec_preamble, text): | ||
671 | """ | ||
672 | Add the description to the spec file. | ||
673 | """ | ||
674 | import textwrap | ||
675 | dedent_text = textwrap.dedent(text).strip() | ||
676 | # Bitbake saves "\n" as "\\n" | ||
677 | if '\\n' in dedent_text: | ||
678 | for t in dedent_text.split('\\n'): | ||
679 | spec_preamble.append(t.strip()) | ||
680 | else: | ||
681 | spec_preamble.append('%s' % textwrap.fill(dedent_text, width=75)) | ||
682 | |||
671 | packages = d.getVar('PACKAGES', True) | 683 | packages = d.getVar('PACKAGES', True) |
672 | if not packages or packages == '': | 684 | if not packages or packages == '': |
673 | bb.debug(1, "No packages; nothing to do") | 685 | bb.debug(1, "No packages; nothing to do") |
@@ -868,8 +880,7 @@ python write_specfile () { | |||
868 | spec_preamble_bottom.append('') | 880 | spec_preamble_bottom.append('') |
869 | 881 | ||
870 | spec_preamble_bottom.append('%%description -n %s' % splitname) | 882 | spec_preamble_bottom.append('%%description -n %s' % splitname) |
871 | dedent_text = textwrap.dedent(splitdescription).strip() | 883 | append_description(spec_preamble_bottom, splitdescription) |
872 | spec_preamble_bottom.append('%s' % textwrap.fill(dedent_text, width=75)) | ||
873 | 884 | ||
874 | spec_preamble_bottom.append('') | 885 | spec_preamble_bottom.append('') |
875 | 886 | ||
@@ -975,8 +986,7 @@ python write_specfile () { | |||
975 | spec_preamble_top.append('') | 986 | spec_preamble_top.append('') |
976 | 987 | ||
977 | spec_preamble_top.append('%description') | 988 | spec_preamble_top.append('%description') |
978 | dedent_text = textwrap.dedent(srcdescription).strip() | 989 | append_description(spec_preamble_top, srcdescription) |
979 | spec_preamble_top.append('%s' % textwrap.fill(dedent_text, width=75)) | ||
980 | 990 | ||
981 | spec_preamble_top.append('') | 991 | spec_preamble_top.append('') |
982 | 992 | ||