[ros-rospack] 01/02: Add patch for hurd-i386

Jochen Sprickerhof jspricke-guest at moszumanska.debian.org
Sat Jun 18 16:13:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

jspricke-guest pushed a commit to branch master
in repository ros-rospack.

commit 26ab2400f21c4dcafefc8932093eff34bdd46e84
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date:   Sat Jun 18 18:07:21 2016 +0200

    Add patch for hurd-i386
    
    Closes: #822757
    Thanks: Svante Signell
---
 debian/patches/0005-Fix-FTBFS-on-hurd-i386.patch | 60 ++++++++++++++++++++++++
 debian/patches/series                            |  1 +
 2 files changed, 61 insertions(+)

diff --git a/debian/patches/0005-Fix-FTBFS-on-hurd-i386.patch b/debian/patches/0005-Fix-FTBFS-on-hurd-i386.patch
new file mode 100644
index 0000000..3c46197
--- /dev/null
+++ b/debian/patches/0005-Fix-FTBFS-on-hurd-i386.patch
@@ -0,0 +1,60 @@
+From: Svante Signell <svante.signell at gmail.com>
+Date: Sat, 18 Jun 2016 18:06:07 +0200
+Subject: Fix FTBFS on hurd-i386
+
+---
+ src/rospack.cpp | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/src/rospack.cpp b/src/rospack.cpp
+index 0662cba..750471f 100644
+--- a/src/rospack.cpp
++++ b/src/rospack.cpp
+@@ -2011,11 +2011,14 @@ Rosstackage::writeCache()
+   }
+   else
+   {
+-    char tmp_cache_dir[PATH_MAX];
+-    char tmp_cache_path[PATH_MAX];
+-    strncpy(tmp_cache_dir, cache_path.c_str(), sizeof(tmp_cache_dir));
++    int len = cache_path.size() + 1;
++    char *tmp_cache_dir = (char *)malloc(len);
++    strncpy(tmp_cache_dir, cache_path.c_str(), len);
++    // make sure tmp_cache_dir is NULL terminated
++    tmp_cache_dir[len - 1] = '\0';
+ #if defined(_MSC_VER)
+     // No dirname on Windows; use _splitpath_s instead
++    char tmp_cache_path[PATH_MAX];
+     char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
+     _splitpath_s(tmp_cache_dir, drive, _MAX_DRIVE, dir, _MAX_DIR, fname, _MAX_FNAME,
+                  ext, _MAX_EXT);
+@@ -2023,11 +2026,18 @@ Rosstackage::writeCache()
+     _makepath_s(full_dir, _MAX_DRIVE + _MAX_DIR, drive, dir, NULL, NULL);
+     snprintf(tmp_cache_path, sizeof(tmp_cache_path), "%s\\.rospack_cache.XXXXXX", full_dir);
+ #elif defined(__MINGW32__)
++    char tmp_cache_path[PATH_MAX];
+     char* temp_name = tempnam(dirname(tmp_cache_dir),".rospack_cache.");
+     snprintf(tmp_cache_path, sizeof(tmp_cache_path), temp_name);
+     delete temp_name;
+ #else
+-    snprintf(tmp_cache_path, sizeof(tmp_cache_path), "%s/.rospack_cache.XXXXXX", dirname(tmp_cache_dir));
++    char *tmp_cache_path = NULL;
++    char *temp_dirname = strdup(dirname(tmp_cache_dir));
++    free(tmp_cache_dir);
++    len = strlen(temp_dirname) + 22 + 1;
++    tmp_cache_path = (char *)malloc(len);
++    snprintf(tmp_cache_path, len, "%s/.rospack_cache.XXXXXX", temp_dirname);
++    free(temp_dirname);
+ #endif
+ #if defined(__MINGW32__)
+     // There is no equivalent of mkstemp or _mktemp_s on mingw, so we resort to a slightly problematic
+@@ -2085,6 +2095,9 @@ Rosstackage::writeCache()
+         }
+       }
+     }
++#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(WIN32)
++		 free(tmp_cache_path);
++#endif
+   }
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index f794283..80ffc73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-Add-usr-share-as-default-ROS_PACKAGE_PATH.patch
 0003-Make-rospack-usable-without-rosdep.patch
 0004-Limit-search-depth-for-usr-share.patch
+0005-Fix-FTBFS-on-hurd-i386.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/ros-rospack.git



More information about the debian-science-commits mailing list