forked from misaka00251/go2spec
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9585a324b0 |
@@ -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
|
||||
}
|
||||
|
||||
2
spec.go
2
spec.go
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user