openSUSE Commits
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2015
- 1 participants
- 1368 discussions
Hello community,
here is the log from the commit of package libetonyek for openSUSE:Factory checked in at 2015-07-02 22:46:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libetonyek (Old)
and /work/SRC/openSUSE:Factory/.libetonyek.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libetonyek"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libetonyek/libetonyek.changes 2015-06-16 14:04:47.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libetonyek.new/libetonyek.changes 2015-07-02 22:46:18.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Jun 24 11:20:19 UTC 2015 - tchvatal(a)suse.com
+
+- Version bump to 0.1.3:
+ * Various small fixes
+ * More imported now imported
+ * Now use mdds to help with some hashing
+- Remove included patch:
+ * 0001-fix-test-on-i386.patch
+
+-------------------------------------------------------------------
Old:
----
0001-fix-test-on-i386.patch
libetonyek-0.1.2.tar.xz
New:
----
libetonyek-0.1.3.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libetonyek.spec ++++++
--- /var/tmp/diff_new_pack.w5CXD3/_old 2015-07-02 22:46:19.000000000 +0200
+++ /var/tmp/diff_new_pack.w5CXD3/_new 2015-07-02 22:46:19.000000000 +0200
@@ -18,15 +18,13 @@
%define libname libetonyek-0_1-1
Name: libetonyek
-Version: 0.1.2
+Version: 0.1.3
Release: 0
Summary: Library for Apple Keynote presentations
License: MPL-2.0
Group: Productivity/Publishing/Word
Url: https://wiki.documentfoundation.org/DLP/Libraries/libetonyek
Source0: http://dev-www.libreoffice.org/src/%{name}/%{name}-%{version}.tar.xz
-# PATCH-FIX-UPSTREAM: fix i586 tests, from upstream git
-Patch0: 0001-fix-test-on-i386.patch
BuildRequires: boost-devel
BuildRequires: doxygen
BuildRequires: fdupes
@@ -40,6 +38,7 @@
BuildRequires: pkgconfig(librevenge-generators-0.0)
BuildRequires: pkgconfig(librevenge-stream-0.0)
BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(mdds) >= 0.12.1
BuildRequires: pkgconfig(zlib)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -70,9 +69,7 @@
%package devel-doc
Summary: Documentation for the libetonyek API
Group: Documentation/HTML
-%if 0%{?suse_version} > 1200
BuildArch: noarch
-%endif
%description devel-doc
This package contains documentation for the libetonyek API.
@@ -86,7 +83,6 @@
%prep
%setup -q
-%patch0 -p1
%build
export CXXFLAGS="%{optflags} -fvisibility-inlines-hidden"
++++++ libetonyek-0.1.2.tar.xz -> libetonyek-0.1.3.tar.xz ++++++
++++ 19896 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package mdds for openSUSE:Factory checked in at 2015-07-02 22:46:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mdds (Old)
and /work/SRC/openSUSE:Factory/.mdds.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mdds"
Changes:
--------
--- /work/SRC/openSUSE:Factory/mdds/mdds.changes 2015-04-05 02:02:52.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.mdds.new/mdds.changes 2015-07-02 22:46:04.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jun 24 12:04:51 UTC 2015 - tchvatal(a)suse.com
+
+- Version bump to 0.12.1:
+ * Various small fixes on 0.12 series
+
+-------------------------------------------------------------------
Old:
----
mdds_0.12.0.tar.bz2
New:
----
mdds_0.12.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mdds.spec ++++++
--- /var/tmp/diff_new_pack.mXOtGu/_old 2015-07-02 22:46:05.000000000 +0200
+++ /var/tmp/diff_new_pack.mXOtGu/_new 2015-07-02 22:46:05.000000000 +0200
@@ -19,7 +19,7 @@
# redefined as we put there just devel docs
%define _docdir %{_defaultdocdir}/%{name}-devel
Name: mdds
-Version: 0.12.0
+Version: 0.12.1
Release: 0
Summary: A collection of multi-dimensional data structure and indexing algorithm
License: MIT
++++++ mdds_0.12.0.tar.bz2 -> mdds_0.12.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/.gitignore new/mdds_0.12.1/.gitignore
--- old/mdds_0.12.0/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/mdds_0.12.1/.gitignore 2015-06-12 01:53:55.000000000 +0200
@@ -0,0 +1,13 @@
+autom4te.cache/
+config.log
+config.status
+configure
+Makefile
+misc/mdds.pc
+obj/
+VERSION
+
+# tests
+*_test
+multi_type_vector_test_custom
+multi_type_vector_test_default
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/NEWS new/mdds_0.12.1/NEWS
--- old/mdds_0.12.0/NEWS 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/NEWS 2015-06-12 01:53:55.000000000 +0200
@@ -1,3 +1,11 @@
+mdds 0.12.1
+
+* flat_segment_tree
+
+ * removed construction-from-int requirement from value_type to allow
+ non-numeric types to be stored.
+ * removed construction-from-int requirement from key_type as well.
+
mdds 0.12.0
* segment_tree
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/configure new/mdds_0.12.1/configure
--- old/mdds_0.12.0/configure 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/configure 2015-06-12 01:53:55.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mdds 0.12.0.
+# Generated by GNU Autoconf 2.69 for mdds 0.12.1.
#
# Report bugs to <kohei.yoshida(a)gmail.com>.
#
@@ -579,8 +579,8 @@
# Identity of this package.
PACKAGE_NAME='mdds'
PACKAGE_TARNAME='mdds'
-PACKAGE_VERSION='0.12.0'
-PACKAGE_STRING='mdds 0.12.0'
+PACKAGE_VERSION='0.12.1'
+PACKAGE_STRING='mdds 0.12.1'
PACKAGE_BUGREPORT='kohei.yoshida(a)gmail.com'
PACKAGE_URL=''
@@ -1181,7 +1181,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mdds 0.12.0 to adapt to many kinds of systems.
+\`configure' configures mdds 0.12.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1242,7 +1242,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mdds 0.12.0:";;
+ short | recursive ) echo "Configuration of mdds 0.12.1:";;
esac
cat <<\_ACEOF
@@ -1335,7 +1335,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mdds configure 0.12.0
+mdds configure 0.12.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1352,7 +1352,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mdds $as_me 0.12.0, which was
+It was created by mdds $as_me 0.12.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -1701,7 +1701,7 @@
-VERSION=0.12.0
+VERSION=0.12.1
PACKAGE_TARNAME=mdds
@@ -2298,7 +2298,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mdds $as_me 0.12.0, which was
+This file was extended by mdds $as_me 0.12.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2351,7 +2351,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mdds config.status 0.12.0
+mdds config.status 0.12.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -3455,7 +3455,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mdds $as_me 0.12.0, which was
+This file was extended by mdds $as_me 0.12.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3508,7 +3508,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mdds config.status 0.12.0
+mdds config.status 0.12.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -4613,7 +4613,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mdds $as_me 0.12.0, which was
+This file was extended by mdds $as_me 0.12.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4666,7 +4666,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mdds config.status 0.12.0
+mdds config.status 0.12.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -5772,7 +5772,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mdds $as_me 0.12.0, which was
+This file was extended by mdds $as_me 0.12.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5825,7 +5825,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mdds config.status 0.12.0
+mdds config.status 0.12.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/configure.ac new/mdds_0.12.1/configure.ac
--- old/mdds_0.12.0/configure.ac 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/configure.ac 2015-06-12 01:53:55.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT(mdds, 0.12.0, kohei.yoshida(a)gmail.com)
+AC_INIT(mdds, 0.12.1, kohei.yoshida(a)gmail.com)
VERSION=AC_PACKAGE_VERSION
AC_SUBST(VERSION)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/include/mdds/flat_segment_tree.hpp new/mdds_0.12.1/include/mdds/flat_segment_tree.hpp
--- old/mdds_0.12.0/include/mdds/flat_segment_tree.hpp 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/include/mdds/flat_segment_tree.hpp 2015-06-12 01:53:55.000000000 +0200
@@ -63,8 +63,8 @@
}
nonleaf_value_type()
- : low(0)
- , high(0)
+ : low()
+ , high()
{
}
};
@@ -80,8 +80,8 @@
}
leaf_value_type()
- : key(0)
- , value(0)
+ : key()
+ , value()
{
}
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/include/mdds/multi_type_vector_types.hpp new/mdds_0.12.1/include/mdds/multi_type_vector_types.hpp
--- old/mdds_0.12.0/include/mdds/multi_type_vector_types.hpp 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/include/mdds/multi_type_vector_types.hpp 2015-06-12 01:53:55.000000000 +0200
@@ -33,6 +33,7 @@
#include "global.hpp"
#include <algorithm>
+#include <cassert>
#ifdef MDDS_MULTI_TYPE_VECTOR_USE_DEQUE
#include <deque>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/include/mdds/quad_node.hpp new/mdds_0.12.1/include/mdds/quad_node.hpp
--- old/mdds_0.12.0/include/mdds/quad_node.hpp 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/include/mdds/quad_node.hpp 2015-06-12 01:53:55.000000000 +0200
@@ -30,6 +30,8 @@
#include "mdds/global.hpp"
+#include <cassert>
+
#include <boost/intrusive_ptr.hpp>
namespace mdds {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/include/mdds/segment_tree.hpp new/mdds_0.12.1/include/mdds/segment_tree.hpp
--- old/mdds_0.12.0/include/mdds/segment_tree.hpp 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/include/mdds/segment_tree.hpp 2015-06-12 01:53:55.000000000 +0200
@@ -770,547 +770,8 @@
bool m_valid_tree:1;
};
-template<typename _Key, typename _Data>
-segment_tree<_Key, _Data>::segment_tree()
- : m_root_node(NULL)
- , m_valid_tree(false)
-{
}
-template<typename _Key, typename _Data>
-segment_tree<_Key, _Data>::segment_tree(const segment_tree& r)
- : m_segment_data(r.m_segment_data)
- , m_root_node(NULL)
- , m_valid_tree(r.m_valid_tree)
-{
- if (m_valid_tree)
- build_tree();
-}
-
-template<typename _Key, typename _Data>
-segment_tree<_Key, _Data>::~segment_tree()
-{
- clear_all_nodes();
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::operator==(const segment_tree& r) const
-{
- if (m_valid_tree != r.m_valid_tree)
- return false;
-
- // Sort the data by key values first.
- sorted_segment_map_type seg1(m_segment_data.begin(), m_segment_data.end());
- sorted_segment_map_type seg2(r.m_segment_data.begin(), r.m_segment_data.end());
- typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
- typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
-
- for (; itr1 != itr1_end; ++itr1, ++itr2)
- {
- if (itr2 == itr2_end)
- return false;
-
- if (*itr1 != *itr2)
- return false;
- }
- if (itr2 != itr2_end)
- return false;
-
- return true;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::build_tree()
-{
- build_leaf_nodes();
- m_nonleaf_node_pool.clear();
-
- // Count the number of leaf nodes.
- size_t leaf_count = __st::count_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
-
- // Determine the total number of non-leaf nodes needed to build the whole tree.
- size_t nonleaf_count = __st::count_needed_nonleaf_nodes(leaf_count);
-
- m_nonleaf_node_pool.resize(nonleaf_count);
-
- mdds::__st::tree_builder<segment_tree> builder(m_nonleaf_node_pool);
- m_root_node = builder.build(m_left_leaf);
-
- // Start "inserting" all segments from the root.
- typename segment_map_type::const_iterator itr,
- itr_beg = m_segment_data.begin(), itr_end = m_segment_data.end();
-
- data_node_map_type tagged_node_map;
- for (itr = itr_beg; itr != itr_end; ++itr)
- {
- data_type pdata = itr->first;
- ::std::pair<typename data_node_map_type::iterator, bool> r =
- tagged_node_map.insert(pdata, new node_list_type);
- node_list_type* plist = r.first->second;
- plist->reserve(10);
-
- descend_tree_and_mark(m_root_node, pdata, itr->second.first, itr->second.second, plist);
- }
-
- m_tagged_node_map.swap(tagged_node_map);
- m_valid_tree = true;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::descend_tree_and_mark(
- __st::node_base* pnode, data_type pdata, key_type begin_key, key_type end_key, node_list_type* plist)
-{
- if (!pnode)
- return;
-
- if (pnode->is_leaf)
- {
- // This is a leaf node.
- node* pleaf = static_cast<node*>(pnode);
- if (begin_key <= pleaf->value_leaf.key && pleaf->value_leaf.key < end_key)
- {
- leaf_value_type& v = pleaf->value_leaf;
- if (!v.data_chain)
- v.data_chain = new data_chain_type;
- v.data_chain->push_back(pdata);
- plist->push_back(pnode);
- }
- return;
- }
-
- nonleaf_node* pnonleaf = static_cast<nonleaf_node*>(pnode);
- if (end_key < pnonleaf->value_nonleaf.low || pnonleaf->value_nonleaf.high <= begin_key)
- return;
-
- nonleaf_value_type& v = pnonleaf->value_nonleaf;
- if (begin_key <= v.low && v.high < end_key)
- {
- // mark this non-leaf node and stop.
- if (!v.data_chain)
- v.data_chain = new data_chain_type;
- v.data_chain->push_back(pdata);
- plist->push_back(pnode);
- return;
- }
-
- descend_tree_and_mark(pnonleaf->left, pdata, begin_key, end_key, plist);
- descend_tree_and_mark(pnonleaf->right, pdata, begin_key, end_key, plist);
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::build_leaf_nodes()
-{
- using namespace std;
-
- disconnect_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
-
- // In 1st pass, collect unique end-point values and sort them.
- vector<key_type> keys_uniq;
- keys_uniq.reserve(m_segment_data.size()*2);
- typename segment_map_type::const_iterator itr, itr_beg = m_segment_data.begin(), itr_end = m_segment_data.end();
- for (itr = itr_beg; itr != itr_end; ++itr)
- {
- keys_uniq.push_back(itr->second.first);
- keys_uniq.push_back(itr->second.second);
- }
-
- // sort and remove duplicates.
- sort(keys_uniq.begin(), keys_uniq.end());
- keys_uniq.erase(unique(keys_uniq.begin(), keys_uniq.end()), keys_uniq.end());
-
- create_leaf_node_instances(keys_uniq, m_left_leaf, m_right_leaf);
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::create_leaf_node_instances(const ::std::vector<key_type>& keys, node_ptr& left, node_ptr& right)
-{
- if (keys.empty() || keys.size() < 2)
- // We need at least two keys in order to build tree.
- return;
-
- typename ::std::vector<key_type>::const_iterator itr = keys.begin(), itr_end = keys.end();
-
- // left-most node
- left.reset(new node);
- left->value_leaf.key = *itr;
-
- // move on to next.
- left->next.reset(new node);
- node_ptr prev_node = left;
- node_ptr cur_node = left->next;
- cur_node->prev = prev_node;
-
- for (++itr; itr != itr_end; ++itr)
- {
- cur_node->value_leaf.key = *itr;
-
- // move on to next
- cur_node->next.reset(new node);
- prev_node = cur_node;
- cur_node = cur_node->next;
- cur_node->prev = prev_node;
- }
-
- // Remove the excess node.
- prev_node->next.reset();
- right = prev_node;
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::insert(key_type begin_key, key_type end_key, data_type pdata)
-{
- if (begin_key >= end_key)
- return false;
-
- if (m_segment_data.find(pdata) != m_segment_data.end())
- // Insertion of duplicate data is not allowed.
- return false;
-
- ::std::pair<key_type, key_type> range;
- range.first = begin_key;
- range.second = end_key;
- m_segment_data.insert(typename segment_map_type::value_type(pdata, range));
-
- m_valid_tree = false;
- return true;
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::search(key_type point, search_result_type& result) const
-{
- if (!m_valid_tree)
- // Tree is invalidated.
- return false;
-
- if (!m_root_node)
- // Tree doesn't exist. Since the tree is flagged valid, this means no
- // segments have been inserted.
- return true;
-
- search_result_vector_inserter result_inserter(result);
- typedef segment_tree<_Key,_Data> tree_type;
- __st::descend_tree_for_search<
- tree_type, search_result_vector_inserter>(point, m_root_node, result_inserter);
- return true;
-}
-
-template<typename _Key, typename _Data>
-typename segment_tree<_Key, _Data>::search_result
-segment_tree<_Key, _Data>::search(key_type point) const
-{
- search_result result;
- if (!m_valid_tree || !m_root_node)
- return result;
-
- search_result_inserter result_inserter(result);
- typedef segment_tree<_Key,_Data> tree_type;
- __st::descend_tree_for_search<tree_type, search_result_inserter>(
- point, m_root_node, result_inserter);
-
- return result;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::search(key_type point, search_result_base& result) const
-{
- if (!m_valid_tree || !m_root_node)
- return;
-
- search_result_inserter result_inserter(result);
- typedef segment_tree<_Key,_Data> tree_type;
- __st::descend_tree_for_search<tree_type>(point, m_root_node, result_inserter);
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::remove(data_type pdata)
-{
- using namespace std;
-
- typename data_node_map_type::iterator itr = m_tagged_node_map.find(pdata);
- if (itr != m_tagged_node_map.end())
- {
- // Tagged node list found. Remove all the tags from the tree nodes.
- node_list_type* plist = itr->second;
- if (!plist)
- return;
-
- remove_data_from_nodes(plist, pdata);
-
- // Remove the tags associated with this pointer from the data set.
- m_tagged_node_map.erase(itr);
- }
-
- // Remove from the segment data array.
- m_segment_data.erase(pdata);
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::clear()
-{
- m_tagged_node_map.clear();
- m_segment_data.clear();
- clear_all_nodes();
- m_valid_tree = false;
-}
-
-template<typename _Key, typename _Data>
-size_t segment_tree<_Key, _Data>::size() const
-{
- return m_segment_data.size();
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::empty() const
-{
- return m_segment_data.empty();
-}
-
-template<typename _Key, typename _Value>
-size_t segment_tree<_Key, _Value>::leaf_size() const
-{
- return __st::count_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::remove_data_from_nodes(node_list_type* plist, const data_type pdata)
-{
- typename node_list_type::iterator itr = plist->begin(), itr_end = plist->end();
- for (; itr != itr_end; ++itr)
- {
- data_chain_type* chain = NULL;
- __st::node_base* p = *itr;
- if (p->is_leaf)
- chain = static_cast<node*>(p)->value_leaf.data_chain;
- else
- chain = static_cast<nonleaf_node*>(p)->value_nonleaf.data_chain;
-
- if (!chain)
- continue;
-
- remove_data_from_chain(*chain, pdata);
- }
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::remove_data_from_chain(data_chain_type& chain, const data_type pdata)
-{
- typename data_chain_type::iterator itr = ::std::find(chain.begin(), chain.end(), pdata);
- if (itr != chain.end())
- {
- *itr = chain.back();
- chain.pop_back();
- }
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::clear_all_nodes()
-{
- disconnect_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
- m_nonleaf_node_pool.clear();
- m_left_leaf.reset();
- m_right_leaf.reset();
- m_root_node = NULL;
-}
-
-#ifdef MDDS_UNIT_TEST
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::dump_tree() const
-{
- using ::std::cout;
- using ::std::endl;
-
- if (!m_valid_tree)
- assert(!"attempted to dump an invalid tree!");
-
- cout << "dump tree ------------------------------------------------------" << endl;
- size_t node_count = mdds::__st::tree_dumper<node, nonleaf_node>::dump(m_root_node);
- size_t node_instance_count = node::get_instance_count();
-
- cout << "tree node count = " << node_count << " node instance count = " << node_instance_count << endl;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::dump_leaf_nodes() const
-{
- using ::std::cout;
- using ::std::endl;
-
- cout << "dump leaf nodes ------------------------------------------------" << endl;
-
- node* p = m_left_leaf.get();
- while (p)
- {
- print_leaf_value(p->value_leaf);
- p = p->next.get();
- }
- cout << " node instance count = " << node::get_instance_count() << endl;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::dump_segment_data() const
-{
- using namespace std;
- cout << "dump segment data ----------------------------------------------" << endl;
-
- segment_map_printer func;
- for_each(m_segment_data.begin(), m_segment_data.end(), func);
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::verify_node_lists() const
-{
- using namespace std;
-
- typename data_node_map_type::const_iterator
- itr = m_tagged_node_map.begin(), itr_end = m_tagged_node_map.end();
- for (; itr != itr_end; ++itr)
- {
- // Print stored nodes.
- cout << "node list " << itr->first->name << ": ";
- const node_list_type* plist = itr->second;
- assert(plist);
- node_printer func;
- for_each(plist->begin(), plist->end(), func);
- cout << endl;
-
- // Verify that all of these nodes have the data pointer.
- if (!has_data_pointer(*plist, itr->first))
- return false;
- }
- return true;
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::verify_leaf_nodes(const ::std::vector<leaf_node_check>& checks) const
-{
- using namespace std;
-
- node* cur_node = m_left_leaf.get();
- typename ::std::vector<leaf_node_check>::const_iterator itr = checks.begin(), itr_end = checks.end();
- for (; itr != itr_end; ++itr)
- {
- if (!cur_node)
- // Position past the right-mode node. Invalid.
- return false;
-
- if (cur_node->value_leaf.key != itr->key)
- // Key values differ.
- return false;
-
- if (itr->data_chain.empty())
- {
- if (cur_node->value_leaf.data_chain)
- // The data chain should be empty (i.e. the pointer should be NULL).
- return false;
- }
- else
- {
- if (!cur_node->value_leaf.data_chain)
- // This node should have data pointers!
- return false;
-
- data_chain_type chain1 = itr->data_chain;
- data_chain_type chain2 = *cur_node->value_leaf.data_chain;
-
- if (chain1.size() != chain2.size())
- return false;
-
- ::std::vector<data_type> test1, test2;
- test1.reserve(chain1.size());
- test2.reserve(chain2.size());
- copy(chain1.begin(), chain1.end(), back_inserter(test1));
- copy(chain2.begin(), chain2.end(), back_inserter(test2));
-
- // Sort both arrays before comparing them.
- sort(test1.begin(), test1.end());
- sort(test2.begin(), test2.end());
-
- if (test1 != test2)
- return false;
- }
-
- cur_node = cur_node->next.get();
- }
-
- if (cur_node)
- // At this point, we expect the current node to be at the position
- // past the right-most node, which is NULL.
- return false;
-
- return true;
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::verify_segment_data(const segment_map_type& checks) const
-{
- // Sort the data by key values first.
- sorted_segment_map_type seg1(checks.begin(), checks.end());
- sorted_segment_map_type seg2(m_segment_data.begin(), m_segment_data.end());
-
- typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
- typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
- for (; itr1 != itr1_end; ++itr1, ++itr2)
- {
- if (itr2 == itr2_end)
- return false;
-
- if (*itr1 != *itr2)
- return false;
- }
- if (itr2 != itr2_end)
- return false;
-
- return true;
-}
-
-template<typename _Key, typename _Data>
-bool segment_tree<_Key, _Data>::has_data_pointer(const node_list_type& node_list, const data_type pdata)
-{
- using namespace std;
-
- typename node_list_type::const_iterator
- itr = node_list.begin(), itr_end = node_list.end();
-
- for (; itr != itr_end; ++itr)
- {
- // Check each node, and make sure each node has the pdata pointer
- // listed.
- const __st::node_base* pnode = *itr;
- const data_chain_type* chain = NULL;
- if (pnode->is_leaf)
- chain = static_cast<const node*>(pnode)->value_leaf.data_chain;
- else
- chain = static_cast<const nonleaf_node*>(pnode)->value_nonleaf.data_chain;
-
- if (!chain)
- return false;
-
- if (find(chain->begin(), chain->end(), pdata) == chain->end())
- return false;
- }
- return true;
-}
-
-template<typename _Key, typename _Data>
-void segment_tree<_Key, _Data>::print_leaf_value(const leaf_value_type& v)
-{
- using namespace std;
- cout << v.key << ": { ";
- if (v.data_chain)
- {
- const data_chain_type* pchain = v.data_chain;
- typename data_chain_type::const_iterator itr, itr_beg = pchain->begin(), itr_end = pchain->end();
- for (itr = itr_beg; itr != itr_end; ++itr)
- {
- if (itr != itr_beg)
- cout << ", ";
- cout << (*itr)->name;
- }
- }
- cout << " }" << endl;
-}
-#endif
-
-}
+#include "segment_tree_def.inl"
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/include/mdds/segment_tree_def.inl new/mdds_0.12.1/include/mdds/segment_tree_def.inl
--- old/mdds_0.12.0/include/mdds/segment_tree_def.inl 1970-01-01 01:00:00.000000000 +0100
+++ new/mdds_0.12.1/include/mdds/segment_tree_def.inl 2015-06-12 01:53:55.000000000 +0200
@@ -0,0 +1,571 @@
+/*************************************************************************
+*
+* Copyright (c) 2015 Kohei Yoshida
+*
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*
+************************************************************************/
+
+namespace mdds {
+
+template<typename _Key, typename _Data>
+segment_tree<_Key, _Data>::segment_tree()
+ : m_root_node(NULL)
+ , m_valid_tree(false)
+{
+}
+
+template<typename _Key, typename _Data>
+segment_tree<_Key, _Data>::segment_tree(const segment_tree& r)
+ : m_segment_data(r.m_segment_data)
+ , m_root_node(NULL)
+ , m_valid_tree(r.m_valid_tree)
+{
+ if (m_valid_tree)
+ build_tree();
+}
+
+template<typename _Key, typename _Data>
+segment_tree<_Key, _Data>::~segment_tree()
+{
+ clear_all_nodes();
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::operator==(const segment_tree& r) const
+{
+ if (m_valid_tree != r.m_valid_tree)
+ return false;
+
+ // Sort the data by key values first.
+ sorted_segment_map_type seg1(m_segment_data.begin(), m_segment_data.end());
+ sorted_segment_map_type seg2(r.m_segment_data.begin(), r.m_segment_data.end());
+ typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
+ typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
+
+ for (; itr1 != itr1_end; ++itr1, ++itr2)
+ {
+ if (itr2 == itr2_end)
+ return false;
+
+ if (*itr1 != *itr2)
+ return false;
+ }
+ if (itr2 != itr2_end)
+ return false;
+
+ return true;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::build_tree()
+{
+ build_leaf_nodes();
+ m_nonleaf_node_pool.clear();
+
+ // Count the number of leaf nodes.
+ size_t leaf_count = __st::count_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
+
+ // Determine the total number of non-leaf nodes needed to build the whole tree.
+ size_t nonleaf_count = __st::count_needed_nonleaf_nodes(leaf_count);
+
+ m_nonleaf_node_pool.resize(nonleaf_count);
+
+ mdds::__st::tree_builder<segment_tree> builder(m_nonleaf_node_pool);
+ m_root_node = builder.build(m_left_leaf);
+
+ // Start "inserting" all segments from the root.
+ typename segment_map_type::const_iterator itr,
+ itr_beg = m_segment_data.begin(), itr_end = m_segment_data.end();
+
+ data_node_map_type tagged_node_map;
+ for (itr = itr_beg; itr != itr_end; ++itr)
+ {
+ data_type pdata = itr->first;
+ ::std::pair<typename data_node_map_type::iterator, bool> r =
+ tagged_node_map.insert(pdata, new node_list_type);
+ node_list_type* plist = r.first->second;
+ plist->reserve(10);
+
+ descend_tree_and_mark(m_root_node, pdata, itr->second.first, itr->second.second, plist);
+ }
+
+ m_tagged_node_map.swap(tagged_node_map);
+ m_valid_tree = true;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::descend_tree_and_mark(
+ __st::node_base* pnode, data_type pdata, key_type begin_key, key_type end_key, node_list_type* plist)
+{
+ if (!pnode)
+ return;
+
+ if (pnode->is_leaf)
+ {
+ // This is a leaf node.
+ node* pleaf = static_cast<node*>(pnode);
+ if (begin_key <= pleaf->value_leaf.key && pleaf->value_leaf.key < end_key)
+ {
+ leaf_value_type& v = pleaf->value_leaf;
+ if (!v.data_chain)
+ v.data_chain = new data_chain_type;
+ v.data_chain->push_back(pdata);
+ plist->push_back(pnode);
+ }
+ return;
+ }
+
+ nonleaf_node* pnonleaf = static_cast<nonleaf_node*>(pnode);
+ if (end_key < pnonleaf->value_nonleaf.low || pnonleaf->value_nonleaf.high <= begin_key)
+ return;
+
+ nonleaf_value_type& v = pnonleaf->value_nonleaf;
+ if (begin_key <= v.low && v.high < end_key)
+ {
+ // mark this non-leaf node and stop.
+ if (!v.data_chain)
+ v.data_chain = new data_chain_type;
+ v.data_chain->push_back(pdata);
+ plist->push_back(pnode);
+ return;
+ }
+
+ descend_tree_and_mark(pnonleaf->left, pdata, begin_key, end_key, plist);
+ descend_tree_and_mark(pnonleaf->right, pdata, begin_key, end_key, plist);
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::build_leaf_nodes()
+{
+ using namespace std;
+
+ disconnect_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
+
+ // In 1st pass, collect unique end-point values and sort them.
+ vector<key_type> keys_uniq;
+ keys_uniq.reserve(m_segment_data.size()*2);
+ typename segment_map_type::const_iterator itr, itr_beg = m_segment_data.begin(), itr_end = m_segment_data.end();
+ for (itr = itr_beg; itr != itr_end; ++itr)
+ {
+ keys_uniq.push_back(itr->second.first);
+ keys_uniq.push_back(itr->second.second);
+ }
+
+ // sort and remove duplicates.
+ sort(keys_uniq.begin(), keys_uniq.end());
+ keys_uniq.erase(unique(keys_uniq.begin(), keys_uniq.end()), keys_uniq.end());
+
+ create_leaf_node_instances(keys_uniq, m_left_leaf, m_right_leaf);
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::create_leaf_node_instances(const ::std::vector<key_type>& keys, node_ptr& left, node_ptr& right)
+{
+ if (keys.empty() || keys.size() < 2)
+ // We need at least two keys in order to build tree.
+ return;
+
+ typename ::std::vector<key_type>::const_iterator itr = keys.begin(), itr_end = keys.end();
+
+ // left-most node
+ left.reset(new node);
+ left->value_leaf.key = *itr;
+
+ // move on to next.
+ left->next.reset(new node);
+ node_ptr prev_node = left;
+ node_ptr cur_node = left->next;
+ cur_node->prev = prev_node;
+
+ for (++itr; itr != itr_end; ++itr)
+ {
+ cur_node->value_leaf.key = *itr;
+
+ // move on to next
+ cur_node->next.reset(new node);
+ prev_node = cur_node;
+ cur_node = cur_node->next;
+ cur_node->prev = prev_node;
+ }
+
+ // Remove the excess node.
+ prev_node->next.reset();
+ right = prev_node;
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::insert(key_type begin_key, key_type end_key, data_type pdata)
+{
+ if (begin_key >= end_key)
+ return false;
+
+ if (m_segment_data.find(pdata) != m_segment_data.end())
+ // Insertion of duplicate data is not allowed.
+ return false;
+
+ ::std::pair<key_type, key_type> range;
+ range.first = begin_key;
+ range.second = end_key;
+ m_segment_data.insert(typename segment_map_type::value_type(pdata, range));
+
+ m_valid_tree = false;
+ return true;
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::search(key_type point, search_result_type& result) const
+{
+ if (!m_valid_tree)
+ // Tree is invalidated.
+ return false;
+
+ if (!m_root_node)
+ // Tree doesn't exist. Since the tree is flagged valid, this means no
+ // segments have been inserted.
+ return true;
+
+ search_result_vector_inserter result_inserter(result);
+ typedef segment_tree<_Key,_Data> tree_type;
+ __st::descend_tree_for_search<
+ tree_type, search_result_vector_inserter>(point, m_root_node, result_inserter);
+ return true;
+}
+
+template<typename _Key, typename _Data>
+typename segment_tree<_Key, _Data>::search_result
+segment_tree<_Key, _Data>::search(key_type point) const
+{
+ search_result result;
+ if (!m_valid_tree || !m_root_node)
+ return result;
+
+ search_result_inserter result_inserter(result);
+ typedef segment_tree<_Key,_Data> tree_type;
+ __st::descend_tree_for_search<tree_type, search_result_inserter>(
+ point, m_root_node, result_inserter);
+
+ return result;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::search(key_type point, search_result_base& result) const
+{
+ if (!m_valid_tree || !m_root_node)
+ return;
+
+ search_result_inserter result_inserter(result);
+ typedef segment_tree<_Key,_Data> tree_type;
+ __st::descend_tree_for_search<tree_type>(point, m_root_node, result_inserter);
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::remove(data_type pdata)
+{
+ using namespace std;
+
+ typename data_node_map_type::iterator itr = m_tagged_node_map.find(pdata);
+ if (itr != m_tagged_node_map.end())
+ {
+ // Tagged node list found. Remove all the tags from the tree nodes.
+ node_list_type* plist = itr->second;
+ if (!plist)
+ return;
+
+ remove_data_from_nodes(plist, pdata);
+
+ // Remove the tags associated with this pointer from the data set.
+ m_tagged_node_map.erase(itr);
+ }
+
+ // Remove from the segment data array.
+ m_segment_data.erase(pdata);
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::clear()
+{
+ m_tagged_node_map.clear();
+ m_segment_data.clear();
+ clear_all_nodes();
+ m_valid_tree = false;
+}
+
+template<typename _Key, typename _Data>
+size_t segment_tree<_Key, _Data>::size() const
+{
+ return m_segment_data.size();
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::empty() const
+{
+ return m_segment_data.empty();
+}
+
+template<typename _Key, typename _Value>
+size_t segment_tree<_Key, _Value>::leaf_size() const
+{
+ return __st::count_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::remove_data_from_nodes(node_list_type* plist, const data_type pdata)
+{
+ typename node_list_type::iterator itr = plist->begin(), itr_end = plist->end();
+ for (; itr != itr_end; ++itr)
+ {
+ data_chain_type* chain = NULL;
+ __st::node_base* p = *itr;
+ if (p->is_leaf)
+ chain = static_cast<node*>(p)->value_leaf.data_chain;
+ else
+ chain = static_cast<nonleaf_node*>(p)->value_nonleaf.data_chain;
+
+ if (!chain)
+ continue;
+
+ remove_data_from_chain(*chain, pdata);
+ }
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::remove_data_from_chain(data_chain_type& chain, const data_type pdata)
+{
+ typename data_chain_type::iterator itr = ::std::find(chain.begin(), chain.end(), pdata);
+ if (itr != chain.end())
+ {
+ *itr = chain.back();
+ chain.pop_back();
+ }
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::clear_all_nodes()
+{
+ disconnect_leaf_nodes(m_left_leaf.get(), m_right_leaf.get());
+ m_nonleaf_node_pool.clear();
+ m_left_leaf.reset();
+ m_right_leaf.reset();
+ m_root_node = NULL;
+}
+
+#ifdef MDDS_UNIT_TEST
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::dump_tree() const
+{
+ using ::std::cout;
+ using ::std::endl;
+
+ if (!m_valid_tree)
+ assert(!"attempted to dump an invalid tree!");
+
+ cout << "dump tree ------------------------------------------------------" << endl;
+ size_t node_count = mdds::__st::tree_dumper<node, nonleaf_node>::dump(m_root_node);
+ size_t node_instance_count = node::get_instance_count();
+
+ cout << "tree node count = " << node_count << " node instance count = " << node_instance_count << endl;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::dump_leaf_nodes() const
+{
+ using ::std::cout;
+ using ::std::endl;
+
+ cout << "dump leaf nodes ------------------------------------------------" << endl;
+
+ node* p = m_left_leaf.get();
+ while (p)
+ {
+ print_leaf_value(p->value_leaf);
+ p = p->next.get();
+ }
+ cout << " node instance count = " << node::get_instance_count() << endl;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::dump_segment_data() const
+{
+ using namespace std;
+ cout << "dump segment data ----------------------------------------------" << endl;
+
+ segment_map_printer func;
+ for_each(m_segment_data.begin(), m_segment_data.end(), func);
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::verify_node_lists() const
+{
+ using namespace std;
+
+ typename data_node_map_type::const_iterator
+ itr = m_tagged_node_map.begin(), itr_end = m_tagged_node_map.end();
+ for (; itr != itr_end; ++itr)
+ {
+ // Print stored nodes.
+ cout << "node list " << itr->first->name << ": ";
+ const node_list_type* plist = itr->second;
+ assert(plist);
+ node_printer func;
+ for_each(plist->begin(), plist->end(), func);
+ cout << endl;
+
+ // Verify that all of these nodes have the data pointer.
+ if (!has_data_pointer(*plist, itr->first))
+ return false;
+ }
+ return true;
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::verify_leaf_nodes(const ::std::vector<leaf_node_check>& checks) const
+{
+ using namespace std;
+
+ node* cur_node = m_left_leaf.get();
+ typename ::std::vector<leaf_node_check>::const_iterator itr = checks.begin(), itr_end = checks.end();
+ for (; itr != itr_end; ++itr)
+ {
+ if (!cur_node)
+ // Position past the right-mode node. Invalid.
+ return false;
+
+ if (cur_node->value_leaf.key != itr->key)
+ // Key values differ.
+ return false;
+
+ if (itr->data_chain.empty())
+ {
+ if (cur_node->value_leaf.data_chain)
+ // The data chain should be empty (i.e. the pointer should be NULL).
+ return false;
+ }
+ else
+ {
+ if (!cur_node->value_leaf.data_chain)
+ // This node should have data pointers!
+ return false;
+
+ data_chain_type chain1 = itr->data_chain;
+ data_chain_type chain2 = *cur_node->value_leaf.data_chain;
+
+ if (chain1.size() != chain2.size())
+ return false;
+
+ ::std::vector<data_type> test1, test2;
+ test1.reserve(chain1.size());
+ test2.reserve(chain2.size());
+ copy(chain1.begin(), chain1.end(), back_inserter(test1));
+ copy(chain2.begin(), chain2.end(), back_inserter(test2));
+
+ // Sort both arrays before comparing them.
+ sort(test1.begin(), test1.end());
+ sort(test2.begin(), test2.end());
+
+ if (test1 != test2)
+ return false;
+ }
+
+ cur_node = cur_node->next.get();
+ }
+
+ if (cur_node)
+ // At this point, we expect the current node to be at the position
+ // past the right-most node, which is NULL.
+ return false;
+
+ return true;
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::verify_segment_data(const segment_map_type& checks) const
+{
+ // Sort the data by key values first.
+ sorted_segment_map_type seg1(checks.begin(), checks.end());
+ sorted_segment_map_type seg2(m_segment_data.begin(), m_segment_data.end());
+
+ typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
+ typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
+ for (; itr1 != itr1_end; ++itr1, ++itr2)
+ {
+ if (itr2 == itr2_end)
+ return false;
+
+ if (*itr1 != *itr2)
+ return false;
+ }
+ if (itr2 != itr2_end)
+ return false;
+
+ return true;
+}
+
+template<typename _Key, typename _Data>
+bool segment_tree<_Key, _Data>::has_data_pointer(const node_list_type& node_list, const data_type pdata)
+{
+ using namespace std;
+
+ typename node_list_type::const_iterator
+ itr = node_list.begin(), itr_end = node_list.end();
+
+ for (; itr != itr_end; ++itr)
+ {
+ // Check each node, and make sure each node has the pdata pointer
+ // listed.
+ const __st::node_base* pnode = *itr;
+ const data_chain_type* chain = NULL;
+ if (pnode->is_leaf)
+ chain = static_cast<const node*>(pnode)->value_leaf.data_chain;
+ else
+ chain = static_cast<const nonleaf_node*>(pnode)->value_nonleaf.data_chain;
+
+ if (!chain)
+ return false;
+
+ if (find(chain->begin(), chain->end(), pdata) == chain->end())
+ return false;
+ }
+ return true;
+}
+
+template<typename _Key, typename _Data>
+void segment_tree<_Key, _Data>::print_leaf_value(const leaf_value_type& v)
+{
+ using namespace std;
+ cout << v.key << ": { ";
+ if (v.data_chain)
+ {
+ const data_chain_type* pchain = v.data_chain;
+ typename data_chain_type::const_iterator itr, itr_beg = pchain->begin(), itr_end = pchain->end();
+ for (itr = itr_beg; itr != itr_end; ++itr)
+ {
+ if (itr != itr_beg)
+ cout << ", ";
+ cout << (*itr)->name;
+ }
+ }
+ cout << " }" << endl;
+}
+#endif
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdds_0.12.0/src/flat_segment_tree_test.cpp new/mdds_0.12.1/src/flat_segment_tree_test.cpp
--- old/mdds_0.12.0/src/flat_segment_tree_test.cpp 2015-02-06 03:32:45.000000000 +0100
+++ new/mdds_0.12.1/src/flat_segment_tree_test.cpp 2015-06-12 01:53:55.000000000 +0200
@@ -30,6 +30,7 @@
#include <list>
#include <iostream>
+#include <string>
#include <vector>
#include <limits>
#include <iterator>
@@ -1928,6 +1929,40 @@
assert(!db3.is_tree_valid());
}
+void fst_test_non_numeric_value()
+{
+ stack_printer __stack_printer__("::fst_test_non_numeric_value");
+
+ typedef flat_segment_tree<int, std::string> db_type;
+ db_type db(0, 4, "42");
+ db.insert_back(1, 2, "hello world");
+
+ assert(db.default_value() == "42");
+
+ std::string result;
+ db.search(1, result);
+
+ assert(result == "hello world");
+}
+
+void fst_test_non_numeric_key()
+{
+ stack_printer __stack_printer__("::fst_test_non_numeric_key");
+
+ typedef flat_segment_tree<std::string, int> db_type;
+ db_type db("a", "h", 42);
+ db.insert_back("c", "f", 1);
+
+ assert(db.default_value() == 42);
+
+ int result(0);
+
+ db.search("d", result);
+ assert(result == 1);
+ db.search("f", result);
+ assert(result == 42);
+}
+
int main (int argc, char **argv)
{
try
@@ -1982,6 +2017,8 @@
fst_test_swap();
fst_test_clear();
fst_test_assignment();
+ fst_test_non_numeric_value();
+ fst_test_non_numeric_key();
}
if (opt.test_perf)
1
0
Hello community,
here is the log from the commit of package libgcrypt for openSUSE:Factory checked in at 2015-07-02 22:45:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libgcrypt (Old)
and /work/SRC/openSUSE:Factory/.libgcrypt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgcrypt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libgcrypt/libgcrypt.changes 2015-03-05 18:15:55.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libgcrypt.new/libgcrypt.changes 2015-07-02 22:45:57.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 23 15:15:30 UTC 2015 - dvaleev(a)suse.com
+
+- Fix gpg2 tests on BigEndian architectures: s390x ppc64
+ libgcrypt-1.6.3-aliasing.patch
+
+-------------------------------------------------------------------
New:
----
libgcrypt-1.6.3-aliasing.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libgcrypt.spec ++++++
--- /var/tmp/diff_new_pack.KL6Chv/_old 2015-07-02 22:45:59.000000000 +0200
+++ /var/tmp/diff_new_pack.KL6Chv/_new 2015-07-02 22:45:59.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package libgcrypt
#
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -68,6 +68,7 @@
Patch32: libgcrypt-fips_run_selftest_at_constructor.patch
#PATCH-FIX-SUSE bnc#896202 make ECDSA compliant with FIPS 186-4
Patch33: libgcrypt-fips_ecdsa.patch
+Patch34: libgcrypt-1.6.3-aliasing.patch
BuildRequires: automake >= 1.14
BuildRequires: libgpg-error-devel >= 1.11
BuildRequires: libtool
@@ -170,6 +171,7 @@
%patch31 -p1
%patch32 -p1
%patch33 -p1
+%patch34 -p1
%endif
%patch13 -p1
%patch14 -p1
++++++ libgcrypt-1.6.3-aliasing.patch ++++++
diff -up libgcrypt-1.6.3/cipher/bufhelp.h.aliasing libgcrypt-1.6.3/cipher/bufhelp.h
--- libgcrypt-1.6.3/cipher/bufhelp.h.aliasing 2015-02-27 10:54:03.000000000 +0100
+++ libgcrypt-1.6.3/cipher/bufhelp.h 2015-03-13 15:03:43.301749751 +0100
@@ -80,7 +80,7 @@ do_bytes:
for (; len; len--)
*dst++ = *src++;
#endif /*__GNUC__ >= 4 && (__x86_64__ || __i386__)*/
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
/* Optimized function for buffer xoring */
@@ -117,7 +117,7 @@ do_bytes:
/* Handle tail. */
for (; len; len--)
*dst++ = *src1++ ^ *src2++;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
/* Optimized function for buffer xoring with two destination buffers. Used
@@ -155,7 +155,7 @@ do_bytes:
/* Handle tail. */
for (; len; len--)
*dst1++ = (*dst2++ ^= *src++);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
/* Optimized function for combined buffer xoring and copying. Used by mainly
@@ -208,7 +208,7 @@ do_bytes:
*dst_xor++ = *srcdst_cpy ^ *src_xor++;
*srcdst_cpy++ = temp;
}
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
/* Optimized function for combined buffer xoring and copying. Used by mainly
@@ -234,7 +234,7 @@ buf_eq_const(const void *_a, const void
diff -= !!(a[i] - b[i]);
return !diff;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
#ifndef BUFHELP_FAST_UNALIGNED_ACCESS
@@ -246,14 +246,14 @@ static inline u32 buf_get_be32(const voi
const byte *in = _buf;
return ((u32)in[0] << 24) | ((u32)in[1] << 16) | \
((u32)in[2] << 8) | (u32)in[3];
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline u32 buf_get_le32(const void *_buf)
{
const byte *in = _buf;
return ((u32)in[3] << 24) | ((u32)in[2] << 16) | \
((u32)in[1] << 8) | (u32)in[0];
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_be32(void *_buf, u32 val)
{
@@ -262,7 +262,7 @@ static inline void buf_put_be32(void *_b
out[1] = val >> 16;
out[2] = val >> 8;
out[3] = val;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_le32(void *_buf, u32 val)
{
@@ -271,7 +271,7 @@ static inline void buf_put_le32(void *_b
out[2] = val >> 16;
out[1] = val >> 8;
out[0] = val;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
#ifdef HAVE_U64_TYPEDEF
/* Functions for loading and storing unaligned u64 values of different
@@ -283,7 +283,7 @@ static inline u64 buf_get_be64(const voi
((u64)in[2] << 40) | ((u64)in[3] << 32) | \
((u64)in[4] << 24) | ((u64)in[5] << 16) | \
((u64)in[6] << 8) | (u64)in[7];
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline u64 buf_get_le64(const void *_buf)
{
@@ -292,7 +292,7 @@ static inline u64 buf_get_le64(const voi
((u64)in[5] << 40) | ((u64)in[4] << 32) | \
((u64)in[3] << 24) | ((u64)in[2] << 16) | \
((u64)in[1] << 8) | (u64)in[0];
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_be64(void *_buf, u64 val)
{
@@ -305,7 +305,7 @@ static inline void buf_put_be64(void *_b
out[5] = val >> 16;
out[6] = val >> 8;
out[7] = val;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_le64(void *_buf, u64 val)
{
@@ -318,7 +318,7 @@ static inline void buf_put_le64(void *_b
out[2] = val >> 16;
out[1] = val >> 8;
out[0] = val;
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
#endif /*HAVE_U64_TYPEDEF*/
#else /*BUFHELP_FAST_UNALIGNED_ACCESS*/
@@ -328,24 +328,24 @@ static inline void buf_put_le64(void *_b
static inline u32 buf_get_be32(const void *_buf)
{
return be_bswap32(*(const u32 *)_buf);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline u32 buf_get_le32(const void *_buf)
{
return le_bswap32(*(const u32 *)_buf);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_be32(void *_buf, u32 val)
{
u32 *out = _buf;
*out = be_bswap32(val);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_le32(void *_buf, u32 val)
{
u32 *out = _buf;
*out = le_bswap32(val);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
#ifdef HAVE_U64_TYPEDEF
/* Functions for loading and storing unaligned u64 values of different
@@ -353,24 +353,24 @@ static inline void buf_put_le32(void *_b
static inline u64 buf_get_be64(const void *_buf)
{
return be_bswap64(*(const u64 *)_buf);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline u64 buf_get_le64(const void *_buf)
{
return le_bswap64(*(const u64 *)_buf);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_be64(void *_buf, u64 val)
{
u64 *out = _buf;
*out = be_bswap64(val);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
static inline void buf_put_le64(void *_buf, u64 val)
{
u64 *out = _buf;
*out = le_bswap64(val);
-}
+} __attribute__ ((optimize("no-strict-aliasing")))
#endif /*HAVE_U64_TYPEDEF*/
#endif /*BUFHELP_FAST_UNALIGNED_ACCESS*/
1
0
Hello community,
here is the log from the commit of package x11-tools for openSUSE:Factory checked in at 2015-07-02 22:45:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/x11-tools (Old)
and /work/SRC/openSUSE:Factory/.x11-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "x11-tools"
Changes:
--------
--- /work/SRC/openSUSE:Factory/x11-tools/x11-tools.changes 2014-11-14 09:18:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.x11-tools.new/x11-tools.changes 2015-07-02 22:45:45.000000000 +0200
@@ -1,0 +2,14 @@
+Wed Jun 24 07:22:49 UTC 2015 - werner(a)suse.de
+
+- Xim script: Allow to simply touch an empty ~/.i18n to override
+ ~/.profile or ~/.login. Also make sure that all bourne shells
+ are able to export the variables like INPUT_METHOD.
+
+-------------------------------------------------------------------
+Tue Jun 23 12:40:55 UTC 2015 - werner(a)suse.de
+
+- Xim script: Allow background processes in ~/.profile and ~/.login
+ (bsc#934720) also use ~/.i18n of exist instead of ~/.profile or
+ ~/.login
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ x11-tools.spec ++++++
--- /var/tmp/diff_new_pack.75Ymwt/_old 2015-07-02 22:45:46.000000000 +0200
+++ /var/tmp/diff_new_pack.75Ymwt/_new 2015-07-02 22:45:46.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package x11-tools
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
++++++ xim ++++++
--- /var/tmp/diff_new_pack.75Ymwt/_old 2015-07-02 22:45:46.000000000 +0200
+++ /var/tmp/diff_new_pack.75Ymwt/_new 2015-07-02 22:45:46.000000000 +0200
@@ -20,8 +20,9 @@
# For example:
# INPUT_METHOD="scim"
# This changes the default for all users
-# 2) set and export the variable "INPUT_METHOD" in ~/.profile in the
-# home directory of a user (or ~/.login for csh users) For example:
+# 2) set and export the variable "INPUT_METHOD" in ~/.i18n in the
+# home directory of a user.
+# For example:
# export INPUT_METHOD="scim"
# This changes the default only for one user.
#
@@ -63,26 +64,41 @@
adduserenv () {
local cur var=${1+"$@"}
: ${HOSTNAME:=$(hostname -f)}
+ # Use ~/.i18n
+ if test -e "$HOME/.i18n"; then
+ echo "/etc/X11/xim: Checking whether an input method is specified in $HOME/.i18n."
+ eval $(set +u +e
+ . /etc/profile.d/lang.sh < /dev/null > /dev/null 2>&1
+ for cur in $var; do
+ echo export $cur=${!cur}
+ done)
+ return
+ fi
+ # Fall back to ~/.profile or ~/.login
case "$SHELL" in
- */sh|*/ash|*/bash|*/ksh|*/pdksh|*/zsh)
+ */sh|*/ash|*/bash|*/ksh|*/mksh|*/pdksh|*/zsh)
if test -s "$HOME/.profile" ; then
+ echo "/etc/X11/xim: Checking whether an input method is specified in $HOME/.profile."
eval $(export HOSTNAME
- (echo . "'$HOME/.profile'"
+ (echo . "'$HOME/.profile' < /dev/null > /dev/null 2>&1"
echo "set +u +e"
for cur in $var; do
- echo echo \${$cur+"export $cur=\$$cur;"}
- done) | $SHELL)
+ echo echo \${$cur+"$cur=\$$cur;"}
+ done
+ echo echo export $var) | $SHELL)
fi
;;
*/csh|*/tcsh)
if test -s "$HOME/.login" ; then
+ echo "/etc/X11/xim: Checking whether an input method is specified in $HOME/.login."
eval $(export HOSTNAME
(echo onintr -
- echo source "'$HOME/.login'"
+ echo source "'$HOME/.login' < /dev/null >& /dev/null"
echo unset verbose
for cur in $var; do
- echo if \( \${?$cur} \) echo export $cur=\`printenv $cur\`
- done) | $SHELL)
+ echo if \( \${?$cur} \) echo $cur=\`printenv $cur\`
+ done
+ echo echo export $var) | $SHELL)
fi
;;
esac
@@ -119,11 +135,10 @@
adduserenv LANG LC_CTYPE LC_ALL INPUT_METHOD
fi
-# if INPUT_METHOD is already set to something non-empty here,
-# the user must have set it in ~/.profile or ~/.login or on the
-# command line before using startx. In that case, don't
-# read the system wide default from /etc/sysconfig/language,
-# use the user supplied value instead:
+# if INPUT_METHOD is already set to something non-empty here, the user should
+# set it in ~/.i18n or in ~/.profile or ~/.login or on the command line before
+# using startx. In that case, don't read the system wide default from
+# /etc/sysconfig/language, use the user supplied value instead:
if [ -z "$INPUT_METHOD" ] ; then
echo "sourcing /etc/sysconfig/language to get the value of INPUT_METHOD"
. /etc/sysconfig/language
1
0
Hello community,
here is the log from the commit of package android-tools for openSUSE:Factory checked in at 2015-07-02 22:45:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/android-tools (Old)
and /work/SRC/openSUSE:Factory/.android-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "android-tools"
Changes:
--------
--- /work/SRC/openSUSE:Factory/android-tools/android-tools.changes 2014-10-11 19:25:07.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.android-tools.new/android-tools.changes 2015-07-02 22:45:35.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 23 22:21:16 UTC 2015 - crrodriguez(a)opensuse.org
+
+- 51-android.rules: Use TAG+="uaccess" instead of using
+ group/mode access control.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ android-tools.spec ++++++
--- /var/tmp/diff_new_pack.WjXxs5/_old 2015-07-02 22:45:36.000000000 +0200
+++ /var/tmp/diff_new_pack.WjXxs5/_new 2015-07-02 22:45:36.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package android-tools
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
++++++ 51-android.rules ++++++
--- /var/tmp/diff_new_pack.WjXxs5/_old 2015-07-02 22:45:36.000000000 +0200
+++ /var/tmp/diff_new_pack.WjXxs5/_new 2015-07-02 22:45:36.000000000 +0200
@@ -2,140 +2,140 @@
# adb/usb_vendors.c
# Acer
-SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0502", TAG+="uaccess"
# Dell
-SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="413c", TAG+="uaccess"
# Foxconn
-SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0489", TAG+="uaccess"
# Garmin-Asus
-SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="091E", TAG+="uaccess"
# Google
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", TAG+="uaccess"
# HTC
-SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", TAG+="uaccess"
# Huawei
-SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", TAG+="uaccess"
# Kyocera
-SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0482", TAG+="uaccess"
# LG
-SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1004", TAG+="uaccess"
# Motorola
-SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", TAG+="uaccess"
# Nvidia
-SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0955", TAG+="uaccess"
# Pantech
-SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", TAG+="uaccess"
# Samsung
-SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", TAG+="uaccess"
# Sharp
-SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", TAG+="uaccess"
# Sony Ericsson
-SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", TAG+="uaccess"
# ZTE
-SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", TAG+="uaccess"
# Qualcomm
-SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", TAG+="uaccess"
# On-The-Go-Video
-SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2257", TAG+="uaccess"
# NEC
-SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0409", TAG+="uaccess"
# Panasonic
-SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="04da", TAG+="uaccess"
# Toshiba
-SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0930", TAG+="uaccess"
# SK Telesys
-SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", TAG+="uaccess"
# KT Tech
-SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2116", TAG+="uaccess"
# ASUS
-SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", TAG+="uaccess"
# Philips
-SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0471", TAG+="uaccess"
# Texas Instruments
-SUBSYSTEM=="usb", ATTR{idVendor}=="0451", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", TAG+="uaccess"
# Funai
-SUBSYSTEM=="usb", ATTR{idVendor}=="0f1c", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0f1c", TAG+="uaccess"
# Gigabyte
-SUBSYSTEM=="usb", ATTR{idVendor}=="0414", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0414", TAG+="uaccess"
# IRiver
-SUBSYSTEM=="usb", ATTR{idVendor}=="2420", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2420", TAG+="uaccess"
# Compal
-SUBSYSTEM=="usb", ATTR{idVendor}=="1219", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1219", TAG+="uaccess"
# T & A Mobile Phones
-SUBSYSTEM=="usb", ATTR{idVendor}=="1bbb", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1bbb", TAG+="uaccess"
# LenovoMobile
-SUBSYSTEM=="usb", ATTR{idVendor}=="2006", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2006", TAG+="uaccess"
# Lenovo
-SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", TAG+="uaccess"
# Vizio
-SUBSYSTEM=="usb", ATTR{idVendor}=="e040", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="e040", TAG+="uaccess"
# K-Touch
-SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", TAG+="uaccess"
# Pegatron
-SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", TAG+="uaccess"
# Archos
-SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", TAG+="uaccess"
# Positivo
-SUBSYSTEM=="usb", ATTR{idVendor}=="1662", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1662", TAG+="uaccess"
# Intel
-SUBSYSTEM=="usb", ATTR{idVendor}=="8087", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="8087", TAG+="uaccess"
# Quanta
-SUBSYSTEM=="usb", ATTR{idVendor}=="0408", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0408", TAG+="uaccess"
# INQ Mobile
-SUBSYSTEM=="usb", ATTR{idVendor}=="2314", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2314", TAG+="uaccess"
# Sony
-SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="054c", TAG+="uaccess"
# Lab126
-SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1949", TAG+="uaccess"
# Yulong Coolpad
-SUBSYSTEM=="usb", ATTR{idVendor}=="1ebf", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1ebf", TAG+="uaccess"
# Kobo
-SUBSYSTEM=="usb", ATTR{idVendor}=="2237", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2237", TAG+="uaccess"
# Teleepoch
-SUBSYSTEM=="usb", ATTR{idVendor}=="2340", MODE="0660", GROUP="users"
+SUBSYSTEM=="usb", ATTR{idVendor}=="2340", TAG+="uaccess"
1
0
Hello community,
here is the log from the commit of package vsftpd for openSUSE:Factory checked in at 2015-07-02 22:45:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vsftpd (Old)
and /work/SRC/openSUSE:Factory/.vsftpd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vsftpd"
Changes:
--------
--- /work/SRC/openSUSE:Factory/vsftpd/vsftpd.changes 2015-04-22 01:13:42.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.vsftpd.new/vsftpd.changes 2015-07-02 22:45:28.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 23 08:51:32 UTC 2015 - tchvatal(a)suse.com
+
+- Fix logrotate script to not fail when vsftpd is not running,
+ bnc#935279
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vsftpd.logrotate ++++++
--- /var/tmp/diff_new_pack.CRUfFC/_old 2015-07-02 22:45:29.000000000 +0200
+++ /var/tmp/diff_new_pack.CRUfFC/_new 2015-07-02 22:45:29.000000000 +0200
@@ -9,6 +9,6 @@
create 600 root root
sharedscripts
postrotate
- /sbin/killproc -HUP /usr/sbin/vsftpd
+ pgrep vsftpd && killall -HUP vsftpd || exit 0
endscript
}
1
0
Hello community,
here is the log from the commit of package p7zip for openSUSE:Factory checked in at 2015-07-02 22:45:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/p7zip (Old)
and /work/SRC/openSUSE:Factory/.p7zip.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "p7zip"
Changes:
--------
--- /work/SRC/openSUSE:Factory/p7zip/p7zip.changes 2015-03-16 06:55:46.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.p7zip.new/p7zip.changes 2015-07-02 22:45:20.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 23 10:10:48 UTC 2015 - pgajdos(a)suse.com
+
+- fixed CVE-2015-1038 [bnc#912878]
+ + p7zip-CVE-2015-1038.patch
+
+-------------------------------------------------------------------
New:
----
p7zip-CVE-2015-1038.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ p7zip.spec ++++++
--- /var/tmp/diff_new_pack.cow74d/_old 2015-07-02 22:45:21.000000000 +0200
+++ /var/tmp/diff_new_pack.cow74d/_new 2015-07-02 22:45:21.000000000 +0200
@@ -24,6 +24,7 @@
Group: Productivity/Archiving/Compression
Url: http://p7zip.sourceforge.net/
Source: http://switch.dl.sourceforge.net/sourceforge/%{name}/%{name}_%{version}_src…
+Patch0: p7zip-CVE-2015-1038.patch
BuildRequires: gcc-c++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1100
@@ -38,6 +39,7 @@
%prep
%setup -q -n %{name}_%{version}
+%patch0 -p1
%ifarch x86_64
cp makefile.linux_amd64_asm makefile.machine
++++++ p7zip-CVE-2015-1038.patch ++++++
Author: Ben Hutchings <ben(a)decadent.org.uk>
Date: Tue, 19 May 2015 02:38:40 +0100
Description: Delay creation of symlinks to prevent arbitrary file writes (CVE-2015-1038)
Bug: http://sourceforge.net/p/p7zip/bugs/147/
Bug-Debian: https://bugs.debian.org/774660
Alexander Cherepanov discovered that 7zip is susceptible to a
directory traversal vulnerability. While extracting an archive, it
will extract symlinks and then follow them if they are referenced in
further entries. This can be exploited by a rogue archive to write
files outside the current directory.
We have to create placeholder files (which we already do) and delay
creating symlinks until the end of extraction.
Due to the possibility of anti-items (deletions) in the archive, it is
possible for placeholders to be deleted and replaced before we create
the symlinks. It's not clear that this can be used for mischief, but
GNU tar guards against similar problems by checking that the placeholder
still exists and is the same inode. XXX It also checks 'birth time' but
this isn't portable. We can probably get away with comparing ctime
since we don't support hard links.
--- a/CPP/7zip/UI/Agent/Agent.cpp
+++ b/CPP/7zip/UI/Agent/Agent.cpp
@@ -1215,7 +1215,7 @@ STDMETHODIMP CAgentFolder::Extract(const
HRESULT result = _agentSpec->GetArchive()->Extract(&realIndices.Front(),
realIndices.Size(), testMode, extractCallback);
if (result == S_OK)
- result = extractCallbackSpec->SetDirsTimes();
+ result = extractCallbackSpec->SetFinalAttribs();
return result;
COM_TRY_END
}
--- a/CPP/7zip/UI/Client7z/Client7z.cpp
+++ b/CPP/7zip/UI/Client7z/Client7z.cpp
@@ -222,8 +222,11 @@ private:
COutFileStream *_outFileStreamSpec;
CMyComPtr<ISequentialOutStream> _outFileStream;
+ CObjectVector<NWindows::NFile::NDir::CDelayedSymLink> _delayedSymLinks;
+
public:
void Init(IInArchive *archiveHandler, const FString &directoryPath);
+ HRESULT SetFinalAttribs();
UInt64 NumErrors;
bool PasswordIsDefined;
@@ -441,11 +444,23 @@ STDMETHODIMP CArchiveExtractCallback::Se
}
_outFileStream.Release();
if (_extractMode && _processedFileInfo.AttribDefined)
- SetFileAttrib(_diskFilePath, _processedFileInfo.Attrib);
+ SetFileAttrib(_diskFilePath, _processedFileInfo.Attrib, &_delayedSymLinks);
PrintNewLine();
return S_OK;
}
+HRESULT CArchiveExtractCallback::SetFinalAttribs()
+{
+ HRESULT result = S_OK;
+
+ for (int i = 0; i != _delayedSymLinks.Size(); ++i)
+ if (!_delayedSymLinks[i].Create())
+ result = E_FAIL;
+
+ _delayedSymLinks.Clear();
+
+ return result;
+}
STDMETHODIMP CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password)
{
@@ -912,6 +927,8 @@ int MY_CDECL main(int numArgs, const cha
// extractCallbackSpec->PasswordIsDefined = true;
// extractCallbackSpec->Password = L"1";
HRESULT result = archive->Extract(NULL, (UInt32)(Int32)(-1), false, extractCallback);
+ if (result == S_OK)
+ result = extractCallbackSpec->SetFinalAttribs();
if (result != S_OK)
{
PrintError("Extract Error");
--- a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
+++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
@@ -1083,7 +1083,7 @@ STDMETHODIMP CArchiveExtractCallback::Se
NumFiles++;
if (_extractMode && _fi.AttribDefined)
- SetFileAttrib(_diskFilePath, _fi.Attrib);
+ SetFileAttrib(_diskFilePath, _fi.Attrib, &_delayedSymLinks);
RINOK(_extractCallback2->SetOperationResult(operationResult, _encrypted));
return S_OK;
COM_TRY_END
@@ -1149,8 +1149,9 @@ static int GetNumSlashes(const FChar *s)
}
}
-HRESULT CArchiveExtractCallback::SetDirsTimes()
+HRESULT CArchiveExtractCallback::SetFinalAttribs()
{
+ HRESULT result = S_OK;
CRecordVector<CExtrRefSortPair> pairs;
pairs.ClearAndSetSize(_extractedFolderPaths.Size());
unsigned i;
@@ -1187,5 +1188,12 @@ HRESULT CArchiveExtractCallback::SetDirs
(WriteATime && ATimeDefined) ? &ATime : NULL,
(WriteMTime && MTimeDefined) ? &MTime : (_arc->MTimeDefined ? &_arc->MTime : NULL));
}
- return S_OK;
+
+ for (int i = 0; i != _delayedSymLinks.Size(); ++i)
+ if (!_delayedSymLinks[i].Create())
+ result = E_FAIL;
+
+ _delayedSymLinks.Clear();
+
+ return result;
}
--- a/CPP/7zip/UI/Common/ArchiveExtractCallback.h
+++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.h
@@ -6,6 +6,8 @@
#include "../../../Common/MyCom.h"
#include "../../../Common/Wildcard.h"
+#include "../../../Windows/FileDir.h"
+
#include "../../IPassword.h"
#include "../../Common/FileStreams.h"
@@ -213,6 +215,8 @@ class CArchiveExtractCallback:
bool _saclEnabled;
#endif
+ CObjectVector<NWindows::NFile::NDir::CDelayedSymLink> _delayedSymLinks;
+
void CreateComplexDirectory(const UStringVector &dirPathParts, FString &fullPath);
HRESULT GetTime(int index, PROPID propID, FILETIME &filetime, bool &filetimeIsDefined);
HRESULT GetUnpackSize();
@@ -293,7 +297,7 @@ public:
_baseParentFolder = indexInArc;
}
- HRESULT SetDirsTimes();
+ HRESULT SetFinalAttribs();
};
#endif
--- a/CPP/7zip/UI/Common/Extract.cpp
+++ b/CPP/7zip/UI/Common/Extract.cpp
@@ -170,7 +170,7 @@ static HRESULT DecompressArchive(
else
result = archive->Extract(&realIndices.Front(), realIndices.Size(), testMode, ecs);
if (result == S_OK && !options.StdInMode)
- result = ecs->SetDirsTimes();
+ result = ecs->SetFinalAttribs();
return callback->ExtractResult(result);
}
--- a/CPP/Windows/FileDir.cpp
+++ b/CPP/Windows/FileDir.cpp
@@ -343,7 +343,8 @@ static int convert_to_symlink(const char
return -1;
}
-bool SetFileAttrib(CFSTR fileName, DWORD fileAttributes)
+bool SetFileAttrib(CFSTR fileName, DWORD fileAttributes,
+ CObjectVector<CDelayedSymLink> *delayedSymLinks)
{
if (!fileName) {
SetLastError(ERROR_PATH_NOT_FOUND);
@@ -375,7 +376,9 @@ bool SetFileAttrib(CFSTR fileName, DWORD
stat_info.st_mode = fileAttributes >> 16;
#ifdef ENV_HAVE_LSTAT
if (S_ISLNK(stat_info.st_mode)) {
- if ( convert_to_symlink(name) != 0) {
+ if (delayedSymLinks)
+ delayedSymLinks->Add(CDelayedSymLink(name));
+ else if ( convert_to_symlink(name) != 0) {
TRACEN((printf("SetFileAttrib(%s,%d) : false-3\n",(const char *)name,fileAttributes)))
return false;
}
@@ -885,6 +888,43 @@ bool CTempDir::Remove()
return !_mustBeDeleted;
}
+#ifdef ENV_UNIX
+
+CDelayedSymLink::CDelayedSymLink(const char * source)
+ : _source(source)
+{
+ struct stat st;
+
+ if (lstat(_source, &st) == 0) {
+ _dev = st.st_dev;
+ _ino = st.st_ino;
+ } else {
+ _dev = 0;
+ }
+}
+
+bool CDelayedSymLink::Create()
+{
+ struct stat st;
+
+ if (_dev == 0) {
+ errno = EPERM;
+ return false;
+ }
+ if (lstat(_source, &st) != 0)
+ return false;
+ if (_dev != st.st_dev || _ino != st.st_ino) {
+ // Placeholder file has been overwritten or moved by another
+ // symbolic link creation
+ errno = EPERM;
+ return false;
+ }
+
+ return convert_to_symlink(_source) == 0;
+}
+
+#endif // ENV_UNIX
+
}}}
--- a/CPP/Windows/FileDir.h
+++ b/CPP/Windows/FileDir.h
@@ -4,6 +4,7 @@
#define __WINDOWS_FILE_DIR_H
#include "../Common/MyString.h"
+#include "../Common/MyVector.h"
#include "FileIO.h"
@@ -11,11 +12,14 @@ namespace NWindows {
namespace NFile {
namespace NDir {
+class CDelayedSymLink;
+
bool GetWindowsDir(FString &path);
bool GetSystemDir(FString &path);
bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime);
-bool SetFileAttrib(CFSTR path, DWORD attrib);
+bool SetFileAttrib(CFSTR path, DWORD attrib,
+ CObjectVector<CDelayedSymLink> *delayedSymLinks = 0);
bool MyMoveFile(CFSTR existFileName, CFSTR newFileName);
#ifndef UNDER_CE
@@ -69,6 +73,31 @@ public:
bool Remove();
};
+// Symbolic links must be created last so that they can't be used to
+// create or overwrite files above the extraction directory.
+class CDelayedSymLink
+{
+#ifdef ENV_UNIX
+ // Where the symlink should be created. The target is specified in
+ // the placeholder file.
+ AString _source;
+
+ // Device and inode of the placeholder file. Before creating the
+ // symlink, we must check that these haven't been changed by creation
+ // of another symlink.
+ dev_t _dev;
+ ino_t _ino;
+
+public:
+ explicit CDelayedSymLink(const char * source);
+ bool Create();
+#else // !ENV_UNIX
+public:
+ CDelayedSymLink(const char * source) {}
+ bool Create() { return true; }
+#endif // ENV_UNIX
+};
+
#if !defined(UNDER_CE)
class CCurrentDirRestorer
{
1
0
Hello community,
here is the log from the commit of package polkit-default-privs for openSUSE:Factory checked in at 2015-07-02 22:45:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/polkit-default-privs (Old)
and /work/SRC/openSUSE:Factory/.polkit-default-privs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "polkit-default-privs"
Changes:
--------
--- /work/SRC/openSUSE:Factory/polkit-default-privs/polkit-default-privs.changes 2015-06-09 12:24:36.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.polkit-default-privs.new/polkit-default-privs.changes 2015-07-02 22:45:14.000000000 +0200
@@ -1,0 +2,5 @@
+Tue Jun 23 11:39:16 UTC 2015 - krahmer(a)suse.com
+
+- polkit-default-privs: PackageKit (bnc#929212)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ polkit-default-privs-13.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/polkit-default-privs-13.2/polkit-default-privs.restrictive new/polkit-default-privs-13.2/polkit-default-privs.restrictive
--- old/polkit-default-privs-13.2/polkit-default-privs.restrictive 2015-06-08 10:48:56.000000000 +0200
+++ new/polkit-default-privs-13.2/polkit-default-privs.restrictive 2015-06-23 13:33:26.000000000 +0200
@@ -408,6 +408,10 @@
org.freedesktop.packagekit.trigger-offline-update auth_admin_keep
org.freedesktop.packagekit.clear-offline-update auth_admin_keep
+# PackageKit (bnc#929212)
+org.freedesktop.packagekit.package-reinstall auth_admin:auth_admin:auth_admin_keep
+org.freedesktop.packagekit.package-downgrade auth_admin:auth_admin:auth_admin_keep
+
#
# gparted (bnc#810888)
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/polkit-default-privs-13.2/polkit-default-privs.standard new/polkit-default-privs-13.2/polkit-default-privs.standard
--- old/polkit-default-privs-13.2/polkit-default-privs.standard 2015-06-08 10:48:56.000000000 +0200
+++ new/polkit-default-privs-13.2/polkit-default-privs.standard 2015-06-23 13:33:26.000000000 +0200
@@ -426,6 +426,10 @@
org.freedesktop.packagekit.trigger-offline-update auth_admin_keep:auth_admin_keep:yes
org.freedesktop.packagekit.clear-offline-update auth_admin_keep:auth_admin_keep:yes
+# PackageKit (bnc#929212)
+org.freedesktop.packagekit.package-reinstall auth_admin:auth_admin:auth_admin_keep
+org.freedesktop.packagekit.package-downgrade auth_admin:auth_admin:auth_admin_keep
+
#
# gparted (bnc#810888)
#
1
0
Hello community,
here is the log from the commit of package python-setuptools for openSUSE:Factory checked in at 2015-07-02 22:45:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-setuptools (Old)
and /work/SRC/openSUSE:Factory/.python-setuptools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-setuptools"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-setuptools/python-setuptools.changes 2015-06-17 16:15:04.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-setuptools.new/python-setuptools.changes 2015-07-02 22:45:08.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Jun 22 15:26:18 UTC 2015 - tbechtold(a)suse.com
+
+- update to 17.1.1:
+ * Backed out unintended changes to pkg_resources, restoring removal of
+ deprecated imp module
+
+-------------------------------------------------------------------
Old:
----
setuptools-17.1.tar.gz
New:
----
setuptools-17.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-setuptools.spec ++++++
--- /var/tmp/diff_new_pack.YmjF0W/_old 2015-07-02 22:45:09.000000000 +0200
+++ /var/tmp/diff_new_pack.YmjF0W/_new 2015-07-02 22:45:09.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-setuptools
-Version: 17.1
+Version: 17.1.1
Release: 0
Url: http://pypi.python.org/pypi/setuptools
Summary: Easily download, build, install, upgrade, and uninstall Python packages
++++++ setuptools-17.1.tar.gz -> setuptools-17.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/CHANGES.txt new/setuptools-17.1.1/CHANGES.txt
--- old/setuptools-17.1/CHANGES.txt 2015-06-07 16:36:44.000000000 +0200
+++ new/setuptools-17.1.1/CHANGES.txt 2015-06-08 19:28:47.000000000 +0200
@@ -2,6 +2,14 @@
CHANGES
=======
+------
+17.1.1
+------
+
+* Backed out unintended changes to pkg_resources, restoring removal of
+ deprecated imp module (`ref
+ <https://bitbucket.org/pypa/setuptools/commits/f572ec9563d647fa8d4ffc534f2af…>`_).
+
----
17.1
----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/PKG-INFO new/setuptools-17.1.1/PKG-INFO
--- old/setuptools-17.1/PKG-INFO 2015-06-07 16:38:08.000000000 +0200
+++ new/setuptools-17.1.1/PKG-INFO 2015-06-08 19:36:29.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: setuptools
-Version: 17.1
+Version: 17.1.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://bitbucket.org/pypa/setuptools
Author: Python Packaging Authority
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/ez_setup.py new/setuptools-17.1.1/ez_setup.py
--- old/setuptools-17.1/ez_setup.py 2015-05-29 04:23:34.000000000 +0200
+++ new/setuptools-17.1.1/ez_setup.py 2015-06-08 19:36:24.000000000 +0200
@@ -30,7 +30,7 @@
except ImportError:
USER_SITE = None
-DEFAULT_VERSION = "17.1"
+DEFAULT_VERSION = "17.1.1"
DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
DEFAULT_SAVE_DIR = os.curdir
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/pkg_resources/__init__.py new/setuptools-17.1.1/pkg_resources/__init__.py
--- old/setuptools-17.1/pkg_resources/__init__.py 2015-06-07 16:06:01.000000000 +0200
+++ new/setuptools-17.1.1/pkg_resources/__init__.py 2015-06-08 19:24:14.000000000 +0200
@@ -21,7 +21,7 @@
import io
import time
import re
-import imp
+import types
import zipfile
import zipimport
import warnings
@@ -39,6 +39,12 @@
import textwrap
from pkgutil import get_importer
+try:
+ import _imp
+except ImportError:
+ # Python 3.2 compatibility
+ import imp as _imp
+
PY3 = sys.version_info > (3,)
PY2 = not PY3
@@ -2167,7 +2173,7 @@
return None
module = sys.modules.get(packageName)
if module is None:
- module = sys.modules[packageName] = imp.new_module(packageName)
+ module = sys.modules[packageName] = types.ModuleType(packageName)
module.__path__ = []
_set_parent_ns(packageName)
elif not hasattr(module,'__path__'):
@@ -2186,7 +2192,7 @@
def declare_namespace(packageName):
"""Declare that package 'packageName' is a namespace package"""
- imp.acquire_lock()
+ _imp.acquire_lock()
try:
if packageName in _namespace_packages:
return
@@ -2213,18 +2219,18 @@
_handle_ns(packageName, path_item)
finally:
- imp.release_lock()
+ _imp.release_lock()
def fixup_namespace_packages(path_item, parent=None):
"""Ensure that previously-declared namespace packages include path_item"""
- imp.acquire_lock()
+ _imp.acquire_lock()
try:
for package in _namespace_packages.get(parent,()):
subpath = _handle_ns(package, path_item)
if subpath:
fixup_namespace_packages(subpath, package)
finally:
- imp.release_lock()
+ _imp.release_lock()
def file_ns_handler(importer, path_item, packageName, module):
"""Compute an ns-package subpath for a filesystem or zipfile importer"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/setuptools/version.py new/setuptools-17.1.1/setuptools/version.py
--- old/setuptools-17.1/setuptools/version.py 2015-05-29 04:23:34.000000000 +0200
+++ new/setuptools-17.1.1/setuptools/version.py 2015-06-08 19:36:24.000000000 +0200
@@ -1 +1 @@
-__version__ = '17.1'
+__version__ = '17.1.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-17.1/setuptools.egg-info/PKG-INFO new/setuptools-17.1.1/setuptools.egg-info/PKG-INFO
--- old/setuptools-17.1/setuptools.egg-info/PKG-INFO 2015-06-07 16:38:07.000000000 +0200
+++ new/setuptools-17.1.1/setuptools.egg-info/PKG-INFO 2015-06-08 19:36:28.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: setuptools
-Version: 17.1
+Version: 17.1.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://bitbucket.org/pypa/setuptools
Author: Python Packaging Authority
1
0
Hello community,
here is the log from the commit of package python-pyflakes for openSUSE:Factory checked in at 2015-07-02 22:44:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyflakes (Old)
and /work/SRC/openSUSE:Factory/.python-pyflakes.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyflakes"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyflakes/python-pyflakes.changes 2014-04-13 13:17:09.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-pyflakes.new/python-pyflakes.changes 2015-07-02 22:44:58.000000000 +0200
@@ -1,0 +2,16 @@
+Mon Jun 22 15:15:47 UTC 2015 - tbechtold(a)suse.com
+
+- update to 0.9.2:
+ - Fix a traceback when a global is defined in one scope, and used in another.
+ - Update NEWS.txt to include 0.9.0, which had been forgotten.
+ - Exit gracefully, not with a traceback, on SIGINT and SIGPIPE.
+ - Fix incorrect report of undefined name when using lambda expressions in
+ generator expressions.
+ - Don't crash on DOS line endings on Windows and Python 2.6.
+ - Don't report an undefined name if the 'del' which caused a name to become
+ undefined is only conditionally executed.
+ - Properly handle differences in list comprehension scope in Python 3.
+ - Improve handling of edge cases around 'global' defined variables.
+ - Report an error for 'return' outside a function.
+
+-------------------------------------------------------------------
Old:
----
pyflakes-0.8.1.tar.gz
New:
----
pyflakes-0.9.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyflakes.spec ++++++
--- /var/tmp/diff_new_pack.H7nv9x/_old 2015-07-02 22:44:59.000000000 +0200
+++ /var/tmp/diff_new_pack.H7nv9x/_new 2015-07-02 22:44:59.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pyflakes
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: python-pyflakes
-Version: 0.8.1
+Version: 0.9.2
Release: 0
Url: https://launchpad.net/pyflakes
Summary: Passive checker of Python programs
++++++ pyflakes-0.8.1.tar.gz -> pyflakes-0.9.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/AUTHORS new/pyflakes-0.9.2/AUTHORS
--- old/pyflakes-0.8.1/AUTHORS 2014-03-22 13:31:07.000000000 +0100
+++ new/pyflakes-0.9.2/AUTHORS 2015-04-17 14:48:24.000000000 +0200
@@ -1,4 +1,3 @@
-
Contributors
------------
@@ -18,3 +17,6 @@
* Marcin Cieślak
* Steven Myint
* Ignas Mikalajūnas
+
+See also the contributors list on GitHub:
+https://github.com/pyflakes/pyflakes/graphs/contributors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/NEWS.txt new/pyflakes-0.9.2/NEWS.txt
--- old/pyflakes-0.8.1/NEWS.txt 2014-03-30 20:46:51.000000000 +0200
+++ new/pyflakes-0.9.2/NEWS.txt 2015-06-17 12:19:30.000000000 +0200
@@ -1,3 +1,20 @@
+0.9.2 (2015-06-17):
+ - Fix a traceback when a global is defined in one scope, and used in another.
+
+0.9.1 (2015-06-09):
+ - Update NEWS.txt to include 0.9.0, which had been forgotten.
+
+0.9.0 (2015-05-31):
+ - Exit gracefully, not with a traceback, on SIGINT and SIGPIPE.
+ - Fix incorrect report of undefined name when using lambda expressions in
+ generator expressions.
+ - Don't crash on DOS line endings on Windows and Python 2.6.
+ - Don't report an undefined name if the 'del' which caused a name to become
+ undefined is only conditionally executed.
+ - Properly handle differences in list comprehension scope in Python 3.
+ - Improve handling of edge cases around 'global' defined variables.
+ - Report an error for 'return' outside a function.
+
0.8.1 (2014-03-30):
- Detect the declared encoding in Python 3.
- Do not report redefinition of import in a local scope, if the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/PKG-INFO new/pyflakes-0.9.2/PKG-INFO
--- old/pyflakes-0.8.1/PKG-INFO 2014-03-30 20:53:07.000000000 +0200
+++ new/pyflakes-0.9.2/PKG-INFO 2015-06-17 12:22:13.000000000 +0200
@@ -1,10 +1,10 @@
Metadata-Version: 1.1
Name: pyflakes
-Version: 0.8.1
+Version: 0.9.2
Summary: passive checker of Python programs
-Home-page: https://launchpad.net/pyflakes
-Author: Florent Xicluna
-Author-email: pyflakes-dev(a)lists.launchpad.net
+Home-page: https://github.com/pyflakes/pyflakes
+Author: A lot of people
+Author-email: code-quality(a)python.org
License: MIT
Description: ========
Pyflakes
@@ -16,10 +16,11 @@
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
- It is `available on PyPI <http://pypi.python.org/pypi/pyflakes>`_
+ It is `available on PyPI <https://pypi.python.org/pypi/pyflakes>`_
and it supports all active versions of Python from 2.5 to 3.4.
+
Installation
------------
@@ -28,11 +29,42 @@
$ pip install --upgrade pyflakes
+ Useful tips:
+
+ * Be sure to install it for a version of Python which is compatible
+ with your codebase: for Python 2, ``pip2 install pyflakes`` and for
+ Python3, ``pip3 install pyflakes``.
+
+ * You can also invoke Pyflakes with ``python3 -m pyflakes .`` or
+ ``python2 -m pyflakes .`` if you have it installed for both versions.
+
+ * If you require more options and more flexibility, you could give a
+ look to Flake8_ too.
+
+
+ Design Principles
+ -----------------
+ Pyflakes makes a simple promise: it will never complain about style,
+ and it will try very, very hard to never emit false positives.
+
+ Pyflakes is also faster than Pylint_
+ or Pychecker_. This is
+ largely because Pyflakes only examines the syntax tree of each file
+ individually. As a consequence, Pyflakes is more limited in the
+ types of things it can check.
+
+ If you like Pyflakes but also want styleistic checks, you want
+ flake8_, which combines
+ Pyflakes with style checks against
+ `PEP 8`_ and adds
+ per-project configuration ability.
+
+
Mailing-list
------------
Share your feedback and ideas: `subscribe to the mailing-list
- <http://mail.python.org/mailman/listinfo/code-quality>`_
+ <https://mail.python.org/mailman/listinfo/code-quality>`_
.. image:: https://api.travis-ci.org/pyflakes/pyflakes.png
@@ -43,6 +75,11 @@
:target: https://pypi.python.org/pypi/pyflakes
:alt: Wheel Status
+ .. _Pylint: http://www.pylint.org/
+ .. _flake8: https://pypi.python.org/pypi/flake8
+ .. _`PEP 8`: http://legacy.python.org/dev/peps/pep-0008/
+ .. _Pychecker: http://pychecker.sourceforge.net/
+
Platform: UNKNOWN
Classifier: Development Status :: 6 - Mature
Classifier: Environment :: Console
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/README.rst new/pyflakes-0.9.2/README.rst
--- old/pyflakes-0.8.1/README.rst 2014-03-30 20:30:36.000000000 +0200
+++ new/pyflakes-0.9.2/README.rst 2014-10-29 15:41:06.000000000 +0100
@@ -8,10 +8,11 @@
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
-It is `available on PyPI <http://pypi.python.org/pypi/pyflakes>`_
+It is `available on PyPI <https://pypi.python.org/pypi/pyflakes>`_
and it supports all active versions of Python from 2.5 to 3.4.
+
Installation
------------
@@ -20,11 +21,42 @@
$ pip install --upgrade pyflakes
+Useful tips:
+
+* Be sure to install it for a version of Python which is compatible
+ with your codebase: for Python 2, ``pip2 install pyflakes`` and for
+ Python3, ``pip3 install pyflakes``.
+
+* You can also invoke Pyflakes with ``python3 -m pyflakes .`` or
+ ``python2 -m pyflakes .`` if you have it installed for both versions.
+
+* If you require more options and more flexibility, you could give a
+ look to Flake8_ too.
+
+
+Design Principles
+-----------------
+Pyflakes makes a simple promise: it will never complain about style,
+and it will try very, very hard to never emit false positives.
+
+Pyflakes is also faster than Pylint_
+or Pychecker_. This is
+largely because Pyflakes only examines the syntax tree of each file
+individually. As a consequence, Pyflakes is more limited in the
+types of things it can check.
+
+If you like Pyflakes but also want styleistic checks, you want
+flake8_, which combines
+Pyflakes with style checks against
+`PEP 8`_ and adds
+per-project configuration ability.
+
+
Mailing-list
------------
Share your feedback and ideas: `subscribe to the mailing-list
-<http://mail.python.org/mailman/listinfo/code-quality>`_
+<https://mail.python.org/mailman/listinfo/code-quality>`_
.. image:: https://api.travis-ci.org/pyflakes/pyflakes.png
@@ -34,3 +66,8 @@
.. image:: https://pypip.in/wheel/pyflakes/badge.png
:target: https://pypi.python.org/pypi/pyflakes
:alt: Wheel Status
+
+.. _Pylint: http://www.pylint.org/
+.. _flake8: https://pypi.python.org/pypi/flake8
+.. _`PEP 8`: http://legacy.python.org/dev/peps/pep-0008/
+.. _Pychecker: http://pychecker.sourceforge.net/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/__init__.py new/pyflakes-0.9.2/pyflakes/__init__.py
--- old/pyflakes-0.8.1/pyflakes/__init__.py 2014-03-30 16:56:10.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/__init__.py 2015-06-17 12:18:24.000000000 +0200
@@ -1,2 +1 @@
-
-__version__ = '0.8.1'
+__version__ = '0.9.2'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/api.py new/pyflakes-0.9.2/pyflakes/api.py
--- old/pyflakes-0.8.1/pyflakes/api.py 2014-03-29 12:07:31.000000000 +0100
+++ new/pyflakes-0.9.2/pyflakes/api.py 2015-04-17 16:50:37.000000000 +0200
@@ -6,7 +6,6 @@
import sys
import os
import _ast
-from optparse import OptionParser
from pyflakes import checker, __version__
from pyflakes import reporter as modReporter
@@ -74,7 +73,16 @@
if reporter is None:
reporter = modReporter._makeDefaultReporter()
try:
- with open(filename, 'rb') as f:
+ # in Python 2.6, compile() will choke on \r\n line endings. In later
+ # versions of python it's smarter, and we want binary mode to give
+ # compile() the best opportunity to do the right thing WRT text
+ # encodings.
+ if sys.version_info < (2, 7):
+ mode = 'rU'
+ else:
+ mode = 'rb'
+
+ with open(filename, mode) as f:
codestr = f.read()
if sys.version_info < (2, 7):
codestr += '\n' # Work around for Python <= 2.6
@@ -122,8 +130,42 @@
return warnings
+def _exitOnSignal(sigName, message):
+ """Handles a signal with sys.exit.
+
+ Some of these signals (SIGPIPE, for example) don't exist or are invalid on
+ Windows. So, ignore errors that might arise.
+ """
+ import signal
+
+ try:
+ sigNumber = getattr(signal, sigName)
+ except AttributeError:
+ # the signal constants defined in the signal module are defined by
+ # whether the C library supports them or not. So, SIGPIPE might not
+ # even be defined.
+ return
+
+ def handler(sig, f):
+ sys.exit(message)
+
+ try:
+ signal.signal(sigNumber, handler)
+ except ValueError:
+ # It's also possible the signal is defined, but then it's invalid. In
+ # this case, signal.signal raises ValueError.
+ pass
+
+
def main(prog=None):
- parser = OptionParser(prog=prog, version=__version__)
+ """Entry point for the script "pyflakes"."""
+ import optparse
+
+ # Handle "Keyboard Interrupt" and "Broken pipe" gracefully
+ _exitOnSignal('SIGINT', '... stopped')
+ _exitOnSignal('SIGPIPE', 1)
+
+ parser = optparse.OptionParser(prog=prog, version=__version__)
(__, args) = parser.parse_args()
reporter = modReporter._makeDefaultReporter()
if args:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/checker.py new/pyflakes-0.9.2/pyflakes/checker.py
--- old/pyflakes-0.8.1/pyflakes/checker.py 2014-03-30 19:43:56.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/checker.py 2015-06-17 12:17:45.000000000 +0200
@@ -471,7 +471,7 @@
return
scopes = [scope for scope in self.scopeStack[:-1]
- if isinstance(scope, (FunctionScope, ModuleScope))]
+ if isinstance(scope, (FunctionScope, ModuleScope, GeneratorScope))]
if isinstance(self.scope, GeneratorScope) and scopes[-1] != self.scopeStack[-2]:
scopes.append(self.scopeStack[-2])
@@ -531,9 +531,27 @@
self.addBinding(node, binding)
def handleNodeDelete(self, node):
+
+ def on_conditional_branch():
+ """
+ Return `True` if node is part of a conditional body.
+ """
+ current = getattr(node, 'parent', None)
+ while current:
+ if isinstance(current, (ast.If, ast.While, ast.IfExp)):
+ return True
+ current = getattr(current, 'parent', None)
+ return False
+
name = getNodeName(node)
if not name:
return
+
+ if on_conditional_branch():
+ # We can not predict if this conditional branch is going to
+ # be executed.
+ return
+
if isinstance(self.scope, FunctionScope) and name in self.scope.globals:
self.scope.globals.remove(name)
else:
@@ -654,14 +672,36 @@
EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore
# additional node types
- LISTCOMP = COMPREHENSION = KEYWORD = handleChildren
+ COMPREHENSION = KEYWORD = handleChildren
def GLOBAL(self, node):
"""
Keep track of globals declarations.
"""
- if isinstance(self.scope, FunctionScope):
- self.scope.globals.update(node.names)
+ # In doctests, the global scope is an anonymous function at index 1.
+ global_scope_index = 1 if self.withDoctest else 0
+ global_scope = self.scopeStack[global_scope_index]
+
+ # Ignore 'global' statement in global scope.
+ if self.scope is not global_scope:
+
+ # One 'global' statement can bind multiple (comma-delimited) names.
+ for node_name in node.names:
+ node_value = Assignment(node_name, node)
+
+ # Remove UndefinedName messages already reported for this name.
+ self.messages = [
+ m for m in self.messages if not
+ isinstance(m, messages.UndefinedName) and not
+ m.message_args[0] == node_name]
+
+ # Bind name to global scope if it doesn't exist already.
+ global_scope.setdefault(node_name, node_value)
+
+ # Bind name to non-global scopes, but as already "used".
+ node_value.used = (global_scope, node)
+ for scope in self.scopeStack[global_scope_index + 1:]:
+ scope[node_name] = node_value
NONLOCAL = GLOBAL
@@ -670,6 +710,8 @@
self.handleChildren(node)
self.popScope()
+ LISTCOMP = handleChildren if PY2 else GENERATOREXP
+
DICTCOMP = SETCOMP = GENERATOREXP
def NAME(self, node):
@@ -693,7 +735,15 @@
raise RuntimeError("Got impossible expression context: %r" % (node.ctx,))
def RETURN(self, node):
- if node.value and not self.scope.returnValue:
+ if isinstance(self.scope, ClassScope):
+ self.report(messages.ReturnOutsideFunction, node)
+ return
+
+ if (
+ node.value and
+ hasattr(self.scope, 'returnValue') and
+ not self.scope.returnValue
+ ):
self.scope.returnValue = node.value
self.handleNode(node.value, node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/messages.py new/pyflakes-0.9.2/pyflakes/messages.py
--- old/pyflakes-0.8.1/pyflakes/messages.py 2014-03-22 13:31:07.000000000 +0100
+++ new/pyflakes-0.9.2/pyflakes/messages.py 2015-04-17 13:41:05.000000000 +0200
@@ -100,14 +100,6 @@
self.message_args = (name,)
-class Redefined(Message):
- message = 'redefinition of %r from line %r'
-
- def __init__(self, filename, loc, name, orig_loc):
- Message.__init__(self, filename, loc)
- self.message_args = (name, orig_loc.lineno)
-
-
class LateFutureImport(Message):
message = 'future import(s) %r after other statements'
@@ -133,3 +125,10 @@
Indicates a return statement with arguments inside a generator.
"""
message = '\'return\' with argument inside generator'
+
+
+class ReturnOutsideFunction(Message):
+ """
+ Indicates a return statement outside of a function/method.
+ """
+ message = '\'return\' outside function'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/scripts/pyflakes.py new/pyflakes-0.9.2/pyflakes/scripts/pyflakes.py
--- old/pyflakes-0.8.1/pyflakes/scripts/pyflakes.py 2014-01-07 02:12:57.000000000 +0100
+++ new/pyflakes-0.9.2/pyflakes/scripts/pyflakes.py 2014-09-23 16:08:41.000000000 +0200
@@ -4,4 +4,5 @@
from __future__ import absolute_import
# For backward compatibility
+__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/test/test_api.py new/pyflakes-0.9.2/pyflakes/test/test_api.py
--- old/pyflakes-0.8.1/pyflakes/test/test_api.py 2014-03-29 12:11:03.000000000 +0100
+++ new/pyflakes-0.9.2/pyflakes/test/test_api.py 2015-04-17 13:41:05.000000000 +0200
@@ -449,6 +449,13 @@
sourcePath = self.makeTempFile(source)
self.assertHasErrors(sourcePath, [])
+ def test_CRLFLineEndings(self):
+ """
+ Source files with Windows CR LF line endings are parsed successfully.
+ """
+ sourcePath = self.makeTempFile("x = 42\r\n")
+ self.assertHasErrors(sourcePath, [])
+
def test_misencodedFileUTF8(self):
"""
If a source file contains bytes which cannot be decoded, this is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/test/test_doctests.py new/pyflakes-0.9.2/pyflakes/test/test_doctests.py
--- old/pyflakes-0.8.1/pyflakes/test/test_doctests.py 2014-03-30 03:32:53.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/test/test_doctests.py 2015-04-17 13:41:05.000000000 +0200
@@ -64,7 +64,7 @@
"""
foo
- ''', m.Redefined)
+ ''', m.RedefinedWhileUnused)
def test_importInDoctestAndAfter(self):
self.flakes('''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/test/test_imports.py new/pyflakes-0.9.2/pyflakes/test/test_imports.py
--- old/pyflakes-0.8.1/pyflakes/test/test_imports.py 2014-03-30 04:47:13.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/test/test_imports.py 2015-05-31 16:15:41.000000000 +0200
@@ -184,8 +184,9 @@
def baz():
def fu():
pass
- ''', m.RedefinedWhileUnused, m.RedefinedWhileUnused,
- m.UnusedImport, m.UnusedImport)
+ ''',
+ m.RedefinedWhileUnused, m.RedefinedWhileUnused,
+ m.UnusedImport, m.UnusedImport)
def test_redefinedButUsedLater(self):
"""
@@ -472,6 +473,8 @@
self.flakes('import fu; [fu for _ in range(1)]')
self.flakes('import fu; [1 for _ in range(1) if fu]')
+ @skipIf(version_info >= (3,),
+ 'in Python 3 list comprehensions execute in a separate scope')
def test_redefinedByListComp(self):
self.flakes('import fu; [1 for fu in range(1)]',
m.RedefinedInListComp)
@@ -502,11 +505,26 @@
''')
def test_usedInGlobal(self):
+ """
+ A 'global' statement shadowing an unused import should not prevent it
+ from being reported.
+ """
self.flakes('''
import fu
def f(): global fu
''', m.UnusedImport)
+ def test_usedAndGlobal(self):
+ """
+ A 'global' statement shadowing a used import should not cause it to be
+ reported as unused.
+ """
+ self.flakes('''
+ import foo
+ def f(): global foo
+ def g(): foo.is_used()
+ ''')
+
@skipIf(version_info >= (3,), 'deprecated syntax')
def test_usedInBackquote(self):
self.flakes('import fu; `fu`')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/test/test_other.py new/pyflakes-0.9.2/pyflakes/test/test_other.py
--- old/pyflakes-0.8.1/pyflakes/test/test_other.py 2014-03-30 04:07:29.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/test/test_other.py 2015-06-17 12:15:46.000000000 +0200
@@ -21,6 +21,8 @@
f()
''', m.UndefinedLocal, m.UnusedVariable)
+ @skipIf(version_info >= (3,),
+ 'in Python 3 list comprehensions execute in a separate scope')
def test_redefinedInListComp(self):
"""
Test that shadowing a variable in a list comprehension raises
@@ -220,6 +222,8 @@
[a for a in '12']
''')
+ @skipIf(version_info >= (3,),
+ 'in Python 3 list comprehensions execute in a separate scope')
def test_redefinedElseInListComp(self):
"""
Test that shadowing a variable in a list comprehension in
@@ -340,6 +344,15 @@
pass
''', m.RedefinedWhileUnused)
+ def test_classWithReturn(self):
+ """
+ If a return is used inside a class, a warning is emitted.
+ """
+ self.flakes('''
+ class Foo(object):
+ return
+ ''', m.ReturnOutsideFunction)
+
@skip("todo: Too hard to make this warn but other cases stay silent")
def test_doubleAssignment(self):
"""
@@ -463,6 +476,15 @@
foo.bar += foo.baz
''')
+ def test_globalDeclaredInDifferentScope(self):
+ """
+ A 'global' can be declared in one scope and reused in another.
+ """
+ self.flakes('''
+ def f(): global foo
+ def g(): foo = 'anything'; foo.is_used()
+ ''')
+
class TestUnusedAssignment(TestCase):
"""
@@ -938,3 +960,7 @@
def bar():
yield from foo()
''', m.UndefinedName)
+
+ def test_returnOnly(self):
+ """Do not crash on lone "return"."""
+ self.flakes('return 2')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes/test/test_undefined_names.py new/pyflakes-0.9.2/pyflakes/test/test_undefined_names.py
--- old/pyflakes-0.8.1/pyflakes/test/test_undefined_names.py 2014-03-30 18:59:23.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes/test/test_undefined_names.py 2015-05-31 16:15:41.000000000 +0200
@@ -3,7 +3,7 @@
from sys import version_info
from pyflakes import messages as m, checker
-from pyflakes.test.harness import TestCase, skip, skipIf
+from pyflakes.test.harness import TestCase, skipIf
class Test(TestCase):
@@ -13,6 +13,15 @@
def test_definedInListComp(self):
self.flakes('[a for a in range(10) if a]')
+ @skipIf(version_info < (3,),
+ 'in Python 2 list comprehensions execute in the same scope')
+ def test_undefinedInListComp(self):
+ self.flakes('''
+ [a for a in range(10)]
+ a
+ ''',
+ m.UndefinedName)
+
def test_functionsNeedGlobalScope(self):
self.flakes('''
class a:
@@ -83,7 +92,6 @@
bar; baz
''')
- @skip("todo")
def test_definedByGlobal(self):
"""
"global" can make an otherwise undefined name in another function
@@ -93,6 +101,19 @@
def a(): global fu; fu = 1
def b(): fu
''')
+ self.flakes('''
+ def c(): bar
+ def b(): global bar; bar = 1
+ ''')
+
+ def test_definedByGlobalMultipleNames(self):
+ """
+ "global" can accept multiple names.
+ """
+ self.flakes('''
+ def a(): global fu, bar; fu = 1; bar = 2
+ def b(): fu; bar
+ ''')
def test_globalInGlobalScope(self):
"""
@@ -122,6 +143,74 @@
"""Del an undefined name."""
self.flakes('del a', m.UndefinedName)
+ def test_delConditional(self):
+ """
+ Ignores conditional bindings deletion.
+ """
+ self.flakes('''
+ context = None
+ test = True
+ if False:
+ del(test)
+ assert(test)
+ ''')
+
+ def test_delConditionalNested(self):
+ """
+ Ignored conditional bindings deletion even if they are nested in other
+ blocks.
+ """
+ self.flakes('''
+ context = None
+ test = True
+ if False:
+ with context():
+ del(test)
+ assert(test)
+ ''')
+
+ def test_delWhile(self):
+ """
+ Ignore bindings deletion if called inside the body of a while
+ statement.
+ """
+ self.flakes('''
+ def test():
+ foo = 'bar'
+ while False:
+ del foo
+ assert(foo)
+ ''')
+
+ def test_delWhileTestUsage(self):
+ """
+ Ignore bindings deletion if called inside the body of a while
+ statement and name is used inside while's test part.
+ """
+ self.flakes('''
+ def _worker():
+ o = True
+ while o is not True:
+ del o
+ o = False
+ ''')
+
+ def test_delWhileNested(self):
+ """
+ Ignore bindings deletions if node is part of while's test, even when
+ del is in a nested block.
+ """
+ self.flakes('''
+ context = None
+ def _worker():
+ o = True
+ while o is not True:
+ while True:
+ with context():
+ del o
+ o = False
+ ''')
+
def test_globalFromNestedScope(self):
"""Global names are available from nested scopes."""
self.flakes('''
@@ -435,6 +524,44 @@
(42 for i in range(i))
''', m.UndefinedName)
+ @skipIf(version_info < (2, 7), 'Dictionary comprehensions do not exist')
+ def test_definedFromLambdaInDictionaryComprehension(self):
+ """
+ Defined name referenced from a lambda function within a dict/set
+ comprehension.
+ """
+ self.flakes('''
+ {lambda: id(x) for x in range(10)}
+ ''')
+
+ def test_definedFromLambdaInGenerator(self):
+ """
+ Defined name referenced from a lambda function within a generator
+ expression.
+ """
+ self.flakes('''
+ any(lambda: id(x) for x in range(10))
+ ''')
+
+ @skipIf(version_info < (2, 7), 'Dictionary comprehensions do not exist')
+ def test_undefinedFromLambdaInDictionaryComprehension(self):
+ """
+ Undefined name referenced from a lambda function within a dict/set
+ comprehension.
+ """
+ self.flakes('''
+ {lambda: id(y) for x in range(10)}
+ ''', m.UndefinedName)
+
+ def test_undefinedFromLambdaInComprehension(self):
+ """
+ Undefined name referenced from a lambda function within a generator
+ expression.
+ """
+ self.flakes('''
+ any(lambda: id(y) for x in range(10))
+ ''', m.UndefinedName)
+
class NameTests(TestCase):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/pyflakes.egg-info/PKG-INFO new/pyflakes-0.9.2/pyflakes.egg-info/PKG-INFO
--- old/pyflakes-0.8.1/pyflakes.egg-info/PKG-INFO 2014-03-30 20:53:07.000000000 +0200
+++ new/pyflakes-0.9.2/pyflakes.egg-info/PKG-INFO 2015-06-17 12:22:13.000000000 +0200
@@ -1,10 +1,10 @@
Metadata-Version: 1.1
Name: pyflakes
-Version: 0.8.1
+Version: 0.9.2
Summary: passive checker of Python programs
-Home-page: https://launchpad.net/pyflakes
-Author: Florent Xicluna
-Author-email: pyflakes-dev(a)lists.launchpad.net
+Home-page: https://github.com/pyflakes/pyflakes
+Author: A lot of people
+Author-email: code-quality(a)python.org
License: MIT
Description: ========
Pyflakes
@@ -16,10 +16,11 @@
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
- It is `available on PyPI <http://pypi.python.org/pypi/pyflakes>`_
+ It is `available on PyPI <https://pypi.python.org/pypi/pyflakes>`_
and it supports all active versions of Python from 2.5 to 3.4.
+
Installation
------------
@@ -28,11 +29,42 @@
$ pip install --upgrade pyflakes
+ Useful tips:
+
+ * Be sure to install it for a version of Python which is compatible
+ with your codebase: for Python 2, ``pip2 install pyflakes`` and for
+ Python3, ``pip3 install pyflakes``.
+
+ * You can also invoke Pyflakes with ``python3 -m pyflakes .`` or
+ ``python2 -m pyflakes .`` if you have it installed for both versions.
+
+ * If you require more options and more flexibility, you could give a
+ look to Flake8_ too.
+
+
+ Design Principles
+ -----------------
+ Pyflakes makes a simple promise: it will never complain about style,
+ and it will try very, very hard to never emit false positives.
+
+ Pyflakes is also faster than Pylint_
+ or Pychecker_. This is
+ largely because Pyflakes only examines the syntax tree of each file
+ individually. As a consequence, Pyflakes is more limited in the
+ types of things it can check.
+
+ If you like Pyflakes but also want styleistic checks, you want
+ flake8_, which combines
+ Pyflakes with style checks against
+ `PEP 8`_ and adds
+ per-project configuration ability.
+
+
Mailing-list
------------
Share your feedback and ideas: `subscribe to the mailing-list
- <http://mail.python.org/mailman/listinfo/code-quality>`_
+ <https://mail.python.org/mailman/listinfo/code-quality>`_
.. image:: https://api.travis-ci.org/pyflakes/pyflakes.png
@@ -43,6 +75,11 @@
:target: https://pypi.python.org/pypi/pyflakes
:alt: Wheel Status
+ .. _Pylint: http://www.pylint.org/
+ .. _flake8: https://pypi.python.org/pypi/flake8
+ .. _`PEP 8`: http://legacy.python.org/dev/peps/pep-0008/
+ .. _Pychecker: http://pychecker.sourceforge.net/
+
Platform: UNKNOWN
Classifier: Development Status :: 6 - Mature
Classifier: Environment :: Console
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.8.1/setup.py new/pyflakes-0.9.2/setup.py
--- old/pyflakes-0.8.1/setup.py 2014-03-29 14:32:55.000000000 +0100
+++ new/pyflakes-0.9.2/setup.py 2015-04-17 14:48:24.000000000 +0200
@@ -40,11 +40,9 @@
version=get_version(),
description="passive checker of Python programs",
long_description=get_long_description(),
- author="Phil Frost",
- author_email="indigo(a)bitglue.com",
- maintainer="Florent Xicluna",
- maintainer_email="pyflakes-dev(a)lists.launchpad.net",
- url="https://launchpad.net/pyflakes",
+ author="A lot of people",
+ author_email="code-quality(a)python.org",
+ url="https://github.com/pyflakes/pyflakes",
packages=["pyflakes", "pyflakes.scripts", "pyflakes.test"],
classifiers=[
"Development Status :: 6 - Mature",
1
0