public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* patch to cron
@ 2015-11-20 21:24 Andy Stevens
  2015-11-21  9:59 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Stevens @ 2015-11-20 21:24 UTC (permalink / raw)
  To: cygwin-patches

Hello Cygwin patchers, this is my first submission, hope I do OK.

I have discovered a bug in Vixie's cron in the bash script
/usr/bin/cron-config. The bug only appears on Windows 10 which has
an NT version of "10.0". This breaks the version checking in the
bash script. (Bash only supports integer compare or ASCII compare,
but not float compare.)

Below is my proposed patch.  Thanks to
http://stackoverflow.com/questions/8654051 for this bash magic.


--- /usr/bin/cron-config        2015-01-21 23:34:21.000000000 -0500
+++ cron-config 2015-11-20 16:08:24.574218000 -0500
@@ -126,7 +126,10 @@
      nt2003=""
      nt=$(uname -s | sed -ne 's/^CYGWIN_NT-\([^ ]*\)/\1/p')
      [ -z "$nt" ] && echo "Unknown system name" && return 1
-    [ "$nt" \> 5.1 ] && nt2003=yes
+    minver=5.1
+    if [ ${nt%.*} -eq ${minver%.*} ] && [ ${nt#*.} \> ${minver#*.} ] || [ ${nt%.*} -gt ${minver%.*} ]; then
+       nt2003=yes
+    fi
      return 0
  } # === End of get_NT() === #



Best,

--Andy Stevens
Electrical Science, Inc.
114 Pearl St., Suite 2B
Port Chester, NY 10573 USA
Office: +1-914-939-7396
Mobile: +1-646-552-0732
Email: stevens@electricalscience.com
Web: www.electricalscience.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: patch to cron
  2015-11-20 21:24 patch to cron Andy Stevens
@ 2015-11-21  9:59 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2015-11-21  9:59 UTC (permalink / raw)
  To: Andy Stevens; +Cc: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

Hi Andy,

On Nov 20 16:24, Andy Stevens wrote:
> Hello Cygwin patchers, this is my first submission, hope I do OK.

The patch looks ok to me, this is just the wrong mailing list :}
cygwin-patches is for patches to the cygwin base package, not for
patches to arbitrary packages in the Cygwin distro.

Ideally you resend your message to the cygwin AT cygwin DOT com mailing
list.  I Bcc'ed the cron package maintainer so he can pick this up,
though.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-21  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20 21:24 patch to cron Andy Stevens
2015-11-21  9:59 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).