diff options
author | gregor herrmann <gregoa@debian.org> | 2023-02-25 01:55:17 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2023-02-25 01:55:17 +0100 |
commit | 29e0252f9642141699591be7bb9b3d7f4c4c4737 (patch) | |
tree | 9344cc920956a74a970e2fdfad5929157065f58a | |
parent | 4815c9a0e20400c8fcb44d9f34f0b9520a903cd4 (diff) | |
parent | 97a54464596ada67800dadc3191f098d5f690384 (diff) |
Update upstream source from tag 'upstream/1.05'
Update to upstream version '1.05'
with Debian dir 9b94603abe27ed804a0cfba60939f4d5f391faa9
-rw-r--r-- | Build.PL | 35 | ||||
-rw-r--r-- | Changes | 7 | ||||
-rw-r--r-- | MANIFEST | 4 | ||||
-rw-r--r-- | META.json | 48 | ||||
-rw-r--r-- | META.yml | 24 | ||||
-rw-r--r-- | Makefile.PL | 1 | ||||
-rw-r--r-- | README | 83 | ||||
-rw-r--r-- | lib/Schedule/Cron.pm | 32 |
8 files changed, 120 insertions, 114 deletions
diff --git a/Build.PL b/Build.PL deleted file mode 100644 index e35c9e1..0000000 --- a/Build.PL +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/perl -use Module::Build; -my $build = Module::Build->new - ( - module_name => "Schedule::Cron", - dist_author => 'Roland Huss (roland@cpan.org)', - abstract => 'Cron-like scheduler for Perl subroutines', - distribution_type => 'module', - installdirs => 'site', - - license => "perl", - - requires => { - "Time::ParseDate" => "2011.0505", - "Data::Dumper" => "0" - }, - - build_requires => { - "Test::More" => "0", - "Test" => "0", - }, - keywords => [ "Cron", "Scheduler", "Job" ], - meta_merge => { - resources => { - repository => 'http://github.com/rhuss/schedule-cron', - }, - }, - provides => { - "Schedule::Cron" => { - file => "lib/Schedule/Cron.pm" - } - }, - configure_requires => { 'Module::Build' => 0} - ); -$build->create_build_script; @@ -1,3 +1,10 @@ +1.05 2023-02-22 +- Fixed POD error from using UTF8 char without setting =encoding (ticket 144709) +- Fixed minor undefined warning bug (ticket 145506) +- Fixed spelling and grammar issues in the documentation +- Removed handwritten META.yml in favor of EU::MM generated META.yml +- Removed support for Module::Build in favor of ExtUtils::MakeMaker + 1.04 2022-10-08 - Merged "CHANGES" and "ChangeLog" into "Changes". @@ -1,4 +1,3 @@ -Build.PL Changes examples/simple.pl examples/cron.tab @@ -6,7 +5,6 @@ examples/custom_sleep.pl lib/Schedule/Cron.pm Makefile.PL MANIFEST This list of files -META.yml README t/after_job.t t/callbackreschedule.t @@ -26,3 +24,5 @@ t/test.crontab t/delete_entry.t t/same_time_with_reschedule.t t/timeshift.t +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff --git a/META.json b/META.json new file mode 100644 index 0000000..0182563 --- /dev/null +++ b/META.json @@ -0,0 +1,48 @@ +{ + "abstract" : "Cron-like scheduler for Perl subroutines", + "author" : [ + "Roland Huss (roland@cpan.org)" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter version 2.150010", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "Schedule-Cron", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Data::Dumper" : "0", + "Time::ParseDate" : "2011.0505" + } + } + }, + "release_status" : "stable", + "resources" : { + "repository" : { + "url" : "https://github.com/rhuss/schedule-cron" + } + }, + "version" : "1.05", + "x_serialization_backend" : "JSON::PP version 4.07" +} @@ -1,28 +1,26 @@ --- -abstract: 'cron-like scheduler for Perl subroutines' +abstract: 'Cron-like scheduler for Perl subroutines' author: - 'Roland Huss (roland@cpan.org)' build_requires: - Test: '0' - Test::More: '0' + ExtUtils::MakeMaker: '0' configure_requires: - Module::Build: '0' -dynamic_config: 0 -generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010' + ExtUtils::MakeMaker: '0' +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Schedule-Cron -provides: - Schedule::Cron: - file: lib/Schedule/Cron.pm - version: '1.03' +no_index: + directory: + - t + - inc requires: Data::Dumper: '0' Time::ParseDate: '2011.0505' resources: - license: http://dev.perl.org/licenses/ - repository: http://github.com/rhuss/schedule-cron -version: '1.03' + repository: https://github.com/rhuss/schedule-cron +version: '1.05' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/Makefile.PL b/Makefile.PL index e99b1dd..8bfd9c9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,6 @@ use ExtUtils::MakeMaker; WriteMakefile ( - NO_META => 1, NAME => "Schedule::Cron", VERSION_FROM => "lib/Schedule/Cron.pm", ($] >= 5.005 @@ -1,30 +1,29 @@ Schedule::Cron ============== -This module provides a simple but complete cron like scheduler. I.e -this modules can be used for periodically executing Perl subroutines. -The dates and parameters for the subroutines to be called are +This module provides a simple but complete cron like scheduler. I.e +this modules can be used for periodically executing Perl subroutines. +The dates and parameters for the subroutines to be called are specified with a format known as crontab entry (see manpage crontab(5) or documentation of Schedule::Cron). -The philosophy behind Schedule::Cron is to call subroutines -periodically from within one single Perl program instead of letting -cron trigger several (possibly different) Perl scripts. Everything -under one roof. Furthermore Schedule::Cron provides mechanism to +The philosophy behind Schedule::Cron is to call subroutines +periodically from within one single Perl program instead of letting +cron trigger several (possibly different) Perl scripts. Everything +under one roof. Furthermore Schedule::Cron provides mechanism to create crontab entries dynamically, which isn't that easy with cron. -Schedule::Cron knows about all extensions (well, at least all +Schedule::Cron knows about all extensions (well, at least all extensions I'm aware of, i.e those of the so called "Vixie" cron) for -crontab entries like ranges including 'steps', specification of month +crontab entries like ranges including 'steps', specification of month and days of the week by name or coexistence of lists and ranges in the -same field. And even a bit more (like lists and ranges with symbolic +same field. And even a bit more (like lists and ranges with symbolic names). -This module is rather effective concerning system load. It calculates -the execution dates in advance and will sleep until those dates are -reached (and wont wake up every minute to check for execution like -cron). However, it relies on the accuracy of your sleep() system -call. +This module is rather effective concerning system load. It calculates +the execution dates in advance and will sleep until those dates are +reached (and wont wake up every minute to check for execution like +cron). However, it relies on the accuracy of your sleep() system call. EXAMPLES -------- @@ -72,79 +71,72 @@ EXAMPLES PREREQUISITES ------------- -In order to install and use this package you will need Perl version -5.005 or better. Furthermore you need the module Time::ParseDate +In order to install and use this package you will need Perl version +5.005 or better. Furthermore you need the module Time::ParseDate (contained in the Time-modules-xx.xxxxx) available on CPAN. You need a fork()-aware Perl for dispatching the cron jobs. This might -change in the future. On systems without a fork() system call you can +change in the future. On systems without a fork() system call you can use the 'nofork' option to run your jobs within the current process. OS-DEPENDENCIES --------------- Schedule::Cron was tested on a Redhat Linux-Box, but it should work on -any UNIX Box. In depends on some original UNIX system calls for +any UNIX Box. In depends on some original UNIX system calls for starting jobs and detaching itself to the background: * It uses fork() for starting jobs * For detaching it uses either setsid (POSIX) or the ioctl call TIOCNOTTY -If the system calls mentioned above are not available (which should -hapen nowadays only under rare circumstances), you can still use the +If the system calls mentioned above are not available (which should +hapen nowadays only under rare circumstances), you can still use the 'nofork' option to run all jobs within a single process/thread. Please refer to the documentation for further reading. INSTALLATION ------------ -Installation can be done either in the old fashioned way +Installation can be done the old fashioned way perl Makefile.PL make make test make install -or alternatively with Module::Build - - perl Build.PL - ./Build - ./Build test - ./Build install - -See the documentation for Schedule::Cron for a detailed description +See the documentation for Schedule::Cron for a detailed description and further usage examples. REPORTING BUGS -------------- -If you meet a bug (say hello to it ;-), open a ticket at +If you meet a bug (say hello to it ;-), open a ticket at https://rt.cpan.org/Ticket/Create.html?Queue=Schedule-Cron. -In addition of a problem description, please add a short description -of you OS, your Perl version and the version of Time::ParseDate you -are using. If some of the provided tests fail, include the output of +In addition of a problem description, please add a short description +of you OS, your Perl version and the version of Time::ParseDate you +are using. If some of the provided tests fail, include the output of 'make test TEST_VERBOSE=1' as well. -If you suspect, that the date calculation of the next execution time -is buggy, please use the following interactive command to generate a +If you suspect, that the date calculation of the next execution time +is buggy, please use the following interactive command to generate a bug report. perl -MSchedule::Cron -e 'bug Schedule::Cron' -You will be asked for a reference time (default: the current time), a -crontab date pattern (with five columns) and the expected next -execution date (relative to the reference time). The dates can be -specified in a format understood by 'parsedate' from Time::ParseDate -(like 'now + 5 days'). Please include the output of this command. +You will be asked for a reference time (default: the current time), a +crontab date pattern (with five columns) and the expected next +execution date (relative to the reference time). The dates can be +specified in a format understood by 'parsedate' from Time::ParseDate +(like 'now + 5 days'). Please include the output of this command. REPOSITORY ---------- -Schedule::Cron's source is located at -https://github.com/rhuss/schedule-cron Please feel free to send me -pull requests if they apply to the license below. Also, don't forget +Schedule::Cron's source is located at +https://github.com/rhuss/schedule-cron Please feel free to send me +pull requests if they apply to the license below. Also, don't forget documentation and tests. Please note also, that the active development for this module has been @@ -156,11 +148,10 @@ COPYRIGHT AND LICENSE Copyright (c) 1999-2013 Roland Huß. -Copyright (c) 2022 Nicholas Hubbard. +Copyright (c) 2022-2023 Nicholas Hubbard. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Enjoy it... ...roland (roland@cpan.org) - diff --git a/lib/Schedule/Cron.pm b/lib/Schedule/Cron.pm index 376ab2d..b7cd7a4 100644 --- a/lib/Schedule/Cron.pm +++ b/lib/Schedule/Cron.pm @@ -1,5 +1,7 @@ #!/usr/bin/perl -w +=encoding utf8 + =head1 NAME Cron - cron-like scheduler for Perl subroutines @@ -79,7 +81,7 @@ BEGIN { } -$VERSION = "1.04"; +$VERSION = "1.05"; our $DEBUG = 0; my %STARTEDCHILD = (); @@ -252,7 +254,7 @@ string) Don't fork when starting the scheduler. Instead, the jobs are executed within current process. In your executed jobs, you have full access to the global variables of your script and hence might influence other jobs running at a -different time. This behaviour is fundamentally different to the 'fork' mode, +different time. This behavior is fundamentally different to the 'fork' mode, where each jobs gets its own process and hence a B<copy> of the process space, independent of each other job and the main process. This is due to the nature of the C<fork> system call. @@ -572,7 +574,7 @@ Any additional parameters will be given as arguments to the subroutine to be executed. You can also specify a reference to an array instead of a list of parameters. -You can also use a named parameter list provided as an hashref. The named +You can also use a named parameter list provided as an hashref. The named parameters recognized are: =over @@ -690,7 +692,7 @@ refer to the documentation of the method C<add_entry>. The order index of each entry can be used within C<update_entry>, C<get_entry> and C<delete_entry>. But be aware, when you are deleting an entry, that you -have to refetch the list, since the order will have changed. +have to re-fetch the list, since the order will have changed. Note that these entries are returned by value and were obtained from the internal list by a deep copy. I.e. you are free to modify it, but this won't @@ -1164,7 +1166,7 @@ sub get_next_execution_time else { $t = $ALPHACONV[$i]{lc $t} if $t !~ /^(\d+|\*)$/; - $t = $LOWMAP[$i]{$t} if exists($LOWMAP[$i]{$t}); + $t = $LOWMAP[$i]{$t} if( defined $t && exists($LOWMAP[$i]{$t}) ); die "Invalid cronentry '",$cron_entry->[$i],"'" if (!defined($t) || ($t ne '*' && ($t < $RANGES[$i][0] || $t > $RANGES[$i][1]))); @@ -1357,7 +1359,7 @@ sub _execute exit unless $cfg->{nofork}; } -# Udate the scheduler queue with a new entry +# Update the scheduler queue with a new entry sub _update_queue { my $self = shift; @@ -1886,8 +1888,8 @@ skipped. Any job which triggers in this skipped hour will be fired in the next hour. So, when the DST switch goes from 2:00 to 3:00 a job which is scheduled for 2:43 will be executed at 3:43. -For the reverse backwards switch later in the year, the behaviour is -undefined. Two possible behaviours can occur: For jobs triggered in short +For the reverse backwards switch later in the year, the behavior is +undefined. Two possible behaviors can occur: For jobs triggered in short intervals, where the next execution time would fire in the extra hour as well, the job could be executed again or skipped in this extra hour. Currently, running C<Schedule::Cron> in C<MET> would skip the extra job, in C<PST8PDT> it @@ -1899,14 +1901,14 @@ of the first occurrence for C<PST8PDT> and for C<MET> it returns the second occurrence. Unfortunately, there is no way to specify I<which> entry L<Time::ParseDate> should pick (until now). Of course, after all, this is obviously not L<Time::ParseDate>'s fault, since a simple date specification -within the DST backswitch period B<is> ambiguous. However, it would be nice if -the parsing behaviour of L<Time::ParseDate> would be consistent across time +within the DST back-switch period B<is> ambiguous. However, it would be nice if +the parsing behavior of L<Time::ParseDate> would be consistent across time zones (a ticket has be raised for fixing this). Then L<Schedule::Cron>'s -behaviour within a DST backward switch would be consistent as well. +behavior within a DST backward switch would be consistent as well. Since changing the internal algorithm which worked now for over ten years would be too risky and I don't see any simple solution for this right now, it is -likely that this I<undefined> behaviour will exist for some time. Maybe some +likely that this I<undefined> behavior will exist for some time. Maybe some hero is coming along and will fix this, but this is probably not me ;-) Sorry for that. @@ -1975,7 +1977,7 @@ Philippe Verdret Copyright (c) 1999-2013 Roland Huß. -Copyright (c) 2022 Nicholas Hubbard. +Copyright (c) 2022-2023 Nicholas Hubbard. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -1983,7 +1985,3 @@ modify it under the same terms as Perl itself. =cut 1; - - - - |