void-packages/srcpkgs/starplot/patches/03-fix-ftbfs-convert.diff
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

40 lines
1.3 KiB
Diff

Index: starplot-0.95.5/src/convert/convert.cc
===================================================================
--- a/src/convert/convert.cc
+++ b/src/convert/convert.cc
@@ -49,7 +49,7 @@ void parse_star_file(istream & infile, o
bool using_stdout, bool add_sun)
{
int lineno = 0;
- bool sun_found = false, moredata = true;
+ bool sun_found = false;
char record[1000];
Star * tempstar = 0, * currentstar = 0, * previousstar = 0;
@@ -64,7 +64,7 @@ available on the StarPlot web page, you
in that package for more information.") << endl << endl;
do {
- moredata = infile.getline(record, 999, '\n');
+ infile.getline(record, 999, '\n');
record[999] = 0;
// $ ; and , have special meanings to StarPlot, so purge them:
@@ -73,7 +73,7 @@ in that package for more information.")
record[i] = ' ';
tempstar = parse_star_record(record, format);
- if (tempstar || !moredata) {
+ if (tempstar || infile.eof()) {
delete previousstar;
previousstar = currentstar;
currentstar = tempstar;
@@ -111,7 +111,7 @@ in that package for more information.")
if (!using_stdout && !(lineno % 1000))
cout << starstrings::ssprintf(_("%d records converted."), lineno) << endl;
- } while (moredata) ;
+ } while (!infile.eof()) ;
delete previousstar;