Compare commits

1 Commits

Author SHA1 Message Date
9585a324b0 for me version 2026-02-12 15:27:04 +08:00
2 changed files with 14 additions and 2 deletions

View File

@@ -63,6 +63,14 @@ func markdownToLongDescription(markdown string) (string, error) {
return reformatForControl(out), nil
}
func limitLines(s string, maxLines int) string {
lines := strings.Split(s, "\n")
if len(lines) <= maxLines {
return s
}
return strings.Join(lines[:maxLines], "\n")
}
// getDescriptionForGopkg reads from README.md (or equivalent) from GitHub,
// intended for extended description in debian/control.
func getLongDescriptionForGopkg(gopkg string) (string, error) {
@@ -95,5 +103,9 @@ func getLongDescriptionForGopkg(gopkg string) (string, error) {
return reformatForControl(content), nil
}
return markdownToLongDescription(content)
out, err := markdownToLongDescription(content)
if err != nil {
return "", err
}
return limitLines(out, 100), nil
}

View File

@@ -50,7 +50,7 @@ func writeSpec(dir, gopkg, openRuyiSrc, openRuyiLib, openRuyiProgram, version st
// SPDX header
fmt.Fprintf(f, "# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)\n")
fmt.Fprintf(f, "# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors\n")
fmt.Fprintf(f, "# SPDX-FileContributor: \n")
fmt.Fprintf(f, "# SPDX-FileContributor: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>\n")
fmt.Fprintf(f, "#\n")
fmt.Fprintf(f, "# SPDX-License-Identifier: MulanPSL-2.0\n")
fmt.Fprintf(f, "\n")