Solene Rapenne writes:

> Fix astro/wmspaceweather
>
> Patch from Michael
> https://marc.info/?l=openbsd-ports&m=148616321627634&w=2
>
> Various fixes:
> - Updated NOAA URLs
> - Silence ftp
> - ctime.pl -> Time::localtime
>
> Michael asked to be maintainer on the port.
>
> I modified an hardcoded netscape command to xdg-open and added
> devel/xdg-utils to RUN_DEPENDS, and moved MASTER_SITES variable to the
> correct place.

oops,

MASTER_SITES was at the right place...

New diff following


Index: Makefile
===================================================================
RCS file: /cvs/ports/astro/wmspaceweather/Makefile,v
retrieving revision 1.32
diff -u -p -r1.32 Makefile
--- Makefile    24 Nov 2015 09:11:03 -0000      1.32
+++ Makefile    27 Apr 2018 10:24:12 -0000
@@ -4,15 +4,19 @@ COMMENT=              wm-dockapp; space weather moni
 
 DISTNAME=              wmSpaceWeather-1.04
 PKGNAME=               ${DISTNAME:L}
-REVISION=              5
+REVISION=              6
 CATEGORIES=            astro x11 x11/windowmaker
 
+MAINTAINER=            Michael <[email protected]>
+
 # GPL
 PERMIT_PACKAGE_CDROM=  Yes
 
 WANTLIB=               X11 Xext Xpm c
 
 MASTER_SITES=          https://distfiles.nl/
+
+RUN_DEPENDS=           devel/xdg-utils
 
 MAKE_ENV=              CC="${CC}"
 
cvs server: Diffing patches
Index: patches/patch-GetKp
===================================================================
RCS file: /cvs/ports/astro/wmspaceweather/patches/patch-GetKp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-GetKp
--- patches/patch-GetKp 20 Jun 2008 10:49:42 -0000      1.3
+++ patches/patch-GetKp 27 Apr 2018 10:24:12 -0000
@@ -1,9 +1,13 @@
 $OpenBSD: patch-GetKp,v 1.3 2008/06/20 10:49:42 martynas Exp $
---- wmSpaceWeather/GetKp.orig  Fri Feb 12 06:42:01 1999
-+++ wmSpaceWeather/GetKp       Thu Jun 19 20:41:26 2008
-@@ -7,19 +7,31 @@
+Index: wmSpaceWeather/GetKp
+--- wmSpaceWeather/GetKp.orig
++++ wmSpaceWeather/GetKp
+@@ -5,21 +5,33 @@
+ #
  
-     require "ctime.pl";
+ 
+-    require "ctime.pl";
++    use Time::localtime;
  
 +    #
 +    #  Change to users home directory. We used to dump into /tmp
@@ -37,7 +41,7 @@ $OpenBSD: patch-GetKp,v 1.3 2008/06/20 1
  
 -    $grabcmd = "cd /tmp; wget --passive-ftp --tries 2 -q 
ftp://www.sec.noaa.gov/pub/indices/DGD.txt";;
 +
-+    $grabcmd = "ftp -V ftp://www.sec.noaa.gov/pub/indices/DGD.txt";;
++    $grabcmd = "ftp -VM ftp://ftp.swpc.noaa.gov/pub/indices/DGD.txt";;
      system "$grabcmd";
  
  
@@ -55,7 +59,7 @@ $OpenBSD: patch-GetKp,v 1.3 2008/06/20 1
      # Add in very latest stuff
      #
 -    $grabcmd = "cd /tmp; wget --passive-ftp --tries 2 -q 
ftp://www.sec.noaa.gov/pub/latest/curind.txt";;
-+    $grabcmd = "ftp -V ftp://www.sec.noaa.gov/pub/latest/curind.txt";;
++    $grabcmd = "ftp -VM ftp://ftp.swpc.noaa.gov/pub/latest/curind.txt";;
      system "$grabcmd";
      %lmonstr = ( "Jan", 1, "Feb", 2, "Mar", 3, "Apr", 4, "May", 5, "Jun", 6, 
"Jul", 7, "Aug", 8, "Sep", 9, "Oct", 10, "Nov", 11, "Dec", 12);
  
@@ -74,3 +78,12 @@ $OpenBSD: patch-GetKp,v 1.3 2008/06/20 1
      foreach $key  (sort keys %Result ) {
        if ($Result{$key} > 10) { $Result{$key} = -1; }
        printf TmpFile "$key $Result{$key}\n";
+@@ -201,7 +213,7 @@ sub year_month_day{
+ 
+     local($ldate_string, $ldow, $lmon, $ldom, $ltim, $lyear, %lmonstr, 
$tzone, @lval);
+ 
+-    $ldate_string = &ctime(time);
++    $ldate_string = ctime(time);
+     ($ldow, $lmon, $ldom, $ltim, $lyear) = split(" ", $ldate_string);
+ 
+     %lmonstr = ( "Jan", 1, "Feb", 2, "Mar", 3, "Apr", 4, "May", 5, "Jun", 6, 
"Jul", 7, "Aug", 8, "Sep", 9, "Oct", 10, "Nov", 11, "Dec", 12);
Index: patches/patch-wmSpaceWeather_c
===================================================================
RCS file: /cvs/ports/astro/wmspaceweather/patches/patch-wmSpaceWeather_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-wmSpaceWeather_c
--- patches/patch-wmSpaceWeather_c      18 Dec 2007 10:39:47 -0000      1.3
+++ patches/patch-wmSpaceWeather_c      27 Apr 2018 10:24:12 -0000
@@ -1,6 +1,7 @@
 $OpenBSD: patch-wmSpaceWeather_c,v 1.3 2007/12/18 10:39:47 ajacoutot Exp $
---- wmSpaceWeather/wmSpaceWeather.c.orig       Thu Feb 18 18:57:45 1999
-+++ wmSpaceWeather/wmSpaceWeather.c    Tue Dec 18 10:22:00 2007
+Index: wmSpaceWeather/wmSpaceWeather.c
+--- wmSpaceWeather/wmSpaceWeather.c.orig
++++ wmSpaceWeather/wmSpaceWeather.c
 @@ -115,7 +115,7 @@ XEvent             event;
  int                   i, n, s, k, m, dt1, dt2;
  int           Year, Month, Day, DayOfMonth, OldDayOfMonth;
@@ -68,7 +69,7 @@ $OpenBSD: patch-wmSpaceWeather_c,v 1.3 2
  
            if (!UpToDate){
  
-@@ -560,7 +561,7 @@ void ParseCMDLine(int argc, char *argv[]) {
+@@ -560,13 +561,13 @@ void ParseCMDLine(int argc, char *argv[]) {
  
          } else if ((!strcmp(argv[i], "-url"))||(!strcmp(argv[i], "-u"))){
  
@@ -77,12 +78,19 @@ $OpenBSD: patch-wmSpaceWeather_c,v 1.3 2
  
          } else {
  
+           printf("\nwmSpaceWeather version: %s\n", WMSPACEWEATHER_VERSION);
+           printf("\nusage: wmSpaceWeather [-h] [-url <www URL>]\n\n");
+-          printf("\t-url <URL>\tURL to send to Netscape with Button1 double 
click.\n\n");
++          printf("\t-url <URL>\tURL to open with default web browser with 
Button1 double click.\n\n");
+           printf("\t-h\t\tDisplay help screen.\n\n");
+             exit(1);
+ 
 @@ -651,7 +652,7 @@ void pressEvent(XButtonEvent *xev){
      if (GotDoubleClick1) {
          GotFirstClick1 = 0;
          GotDoubleClick1 = 0;
 -        sprintf(Command, "netscape -remote 'openURL(%s)' || netscape '%s' &", 
URL, URL);
-+        snprintf(Command, sizeof(Command), "netscape -remote 'openURL(%s)' || 
netscape '%s' &", URL, URL);
++        snprintf(Command, sizeof(Command), "xdg-open '%s'", URL);
          system(Command);
      }

Reply via email to