Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sunwait for openSUSE:Factory checked in at 2022-08-05 19:51:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sunwait (Old) and /work/SRC/openSUSE:Factory/.sunwait.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sunwait" Fri Aug 5 19:51:00 2022 rev:4 rq:993113 version:20220613 Changes: -------- --- /work/SRC/openSUSE:Factory/sunwait/sunwait.changes 2021-02-09 21:16:42.874804517 +0100 +++ /work/SRC/openSUSE:Factory/.sunwait.new.1521/sunwait.changes 2022-08-05 19:51:57.449603857 +0200 @@ -1,0 +2,9 @@ +Thu Aug 4 16:13:02 UTC 2022 - Jan Baier <[email protected]> + +- update to version 20220613 + - ADD standard(ish) unixy command line flags + - Fix unused variable warning during compile. + - Document use of an arbitrary date specification +- add sunwait-fix-parentheses.patch + +------------------------------------------------------------------- Old: ---- sunwait-20201026.tar.xz New: ---- sunwait-20220613.tar.xz sunwait-fix-parentheses.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sunwait.spec ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.517606614 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.521606624 +0200 @@ -1,7 +1,7 @@ # # spec file for package sunwait # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: sunwait -Version: 20201026 +Version: 20220613 Release: 0 Summary: Sunrise, sunset and twilight calculator License: GPL-2.0-or-later @@ -25,6 +25,7 @@ URL: https://github.com/risacher/sunwait Source: %{name}-%{version}.tar.xz Patch0: sunwait-no-rpm-opt-flags.patch +Patch1: sunwait-fix-parentheses.patch BuildRequires: gcc-c++ %description @@ -34,7 +35,7 @@ %prep %setup -q -%patch0 -p1 +%autopatch %build %make_build ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.561606728 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.565606738 +0200 @@ -1,6 +1,6 @@ -sunwait (20201026) stable; urgency=medium +sunwait (20220613) stable; urgency=medium - * update to version 20190322 + * update to version 20220613 -- Jan Baier <[email protected]> Mon, 06 Jan 2020 13:00:47 +0100 ++++++ debian.compat ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.585606790 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.589606800 +0200 @@ -1,2 +1,2 @@ -10 +12 ++++++ debian.control ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.609606852 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.613606862 +0200 @@ -2,7 +2,7 @@ Section: science Priority: optional Maintainer: Jan Baier <[email protected]> -Build-Depends: debhelper (>= 10), build-essential +Build-Depends: debhelper (>= 12), build-essential Package: sunwait Architecture: any ++++++ debian.series ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.649606955 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.657606976 +0200 @@ -1,2 +1,4 @@ sunwait-no-rpm-opt-flags.patch -p1 +sunwait-fix-parentheses.patch -p1 +(No newline at EOF) ++++++ sunwait-20201026.tar.xz -> sunwait-20220613.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sunwait-20201026/USAGE.txt new/sunwait-20220613/USAGE.txt --- old/sunwait-20201026/USAGE.txt 2020-10-26 21:39:53.000000000 +0100 +++ new/sunwait-20220613/USAGE.txt 2022-06-13 06:02:52.000000000 +0200 @@ -15,7 +15,7 @@ poll Returns immediately indicating DAY or NIGHT. See 'program exit codes'. Default. wait Sleep until specified event occurs. Else exit immediate. list [X] Report twilight times for next 'X' days (inclusive). Default: 1. - report Generate a report about the days sunrise and sunset timings. + report [date] Generate a report about the days sunrise and sunset timings. Default: the current day Minor options, any of: [no]debug Print extra info and returns in one minute. Default: nodebug. @@ -63,6 +63,9 @@ List next 7 days sunrise times, custom +3 degree twilight angle, default location. Uses GMT; as any change in daylight saving over the specified period is not considered. +Example 5: sunwait report y 20 m 3 d 15 10.49S 105.55E +Produce a report of the different sunrises and sunsets on an arbitrary day (2022/03/15) for an arbitrary location (Christmas Island) + Note that program uses C library functions to determine time and localtime. Error for timings are estimated at: +/- 4 minutes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sunwait-20201026/sunwait.cpp new/sunwait-20220613/sunwait.cpp --- old/sunwait-20201026/sunwait.cpp 2020-10-26 21:39:53.000000000 +0100 +++ new/sunwait-20220613/sunwait.cpp 2022-06-13 06:02:52.000000000 +0200 @@ -62,10 +62,10 @@ printf ("Code Contributors: P.Schlyter, D.Risacher, D.MacMillan and I.Craig.\n"); printf ("\n"); printf (" Sunset is the instant at which the upper edge of the Sun disappears below the horizon.\n"); - printf (" Civil twilight is the period from sunset until the geometric centre of the sun is 6? below the horizon.\n"); - printf (" Nautical twilight is the period when the geometric centre of the sun is between 6? and 12? below the horizon.\n"); - printf (" Astronomical twilight is the period when the geometric centre of the sun is between 12? and 18? below the horizon.\n"); - printf (" Night is period when the geometric center of the sun falls 18? below the horizon.\n"); + printf (" Civil twilight is the period from sunset until the geometric centre of the sun is 6?? below the horizon.\n"); + printf (" Nautical twilight is the period when the geometric centre of the sun is between 6?? and 12?? below the horizon.\n"); + printf (" Astronomical twilight is the period when the geometric centre of the sun is between 12?? and 18?? below the horizon.\n"); + printf (" Night is period when the geometric center of the sun falls 18?? below the horizon.\n"); } @@ -662,17 +662,22 @@ if (pRun->debug == ONOFF_ON) printf ("Debug: argv[%d]: >%s<\n", i, arg); // Strip any hyphen from arguments, but not negative signs of numbers - if (arg[0] == '-' && arg[1] != '\0' && !isdigit(arg[1])) *arg++; + if (arg[0] == '-' && arg[1] != '\0' && !isdigit(arg[1])) memmove(arg, arg + 1, sizeof arg - 1); // Normal help or version info if (!strcmp (arg, "v") || + !strcmp (arg, "-V") || + !strcmp (arg, "-v") || + !strcmp (arg, "--version") || !strcmp (arg, "version")) pRun->functionVersion = ONOFF_ON; else if (!strcmp (arg, "nv") || !strcmp (arg, "noversion")) pRun->functionVersion = ONOFF_OFF; else if (!strcmp (arg, "?") || !strcmp (arg, "usage") || + !strcmp (arg, "--help") || !strcmp (arg, "h") || + !strcmp (arg, "-help") || !strcmp (arg, "help")) pRun->functionUsage = ONOFF_ON; else if (!strcmp (arg, "nh" ) || !strcmp (arg, "nousage") || @@ -699,7 +704,10 @@ !strcmp (arg, "noutc")) pRun->utc = ONOFF_OFF; // Debug mode - else if (!strcmp (arg, "debug")) pRun->debug = ONOFF_ON; + else if (!strcmp (arg, "debug")) || + !strcmp (arg, "--debug")) || + !strcmp (arg, "--verbose")) || + !strcmp (arg, "-v")) pRun->debug = ONOFF_ON; else if (!strcmp (arg, "nodebug")) pRun->debug = ONOFF_OFF; // Poll. Is it DAY or NIGHT? ++++++ sunwait-fix-parentheses.patch ++++++ diff --git sunwait.cpp sunwait.cpp index fdf07c1..36b45d2 100755 --- sunwait.cpp +++ sunwait.cpp @@ -70,9 +70,9 @@ void print_version () } /* -** It's very useful to have this here +** It's very useful to have this here */ -void print_usage () +void print_usage () { printf ("Calculate sunrise and sunset times for the current or targetted day.\n"); printf ("The times can be adjusted either for twilight or fixed durations.\n"); printf ("\n"); @@ -150,7 +150,7 @@ void myToLower (char *arg) void myToLower (const int argc, char *argv[]) { for (int i=1; i < argc; i++) - myToLower (argv [i]); + myToLower (argv [i]); } boolean myIsNumber (const char *arg) @@ -323,7 +323,7 @@ boolean isBearing (runStruct *pRun, const char *pArg) else if (compass == 'W') { bearing = 360 - bearing; compass = 'E'; } /* It's almost done, assign bearing to appropriate global */ - if (compass == 'N') pRun->latitude = fixLatitude (bearing); + if (compass == 'N') pRun->latitude = fixLatitude (bearing); else if (compass == 'E') pRun->longitude = fixLongitude (bearing); else return false; return true; /* All done */ @@ -467,7 +467,7 @@ double getUtcBiasHours (const time_t *pTimet) utcBiasHours = (localNoonTm.tm_hour - utcNoonTm.tm_hour) + (localNoonTm.tm_min - utcNoonTm.tm_min) / 60.0; - + // The day may be different between the two times, especially if the local timezone is near the dateline. // Rollover of tm_yday (from 365 to 0) is a further problem, but no bias is ever more than 24 hours - that wouldn't make sense. @@ -546,7 +546,7 @@ time_t getMidnightUTC (const time_t *pTimet, const runStruct *pRun) tmpTm.tm_sec += myRound (pRun->utcBiasHours * 3600.0); // Let mktime() do it's magic - return mktime (&tmpTm); + return mktime (&tmpTm); } /* @@ -643,19 +643,19 @@ int main (int argc, char *argv[]) /* ** - ** Parse command line arguments + ** Parse command line arguments ** */ - // Change to all lowercase, just to make life easier ... - myToLower (argc, argv); + // Change to all lowercase, just to make life easier ... + myToLower (argc, argv); // Look for debug being activated ... for (int i=1; i < argc; i++) if (!strcmp (argv [i], "debug")) pRun->debug = ONOFF_ON; // For each argument for (int i=1; i < argc; i++) - { + { char *arg = argv[i]; // Echo argument, if in debug @@ -704,9 +704,9 @@ int main (int argc, char *argv[]) !strcmp (arg, "noutc")) pRun->utc = ONOFF_OFF; // Debug mode - else if (!strcmp (arg, "debug")) || - !strcmp (arg, "--debug")) || - !strcmp (arg, "--verbose")) || + else if (!strcmp (arg, "debug") || + !strcmp (arg, "--debug") || + !strcmp (arg, "--verbose") || !strcmp (arg, "-v")) pRun->debug = ONOFF_ON; else if (!strcmp (arg, "nodebug")) pRun->debug = ONOFF_OFF; @@ -752,7 +752,7 @@ int main (int argc, char *argv[]) else if (!strcmp (arg, "m") && i+1<argc && myIsNumber (argv[i+1])) monInt = atoi (argv [++i]); // Note: "++i" else if (!strcmp (arg, "d") && i+1<argc && myIsNumber (argv[i+1])) mdayInt = atoi (argv [++i]); // Note: "++i" - // Specify fixed duration offset + // Specify fixed duration offset else if (!strcmp (arg, "o") || !strcmp (arg, "off") || !strcmp (arg, "offset")) { if (i+1<argc && isOffset (pRun, argv[i+1])) { ++i; } /* Functionality in "isOffset()" */ @@ -828,7 +828,7 @@ int main (int argc, char *argv[]) if (yearInt != NOT_SET) { if (yearInt < 0 || yearInt > 99) - { printf ("Error: \"Year\" must be between 0 and 99: %u\n", yearInt); + { printf ("Error: \"Year\" must be between 0 and 99: %u\n", yearInt); exit (EXIT_ERROR); } targetTm.tm_year = yearInt + 100; @@ -837,13 +837,13 @@ int main (int argc, char *argv[]) if (monInt != NOT_SET) { if (monInt < 1 || monInt > 12) - { printf ("Error: \"Month\" must be between 1 and 12: %u\n", monInt); + { printf ("Error: \"Month\" must be between 1 and 12: %u\n", monInt); exit (EXIT_ERROR); } targetTm.tm_mon = monInt-1; // We need month 0 to 11, not 1 to 12 } if (pRun->debug == ONOFF_ON) printf ("Debug: Target mon set to: %u\n", targetTm.tm_mon); - + if (mdayInt != NOT_SET) { if (mdayInt < 1 || mdayInt > 31) { printf ("Error: \"Day of month\" must be between 1 and 31: %u\n", mdayInt); @@ -852,7 +852,7 @@ int main (int argc, char *argv[]) targetTm.tm_mday = mdayInt; } if (pRun->debug == ONOFF_ON) printf ("Debug: Target mday set to: %u\n", targetTm.tm_mday); - + // Set target time to the start of the UTC day targetTm.tm_hour = 0; targetTm.tm_min = 0; @@ -864,7 +864,7 @@ int main (int argc, char *argv[]) targetTm.tm_isdst = -1; // -1 means: mktime() must work it out. 0=DST not in effect. 1=DST in effect. (Daylight Savings) // Convert target "struct tm" to time_t. It'll be set to midnight local time, on the target day. - pRun->targetTimet = mktime (&targetTm); + pRun->targetTimet = mktime (&targetTm); // Shave off (add) UTC offset, so that time_t is converted from midnight local-time to midnight UTC on the target day targetTm.tm_sec += myRound (pRun->utcBiasHours * 60.0 * 60.0); @@ -892,12 +892,12 @@ int main (int argc, char *argv[]) */ if (pRun->latitude == NOT_SET) - { if (pRun->debug == ONOFF_ON) printf ("Debug: latitude not set. Default applied.\n"); + { if (pRun->debug == ONOFF_ON) printf ("Debug: latitude not set. Default applied.\n"); pRun->latitude = DEFAULT_LATITUDE; /* The Buttercross, Bingham, England */ } - if (pRun->longitude == NOT_SET) - { if (pRun->debug == ONOFF_ON) printf ("Debug: longitude not set. Default applied.\n"); + if (pRun->longitude == NOT_SET) + { if (pRun->debug == ONOFF_ON) printf ("Debug: longitude not set. Default applied.\n"); pRun->longitude = DEFAULT_LONGITUDE; /* The Buttercross, Bingham, England */ } @@ -911,7 +911,7 @@ int main (int argc, char *argv[]) } /* - ** Check: Twilight Angle + ** Check: Twilight Angle */ if (pRun->twilightAngle == NOT_SET) @@ -945,7 +945,7 @@ int main (int argc, char *argv[]) */ // IF no function requested THEN default to "usage" - if + if ( pRun->functionList == ONOFF_OFF && pRun->functionPoll == ONOFF_OFF && pRun->functionUsage == ONOFF_OFF @@ -967,38 +967,38 @@ int main (int argc, char *argv[]) ** OK - we're all done figuring out what to do - let's do it */ - if (pRun->functionVersion == ONOFF_ON) + if (pRun->functionVersion == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: Version\n"); - print_version (); - exitCode = EXIT_OK; + print_version (); + exitCode = EXIT_OK; } - if (pRun->functionUsage == ONOFF_ON) + if (pRun->functionUsage == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: Usage\n"); - print_usage (); - exitCode = EXIT_OK; + print_usage (); + exitCode = EXIT_OK; } if (pRun->functionReport == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: Report\n"); generate_report (pRun); - exitCode = EXIT_OK; + exitCode = EXIT_OK; } - if (pRun->functionList == ONOFF_ON) + if (pRun->functionList == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: List\n"); - print_list (pRun); - exitCode = EXIT_OK; + print_list (pRun); + exitCode = EXIT_OK; } if (pRun->functionWait == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: Wait\n"); - exitCode = wait (pRun); + exitCode = wait (pRun); } - if (pRun->functionPoll == ONOFF_ON) + if (pRun->functionPoll == ONOFF_ON) { if (pRun->debug == ONOFF_ON) printf ("Debug: Function selected: Poll\n"); - exitCode = poll (pRun); + exitCode = poll (pRun); if (exitCode == EXIT_DAY) printf ("DAY\n"); else if (exitCode == EXIT_NIGHT) printf ("NIGHT\n"); else if (exitCode == EXIT_OK) printf ("OK\n"); @@ -1027,7 +1027,7 @@ int wait (const runStruct *pRun) { /* ** Calculate start/end of twilight for given twilight type/angle. - ** For latitudes near poles, the sun might not pass through specified twilight angle that day. + ** For latitudes near poles, the sun might not pass through specified twilight angle that day. ** For big longitudes, it's quite likely the sun is up at midnight UTC: this means we have to calculate successive days. */ @@ -1062,7 +1062,7 @@ int wait (const runStruct *pRun) long waitRiseTomorrow = waitMidnightUTC + static_cast <long> ( 3600.0 * getOffsetRiseHourUTC (pRun, &tomorrow) ); long waitSetTomorrow = waitMidnightUTC + static_cast <long> ( 3600.0 * getOffsetSetHourUTC (pRun, &tomorrow) ); - // Determine next sunrise and sunset + // Determine next sunrise and sunset // (we may be in DAY, so the next event is sunset - followed by sunrise) long waitRiseSeconds = 0; @@ -1094,7 +1094,7 @@ int wait (const runStruct *pRun) else if (waitSetToday > 0) { double diurnalArc = diurnalArcWithOffset (pRun, &today); exitPolar = diurnalArc <= 0.0 || diurnalArc >= 24.0; } else { double diurnalArc = diurnalArcWithOffset (pRun, &tomorrow); exitPolar = diurnalArc <= 0.0 || diurnalArc >= 24.0; } - if (exitPolar) + if (exitPolar) { if (pRun->debug == ONOFF_ON) printf ("Debug: Polar region or large offset: No sunrise today, there's nothing to wait for!\n"); return EXIT_ERROR; } @@ -1112,7 +1112,7 @@ int wait (const runStruct *pRun) { waitSeconds = waitRiseSeconds < waitSetSeconds ? waitRiseSeconds : waitSetSeconds; } // Don't wait if event has passed (or next going to occur soon [6hrs]) - if (waitSeconds <= 0) + if (waitSeconds <= 0) { if (pRun->debug == ONOFF_ON) printf ("Debug: Event already passed today, can't wait for that!\n"); return EXIT_ERROR; } @@ -1126,7 +1126,7 @@ int wait (const runStruct *pRun) waitSeconds = 10; } else if (pRun->functionPoll == ONOFF_ON) waitSeconds += 60; // Make more sure that a subsequent POLL works properly (wink ;-) - + /* ** Sleep (wait) until the event is expected */ ++++++ sunwait-no-rpm-opt-flags.patch ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.773607275 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.777607286 +0200 @@ -1,5 +1,7 @@ ---- orig/makefile 2021-02-08 16:10:42.938826333 +0100 -+++ sunwait/makefile 2021-02-08 16:11:22.119084413 +0100 +diff --git makefile makefile +index 7aa7484..91740c3 100755 +--- makefile ++++ makefile @@ -7,7 +7,7 @@ @@ -9,7 +11,7 @@ LDFLAGS= -lm -lstdc++ SOURCES=sunwait.cpp sunriset.cpp print.cpp HEADERS=sunwait.h sunriset.h print.h -@@ -15,7 +15,7 @@ +@@ -15,7 +15,7 @@ OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=sunwait all: $(SOURCES) $(EXECUTABLE) @@ -18,7 +20,7 @@ $(EXECUTABLE): $(OBJECTS) $(C) $(OBJECTS) -o $@ $(LDFLAGS) -@@ -23,6 +23,6 @@ +@@ -23,6 +23,6 @@ $(EXECUTABLE): $(OBJECTS) $(C) $(CFLAGS) $< -o $@ clean: ++++++ sunwait.dsc ++++++ --- /var/tmp/diff_new_pack.ri9zHf/_old 2022-08-05 19:51:58.817607389 +0200 +++ /var/tmp/diff_new_pack.ri9zHf/_new 2022-08-05 19:51:58.817607389 +0200 @@ -1,9 +1,9 @@ Format: 1.0 Source: sunwait -Version: 20201026 +Version: 20220613 Binary: sunwait Maintainer: Jan Baier <[email protected]> Architecture: any -Build-Depends: debhelper (>= 4.1.16), build-essential +Build-Depends: debhelper (>= 12), build-essential Files:
