[med-svn] [Git][med-team/liblemon][master] 5 commits: Cherry-pick selected upstream changes on the 1.3 branch.

Andreas Tille gitlab at salsa.debian.org
Wed Aug 22 15:15:36 BST 2018


Andreas Tille pushed to branch master at Debian Med / liblemon


Commits:
31dcde69 by Ryan Pavlik at 2018-08-10T21:05:32Z
Cherry-pick selected upstream changes on the 1.3 branch.

- - - - -
d85a36c1 by Ryan Pavlik at 2018-08-10T21:23:54Z
d-shlib override libglpk40-dev to libglpk-dev

- - - - -
79c3ea30 by Ryan Pavlik at 2018-08-10T21:23:54Z
Install CMake config to multiarch dir.

- - - - -
9f43e4b4 by Ryan Pavlik at 2018-08-10T21:23:54Z
Modify CMake config file to support multiarch

- - - - -
bd05e5dc by Andreas Tille at 2018-08-22T14:15:17Z
Merge branch 'mergeable-1' into 'master'

Some packaging cleanup/fixes

See merge request med-team/liblemon!1
- - - - -


6 changed files:

- + debian/patches/0002-Threadsafe-CplexEnv-473.patch
- + debian/patches/0003-Fix-wrong-iteration-in-ListGraph-snapshot-part-II.-5.patch
- + debian/patches/0004-Add-missing-include-to-capacity_scaling.h-600.patch
- + debian/patches/0005-Add-missing-break-statement-to-dimacs-solver-609.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/patches/0002-Threadsafe-CplexEnv-473.patch
=====================================
--- /dev/null
+++ b/debian/patches/0002-Threadsafe-CplexEnv-473.patch
@@ -0,0 +1,105 @@
+From: Alpar Juttner <alpar at cs.elte.hu>
+Date: Wed, 6 May 2015 16:01:26 +0200
+Subject: Threadsafe CplexEnv (#473)
+
+---
+ lemon/cplex.cc | 43 ++++++++++++++++++++++++++++++-------------
+ lemon/cplex.h  |  5 +++++
+ 2 files changed, 35 insertions(+), 13 deletions(-)
+
+diff --git a/lemon/cplex.cc b/lemon/cplex.cc
+index 029a3ef..4d519fd 100644
+--- a/lemon/cplex.cc
++++ b/lemon/cplex.cc
+@@ -37,37 +37,54 @@ namespace lemon {
+     }
+   }
+ 
++  void CplexEnv::incCnt()
++  {
++    _cnt_lock->lock();
++    ++(*_cnt);
++    _cnt_lock->unlock();
++  }
++
++  void CplexEnv::decCnt()
++  {
++    _cnt_lock->lock();
++    --(*_cnt);
++    if (*_cnt == 0) {
++      delete _cnt;
++      _cnt_lock->unlock();
++      delete _cnt_lock;
++      CPXcloseCPLEX(&_env);
++    }
++    else _cnt_lock->unlock();
++  }
++  
+   CplexEnv::CplexEnv() {
+     int status;
+-    _cnt = new int;
+-    (*_cnt) = 1;
+     _env = CPXopenCPLEX(&status);
+-    if (_env == 0) {
+-      delete _cnt;
+-      _cnt = 0;
++    if (_env == 0)
+       throw LicenseError(status);
+-    }
++    _cnt = new int;
++    (*_cnt) = 1;
++    _cnt_lock = new bits::Lock;
+   }
+ 
+   CplexEnv::CplexEnv(const CplexEnv& other) {
+     _env = other._env;
+     _cnt = other._cnt;
+-    ++(*_cnt);
++    _cnt_lock = other._cnt_lock;
++    incCnt();
+   }
+ 
+   CplexEnv& CplexEnv::operator=(const CplexEnv& other) {
++    decCnt();
+     _env = other._env;
+     _cnt = other._cnt;
+-    ++(*_cnt);
++    _cnt_lock = other._cnt_lock;
++    incCnt();
+     return *this;
+   }
+ 
+   CplexEnv::~CplexEnv() {
+-    --(*_cnt);
+-    if (*_cnt == 0) {
+-      delete _cnt;
+-      CPXcloseCPLEX(&_env);
+-    }
++    decCnt();
+   }
+ 
+   CplexBase::CplexBase() : LpBase() {
+diff --git a/lemon/cplex.h b/lemon/cplex.h
+index c17e792..2397f9f 100644
+--- a/lemon/cplex.h
++++ b/lemon/cplex.h
+@@ -23,6 +23,7 @@
+ ///\brief Header of the LEMON-CPLEX lp solver interface.
+ 
+ #include <lemon/lp_base.h>
++#include <lemon/bits/lock.h>
+ 
+ struct cpxenv;
+ struct cpxlp;
+@@ -40,7 +41,11 @@ namespace lemon {
+   private:
+     cpxenv* _env;
+     mutable int* _cnt;
++    mutable bits::Lock* _cnt_lock;
+ 
++    void incCnt();
++    void decCnt();
++    
+   public:
+ 
+     /// \brief This exception is thrown when the license check is not


=====================================
debian/patches/0003-Fix-wrong-iteration-in-ListGraph-snapshot-part-II.-5.patch
=====================================
--- /dev/null
+++ b/debian/patches/0003-Fix-wrong-iteration-in-ListGraph-snapshot-part-II.-5.patch
@@ -0,0 +1,30 @@
+From: Alpar Juttner <alpar at cs.elte.hu>
+Date: Fri, 22 May 2015 17:47:18 +0200
+Subject: Fix wrong iteration in ListGraph snapshot, part II. (#598)
+
+---
+ lemon/list_graph.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lemon/list_graph.h b/lemon/list_graph.h
+index 2a236cf..1964f7d 100644
+--- a/lemon/list_graph.h
++++ b/lemon/list_graph.h
+@@ -2299,7 +2299,7 @@ namespace lemon {
+           snapshot.addNode(node);
+         }
+         virtual void add(const std::vector<Node>& nodes) {
+-          for (int i = nodes.size() - 1; i >= 0; ++i) {
++          for (int i = nodes.size() - 1; i >= 0; --i) {
+             snapshot.addNode(nodes[i]);
+           }
+         }
+@@ -2349,7 +2349,7 @@ namespace lemon {
+           snapshot.addEdge(edge);
+         }
+         virtual void add(const std::vector<Edge>& edges) {
+-          for (int i = edges.size() - 1; i >= 0; ++i) {
++          for (int i = edges.size() - 1; i >= 0; --i) {
+             snapshot.addEdge(edges[i]);
+           }
+         }


=====================================
debian/patches/0004-Add-missing-include-to-capacity_scaling.h-600.patch
=====================================
--- /dev/null
+++ b/debian/patches/0004-Add-missing-include-to-capacity_scaling.h-600.patch
@@ -0,0 +1,20 @@
+From: Peter Kovacs <kpeter at inf.elte.hu>
+Date: Fri, 2 Oct 2015 17:41:28 +0200
+Subject: Add missing #include to capacity_scaling.h (#600)
+
+---
+ lemon/capacity_scaling.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lemon/capacity_scaling.h b/lemon/capacity_scaling.h
+index ca64b56..8acd5fe 100644
+--- a/lemon/capacity_scaling.h
++++ b/lemon/capacity_scaling.h
+@@ -27,6 +27,7 @@
+ #include <vector>
+ #include <limits>
+ #include <lemon/core.h>
++#include <lemon/maps.h>
+ #include <lemon/bin_heap.h>
+ 
+ namespace lemon {


=====================================
debian/patches/0005-Add-missing-break-statement-to-dimacs-solver-609.patch
=====================================
--- /dev/null
+++ b/debian/patches/0005-Add-missing-break-statement-to-dimacs-solver-609.patch
@@ -0,0 +1,34 @@
+From: Peter Kovacs <kpeter at inf.elte.hu>
+Date: Thu, 22 Mar 2018 18:46:56 +0100
+Subject: Add missing break statement to dimacs-solver (#609)
+
+---
+ tools/dimacs-solver.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/dimacs-solver.cc b/tools/dimacs-solver.cc
+index 60da233..0ccbcd0 100644
+--- a/tools/dimacs-solver.cc
++++ b/tools/dimacs-solver.cc
+@@ -222,11 +222,13 @@ int main(int argc, const char *argv[]) {
+       if (!output) {
+         throw IoError("Cannot open the file for writing", ap.files()[1]);
+       }
++      // fall through
+     case 1:
+       input.open(ap.files()[0].c_str());
+       if (!input) {
+         throw IoError("File cannot be found", ap.files()[0]);
+       }
++      // fall through
+     case 0:
+       break;
+     default:
+@@ -251,6 +253,7 @@ int main(int argc, const char *argv[]) {
+           break;
+         case DimacsDescriptor::SP:
+           std::cout << "sp";
++          break;
+         case DimacsDescriptor::MAT:
+           std::cout << "mat";
+           break;


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,6 @@
 dynamic_lib.patch
 fix_libname.patch
+0002-Threadsafe-CplexEnv-473.patch
+0003-Fix-wrong-iteration-in-ListGraph-snapshot-part-II.-5.patch
+0004-Add-missing-include-to-capacity_scaling.h-600.patch
+0005-Add-missing-break-statement-to-dimacs-solver-609.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -22,13 +22,16 @@ override_dh_install:
 	# from other package - no idea how to do this so use symlink instead
 	find debian -name jquery.js -delete
 	cp -a obj-*/lemon/liblemon_static.a debian/tmp/usr/lib/liblemon.a
+	# Modify CMake config file to add multiarch 
+	sed -i 's:usr/lib:usr/lib/$(DEB_HOST_MULTIARCH):' debian/tmp/usr/share/lemon/cmake/*
 	d-shlibmove --commit \
 		    --multiarch \
 		    --devunversioned \
                     --exclude-la \
+		    --override "s/libglpk40-dev/libglpk-dev/" \
 		    --movedev debian/tmp/usr/include/* usr/include \
 		    --movedev "debian/tmp/usr/lib/pkgconfig/*.pc" usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
-		    --movedev "debian/tmp/usr/share/lemon/cmake/*" usr/lib/cmake \
+		    --movedev "debian/tmp/usr/share/lemon/cmake/*" usr/lib/$(DEB_HOST_MULTIARCH)/cmake/lemon \
                     debian/tmp/usr/lib/*.so
 
 override_dh_installchangelogs:



View it on GitLab: https://salsa.debian.org/med-team/liblemon/compare/eddcaf6f93b527caca4cf9faa13f1bd8a24782b3...bd05e5dca62bc8edea81dcc5f34627d4d347375f

-- 
View it on GitLab: https://salsa.debian.org/med-team/liblemon/compare/eddcaf6f93b527caca4cf9faa13f1bd8a24782b3...bd05e5dca62bc8edea81dcc5f34627d4d347375f
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180822/759bcefa/attachment-0001.html>


More information about the debian-med-commit mailing list