pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/celestia On DragonFly, fall back to glob(3) as wo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d3a7d8505a79
branches:  trunk
changeset: 522550:d3a7d8505a79
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Dec 12 19:31:37 2006 +0000

description:
On DragonFly, fall back to glob(3) as wordexp(3) doesn't exist.

diffstat:

 misc/celestia/distinfo         |   3 +-
 misc/celestia/patches/patch-am |  50 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletions(-)

diffs (68 lines):

diff -r 92124a352220 -r d3a7d8505a79 misc/celestia/distinfo
--- a/misc/celestia/distinfo    Tue Dec 12 19:30:53 2006 +0000
+++ b/misc/celestia/distinfo    Tue Dec 12 19:31:37 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2006/08/14 22:43:07 wiz Exp $
+$NetBSD: distinfo,v 1.13 2006/12/12 19:31:37 joerg Exp $
 
 SHA1 (celestia-1.4.1.tar.gz) = 37863498c43d3078b41027706bfa033bccd949a9
 RMD160 (celestia-1.4.1.tar.gz) = c66c2540e329613dace12e5b12b2dae2a4c679e0
@@ -15,3 +15,4 @@
 SHA1 (patch-aj) = 1ef7a10260a3b1476392c4cae17081ab0e7771b4
 SHA1 (patch-ak) = 20506d8b2f7c8c9ff778e0844dc999b0e497d644
 SHA1 (patch-al) = f998727c986145d3f298295bed1760221a686245
+SHA1 (patch-am) = 34a83573294e6ca41d817a19aef3e7d3e4f14945
diff -r 92124a352220 -r d3a7d8505a79 misc/celestia/patches/patch-am
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/celestia/patches/patch-am    Tue Dec 12 19:31:37 2006 +0000
@@ -0,0 +1,50 @@
+$NetBSD: patch-am,v 1.1 2006/12/12 19:31:37 joerg Exp $
+
+--- src/celutil/unixdirectory.cpp.orig 2006-12-12 16:52:18.000000000 +0000
++++ src/celutil/unixdirectory.cpp
+@@ -7,11 +7,19 @@
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ 
++#if defined(__DragonFly__)
++#define NO_WORDEXP
++#endif
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <dirent.h>
++#ifdef NO_WORDEXP
++#include <glob.h>
++#else
+ #include <wordexp.h>
++#endif
+ #include "directory.h"
+ 
+ using namespace std;
+@@ -98,6 +106,19 @@ bool IsDirectory(const std::string& file
+ }
+ 
+ std::string WordExp(const std::string& filename) {
++#ifdef NO_WORDEXP
++    glob_t g;
++    std::string expanded;
++    glob(filename.c_str(), GLOB_NOSORT | GLOB_TILDE, NULL, &g);
++    if (g.gl_matchc != 1) {
++      globfree(&g);
++      return filename;
++    } else {
++      expanded = g.gl_pathv[0];
++      globfree(&g);
++      return expanded;
++    }
++#else
+     wordexp_t result;
+     std::string expanded;
+ 
+@@ -121,4 +142,5 @@ std::string WordExp(const std::string& f
+     wordfree(&result);
+ 
+     return expanded;
++#endif
+ }



Home | Main Index | Thread Index | Old Index