openSUSE Commits
Threads by month
- ----- 2025 -----
- April
- 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
November 2013
- 1 participants
- 1122 discussions
Hello community,
here is the log from the commit of package python3-numpydoc for openSUSE:Factory checked in at 2013-11-01 17:43:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-numpydoc (Old)
and /work/SRC/openSUSE:Factory/.python3-numpydoc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-numpydoc"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-numpydoc/python3-numpydoc.changes 2013-09-03 22:06:32.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-numpydoc.new/python3-numpydoc.changes 2013-11-01 17:43:57.000000000 +0100
@@ -1,0 +2,5 @@
+Thu Oct 31 12:25:04 UTC 2013 - toddrme2178(a)gmail.com
+
+- Implement update-alternatives
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-numpydoc.spec ++++++
--- /var/tmp/diff_new_pack.lpAumI/_old 2013-11-01 17:43:57.000000000 +0100
+++ /var/tmp/diff_new_pack.lpAumI/_new 2013-11-01 17:43:57.000000000 +0100
@@ -31,6 +31,8 @@
# Test requirements
BuildRequires: python3-Sphinx >= 1.0.1
Requires: python3-Sphinx >= 1.0.1
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@@ -50,14 +52,33 @@
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
+ln -s %{_bindir}/autosummary_generate-%{py3_ver} %{buildroot}%{_bindir}/autosummary_generate
%check
python3 setup.py test
+%pre
+# Since /usr/bin/autosummary_generate became ghosted to be used with update-alternatives, we have
+# to get rid of the old binary resulting from the non-update-alternativies-ified package:
+[[ ! -L %{_bindir}/autosummary_generate ]] && rm -f %{_bindir}/autosummary_generate
+exit 0
+
+%post
+update-alternatives \
+ --install %{_bindir}/autosummary_generate autosummary_generate %{_bindir}/autosummary_generate-%{py3_ver} 30
+
+%preun
+if [ $1 -eq 0 ] ; then
+ update-alternatives --remove autosummary_generate %{_bindir}/autosummary_generate-%{py3_ver}
+fi
+
+
%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt
+%ghost %attr(0755,root,root) %{_bindir}/autosummary_generate
%{_bindir}/autosummary_generate-%{py3_ver}
-%{python3_sitelib}/*
+%{python3_sitelib}/numpydoc/
+%{python3_sitelib}/numpydoc-%{version}-py*.egg-info
%changelog
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python3-extras for openSUSE:Factory checked in at 2013-11-01 17:43:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-extras (Old)
and /work/SRC/openSUSE:Factory/.python3-extras.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-extras"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-extras/python3-extras.changes 2013-08-15 20:02:54.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-extras.new/python3-extras.changes 2013-11-01 17:43:45.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Oct 23 08:47:34 UTC 2013 - toddrme2178(a)gmail.com
+
+- Add BuildRequires: python3 for openSUSE 12.2, so hashlib is
+ available.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-extras.spec ++++++
--- /var/tmp/diff_new_pack.jiURsc/_old 2013-11-01 17:43:46.000000000 +0100
+++ /var/tmp/diff_new_pack.jiURsc/_new 2013-11-01 17:43:46.000000000 +0100
@@ -24,8 +24,10 @@
Group: Development/Languages/Python
Url: https://github.com/testing-cabal/extras
Source: http://pypi.python.org/packages/source/e/extras/extras-%{version}.tar.gz
-%if 0%{?suse_version} == 1220
+%if 0%{?suse_version} <= 1220
BuildRequires: python3-2to3
+# for hashlib
+BuildRequires: python3
%endif
BuildRequires: python3-devel
# Test requirements:
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-oauthlib for openSUSE:Factory checked in at 2013-11-01 17:43:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-oauthlib (Old)
and /work/SRC/openSUSE:Factory/.python-oauthlib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oauthlib"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-oauthlib/python-oauthlib.changes 2013-10-25 11:24:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-oauthlib.new/python-oauthlib.changes 2013-11-01 17:43:02.000000000 +0100
@@ -1,0 +2,31 @@
+Fri Nov 1 11:22:43 UTC 2013 - p.drouand(a)gmail.com
+
+- Update to version 0.6.0
+ + All endpoint methods change contract to return 3 values instead
+ of 4. The new signature is `headers`, `body`, `status code` where
+ the initial `redirect_uri` has been relocated to its rightful place
+ inside headers as `Location`.
+ + OAuth 1 Access Token Endpoint has a new required validator method
+ `invalidate_request_token`.
+ + OAuth 1 Authorization Endpoint now returns a 200 response instead
+ of 302 on `oob` callbacks.
+- Changes from version 0.5.1
+ + OAuth 1 provider fix for incorrect token param in nonce validation.
+- Changes from version 0.5.0
+ + OAuth 1 provider refactor. OAuth 2 refresh token validation fix.
+- Changes from version 0.4.2
+ + OAuth 2 draft to RFC. Removed OAuth 2 framework decorators.
+- Changes from version 0.4.1
+ + Documentation corrections and various small code fixes.
+- Changes from version 0.4.0
+ + OAuth 2 Provider support (experimental).
+- Changes from version 0.3.8
+ + OAuth 2 Client now uses custom errors and raise on expire
+- Changes from version 0.3.7
+ + OAuth 1 optional encoding of Client.sign return values
+- Changes from version 0.3.6
+ + Revert default urlencoding.
+- Changes from version 0.3.5
+ + Default unicode conversion (utf-8) and urlencoding of input.
+
+-------------------------------------------------------------------
Old:
----
oauthlib-0.3.4.tar.gz
New:
----
oauthlib-0.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-oauthlib.spec ++++++
--- /var/tmp/diff_new_pack.iAVCPZ/_old 2013-11-01 17:43:02.000000000 +0100
+++ /var/tmp/diff_new_pack.iAVCPZ/_new 2013-11-01 17:43:02.000000000 +0100
@@ -17,7 +17,7 @@
Name: python-oauthlib
-Version: 0.3.4
+Version: 0.6.0
Release: 0
Url: https://github.com/idangazit/oauthlib
Summary: A Generic Implementation of the OAuth Request-Signing Logic
++++++ oauthlib-0.3.4.tar.gz -> oauthlib-0.6.0.tar.gz ++++++
++++ 15340 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-logilab-common for openSUSE:Factory checked in at 2013-11-01 17:42:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-logilab-common (Old)
and /work/SRC/openSUSE:Factory/.python-logilab-common.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-logilab-common"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-logilab-common/python-logilab-common.changes 2012-05-07 22:50:09.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-logilab-common.new/python-logilab-common.changes 2013-11-01 17:42:52.000000000 +0100
@@ -1,0 +2,17 @@
+Fri Nov 1 10:20:04 UTC 2013 - p.drouand(a)gmail.com
+
+- Update to version 0.60
+ * configuration: rename option_name method into option_attrname (#140667)
+ * deprecation: new DeprecationManager class (closes #108205)
+ * modutils:
+ - fix typo causing name error in python3 / bad message in python2
+ (#136037)
+ - fix python3.3 crash in file_from_modpath due to implementation
+ change of imp.find_module wrt builtin modules (#137244)
+ * testlib: use assertCountEqual instead of assertSameElements/assertItemsEqual
+ (deprecated), fixing crash with python 3.3 (#144526)
+ * graph: use codecs.open avoid crash when writing utf-8 data under python3
+ (#155138)
+- Use download Url as source
+
+-------------------------------------------------------------------
Old:
----
logilab-common-0.58.0.tar.gz
New:
----
logilab-common-0.60.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-logilab-common.spec ++++++
--- /var/tmp/diff_new_pack.6KiUOq/_old 2013-11-01 17:42:53.000000000 +0100
+++ /var/tmp/diff_new_pack.6KiUOq/_new 2013-11-01 17:42:53.000000000 +0100
@@ -17,22 +17,20 @@
Name: python-logilab-common
-Version: 0.58.0
+Version: 0.60.0
Release: 0
Url: http://www.logilab.org/projects/common/
Summary: Python lowlevel functionality shared by logilab projects
License: LGPL-2.1+
Group: Development/Languages/Python
-Source: logilab-common-%{version}.tar.gz
+Source: http://download.logilab.org/pub/common/logilab-common-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
-%if 0%{?suse_version}
-%py_requires
-%if 0%{?suse_version} > 1110
-BuildArch: noarch
+%if 0%{?suse_version} <= 1110
+%{!?python_sitearch: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)")}
+%{py_requires}
%else
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%endif
+BuildArch: noarch
%endif
%description
++++++ logilab-common-0.58.0.tar.gz -> logilab-common-0.60.0.tar.gz ++++++
++++ 3521 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-dulwich for openSUSE:Factory checked in at 2013-11-01 17:42:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dulwich (Old)
and /work/SRC/openSUSE:Factory/.python-dulwich.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dulwich"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-dulwich/python-dulwich.changes 2012-11-25 13:28:44.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-dulwich.new/python-dulwich.changes 2013-11-01 17:42:23.000000000 +0100
@@ -1,0 +2,56 @@
+Fri Nov 1 12:04:05 UTC 2013 - p.drouand(a)gmail.com
+
+- Fix download Url
+
+-------------------------------------------------------------------
+Fri Nov 1 11:32:29 UTC 2013 - p.drouand(a)gmail.com
+
+- Update to version 0.9.3
+ + * Fix path for stdint.h in MANIFEST.in.
+- Changes from version 0.9.2
+ + Include stdint.h in MANIFEST.in
+- Changes from version 0.9.1
+ + Support lookups of 40-character refs in BaseRepo.__getitem_
+ + Fix fetching packs with side-band-64k capability disabled.
+ + Several fixes in send-pack protocol behaviour - handling of empty
+ pack files and deletes. #1063087
+ + Fix capability negotiation when fetching packs over HTTP.
+ #1072461
+ + Enforce determine_wants returning an empty list rather than None.
+ + In the server, support pushes just removing refs.
+ + Support passing a single revision to BaseRepo.get_walker() rather
+ than a list of revisions.
+ + Add `Repo.get_description` method.
+ + Support thin packs in Pack.iterobjects() and Pack.get_raw().
+ + Add `MemoryObjectStore.add_pack` and `MemoryObjectStore.add_thin_pack` methods.
+ + Add paramiko-based SSH vendor.
+ + Support running 'dulwich.server' and 'dulwich.web' using 'python -m'.
+ + Add ObjectStore.close().
+ + Raise appropriate NotImplementedError when encountering dumb HTTP servers.
+ + SSHVendor.connect_ssh has been renamed to SSHVendor.run_command.
+ + ObjectStore.add_pack() now returns a 3-tuple. The last element will be an
+ abort() method that can be used to cancel the pack operation.
+- Changes from version 0.9.0
+ + Push efficiency - report missing objects only. #562676
+ + Use indentation consistent with C Git in config files.
+ #1031356
+ + Recognize and skip binary files in diff function.
+ + Fix handling of relative paths in dulwich.client.get_transport_and_path.
+ + Preserve ordering of entries in configuration.
+ + Support ~ expansion in SSH client paths. #1083439
+ + Support relative paths in alternate paths.
+ #1175007
+ + Log all error messages from wsgiref server to the logging module. This
+ makes the test suit quiet again.
+ + Support passing None for empty tree in changes_from_tree.
+ + Support fetching empty repository in client. #1060462
+ + Add optional honor_filemode flag to build_index_from_tree.
+ + Support core/filemode setting when building trees.
+ + Add chapter on tags in tutorial
+ + Add support for mergetags. #963525
+ + Add support for posix shell hooks.
+- Changes from 0.8.7
+ + Fix use of alternates in ``DiskObjectStore``.{__contains__,__iter__}.
+ + Fix compatibility with Python 2.4.
+
+-------------------------------------------------------------------
Old:
----
dulwich-0.8.6.tar.gz
New:
----
dulwich-0.9.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-dulwich.spec ++++++
--- /var/tmp/diff_new_pack.PO0fZf/_old 2013-11-01 17:42:24.000000000 +0100
+++ /var/tmp/diff_new_pack.PO0fZf/_new 2013-11-01 17:42:24.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-dulwich
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products 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,13 +17,13 @@
Name: python-dulwich
-Version: 0.8.6
+Version: 0.9.3
Release: 0
Url: http://samba.org/~jelmer/dulwich
Summary: Pure-Python Git Library
License: GPL-2.0+
Group: Development/Languages/Python
-Source: http://www.samba.org/~jelmer/dulwich/dulwich-%{version}.tar.gz
+Source: https://pypi.python.org/packages/source/d/dulwich/dulwich-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-Sphinx
BuildRequires: python-devel
@@ -50,8 +50,10 @@
%files
%defattr(-,root,root,-)
-%doc AUTHORS COPYING HACKING NEWS README build/sphinx/html
+%doc COPYING NEWS README build/sphinx/html
%{_bindir}/dul-daemon
+%{_bindir}/dul-receive-pack
+%{_bindir}/dul-upload-pack
%{_bindir}/dul-web
%{_bindir}/dulwich
%{python_sitearch}/*
++++++ dulwich-0.8.6.tar.gz -> dulwich-0.9.3.tar.gz ++++++
++++ 4490 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-django for openSUSE:Factory checked in at 2013-11-01 17:42:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django (Old)
and /work/SRC/openSUSE:Factory/.python-django.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-django/python-django.changes 2013-09-17 16:25:45.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-django.new/python-django.changes 2013-11-01 17:42:15.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Oct 31 14:14:58 UTC 2013 - mcihar(a)suse.cz
+
+- Update to version 1.5.5:
+ + Readdressed denial-of-service via password hashers
+ + Properly rotate CSRF token on login
+
+-------------------------------------------------------------------
Old:
----
Django-1.5.4.tar.gz
New:
----
Django-1.5.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django.spec ++++++
--- /var/tmp/diff_new_pack.Lgz1eU/_old 2013-11-01 17:42:21.000000000 +0100
+++ /var/tmp/diff_new_pack.Lgz1eU/_new 2013-11-01 17:42:21.000000000 +0100
@@ -17,7 +17,7 @@
Name: python-django
-Version: 1.5.4
+Version: 1.5.5
Release: 0
Summary: A high-level Python Web framework
License: BSD-3-Clause
++++++ Django-1.5.4.tar.gz -> Django-1.5.5.tar.gz ++++++
/work/SRC/openSUSE:Factory/python-django/Django-1.5.4.tar.gz /work/SRC/openSUSE:Factory/.python-django.new/Django-1.5.5.tar.gz differ: char 5, line 1
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ibus for openSUSE:Factory checked in at 2013-11-01 17:41:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ibus (Old)
and /work/SRC/openSUSE:Factory/.ibus.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ibus"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ibus/ibus.changes 2013-10-17 17:38:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ibus.new/ibus.changes 2013-11-01 17:41:54.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Oct 31 14:46:37 CET 2013 - tiwai(a)suse.de
+
+- Always-save-the-content-type-cache-for-gnome-shell-p.patch:
+ This is an additional fix patch for ibus to avoid the wrong
+ IBus.InputPurpose.PASSWORD advertisement, which leads to the
+ password text appearance on GNOME3 (bnc#847718)
+
+-------------------------------------------------------------------
New:
----
Always-save-the-content-type-cache-for-gnome-shell-p.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ibus.spec ++++++
--- /var/tmp/diff_new_pack.rbvLlg/_old 2013-11-01 17:41:55.000000000 +0100
+++ /var/tmp/diff_new_pack.rbvLlg/_new 2013-11-01 17:41:55.000000000 +0100
@@ -41,6 +41,8 @@
%endif
# PATCH-FIX-OPENSUSE reload-preload-engines-until-users-customize-the-list.patch ftake(a)geeko.jp
Patch3: show-input-mode-icon.patch
+# PATCH-FIX-UPSTREAM Always-save-the-content-type-cache-for-gnome-shell-p.patch bnc#847718
+Patch4: Always-save-the-content-type-cache-for-gnome-shell-p.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: /usr/bin/touch
Provides: locale(ja;ko;zh)
@@ -188,6 +190,7 @@
%endif
%patch3 -p1
+%patch4 -p1
%build
autoreconf -fi
++++++ Always-save-the-content-type-cache-for-gnome-shell-p.patch ++++++
>From 9596aea2e2df4cd3ac9b795ad9f354723cf83317 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1(a)gmail.com>
Date: Wed, 2 Oct 2013 10:58:36 +0900
Subject: [PATCH] Always save the content-type cache for gnome-shell password.
GDBusProxy updates the cache immediatelly with the first call only
and has to save the next call in the cache by manual.
BUG=RH#1013948
TEST=password on gnome-shell 3.10.
Review URL: https://codereview.appspot.com/14196043
---
bus/engineproxy.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/bus/engineproxy.c
+++ b/bus/engineproxy.c
@@ -1159,6 +1159,11 @@ bus_engine_proxy_set_content_type (BusEn
NULL,
NULL,
NULL);
+
+ /* Need to update the cache by manual since there is a timing issue. */
+ g_dbus_proxy_set_cached_property ((GDBusProxy *) engine,
+ "ContentType",
+ content_type);
}
if (cached_content_type != NULL)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package gwenhywfar for openSUSE:Factory checked in at 2013-11-01 17:41:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gwenhywfar (Old)
and /work/SRC/openSUSE:Factory/.gwenhywfar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gwenhywfar"
Changes:
--------
--- /work/SRC/openSUSE:Factory/gwenhywfar/gwenhywfar.changes 2013-09-02 16:49:26.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gwenhywfar.new/gwenhywfar.changes 2013-11-01 17:41:35.000000000 +0100
@@ -1,0 +2,9 @@
+Wed Oct 23 14:42:06 UTC 2013 - nico.kruber(a)gmail.com
+
+- Update to version 4.8.0beta:
+ + new functions to work with dates (module GWEN_DATE,
+ e.g. GWEN_Date_GetLastHalfYearStart())
+ + fix some errors in the layout of the FOX 1.6 GUI module.
+ + some improvements in typemaker2.
+
+-------------------------------------------------------------------
Old:
----
gwenhywfar-4.7.0beta.tar.gz
New:
----
gwenhywfar-4.8.0beta.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gwenhywfar.spec ++++++
--- /var/tmp/diff_new_pack.LXT4h3/_old 2013-11-01 17:41:36.000000000 +0100
+++ /var/tmp/diff_new_pack.LXT4h3/_new 2013-11-01 17:41:36.000000000 +0100
@@ -17,7 +17,7 @@
Name: gwenhywfar
-Version: 4.7.0beta
+Version: 4.8.0beta
Release: 0
Summary: Multiplatform Helper Library for Other Libraries
License: GPL-2.0+ and LGPL-2.1+
++++++ gwenhywfar-4.7.0beta.tar.gz -> gwenhywfar-4.8.0beta.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/ChangeLog new/gwenhywfar-4.8.0beta/ChangeLog
--- old/gwenhywfar-4.7.0beta/ChangeLog 2013-08-21 18:14:08.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/ChangeLog 2013-10-22 20:24:13.000000000 +0200
@@ -1,4 +1,53 @@
------------------------------------------------------------------
+2013-10-22 20:24:06 +0200 Martin Preuss
+Prepared release 4.8.0beta.
+
+------------------------------------------------------------------
+2013-10-22 20:20:59 +0200 Martin Preuss
+Fixed typos.
+
+------------------------------------------------------------------
+2013-10-04 21:12:34 +0000 martin
+Filled gwen_bindata.tm2 with life.
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2251 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-09-29 16:57:41 +0000 martin
+Added function GWEN_StringList2_GetStringAt().
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2250 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-09-21 23:46:07 +0000 martin
+Added some convenience functions to GWEN_DATE module.
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2249 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-09-21 15:56:29 +0000 martin
+Fixed typemaker2 bindings for GWEN_STRINGLIST2.
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2248 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-09-21 15:41:17 +0000 martin
+Make GWEN_StringList2 available to typemaker2.
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2247 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-08-23 11:29:03 +0000 martin
+Incremented version.
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2246 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
+2013-08-23 11:27:45 +0000 martin
+FOX16-GUI: Fixed some layout issues.
+FOX-Dialogs should now resize themselves to reasonable sizes, unless the
+dimensions are read from a configuration.
+
+FOX16_HtmlLabel now determines its size only once per text, if no special
+flags are given. This makes the behaviour more predictable.
+
+git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2245 70169cfe-8b10-0410-8925-dcb4b91034d8
+
+------------------------------------------------------------------
2013-08-21 15:44:54 +0000 martin
Prepared release 3.7.0beta.
git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2244 70169cfe-8b10-0410-8925-dcb4b91034d8
@@ -573,65 +622,3 @@
2012-11-27 18:33:21 +0000 martin
Added an example for virtual functions.
git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2154 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-10-30 10:02:53 +0000 christian
-Fix mismatch of "static" attribute at declaration and definition of function.
-However, both "static" and also the GWENHYWFAR_CB macro is not yet
-used consistently in all places and might need further fixing
-to get rid of all "incompatible pointer type" compiler warnings.
-
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2153 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-24 20:56:52 +0000 martin
-Typemaker2: Added handling for code documentation.
-Not finished, yet. But the code should now read the api doc from a typemaker2
-XML file. The next step will be to include the API documentation in the
-destination header files.
-
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2152 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-23 21:00:34 +0000 martin
-Adapted console GUI implementation to allow for changing the total amount of a progress bar.
-The HTTP network code call GWEN_Gui_ProgressSetTotal() as soon as it knows
-how much data is to be transfered. This should also be reflected in the
-console GUI implementation. Now it is.
-
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2151 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-21 20:04:49 +0000 martin
-Incremented BUILD version.
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2150 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-21 20:04:46 +0000 martin
-Improved debug messages.
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2149 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-20 21:12:55 +0000 martin
-Incremented BUILD version.
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2148 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-20 21:12:50 +0000 martin
-HTML: Added handling of H4 titles.
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2147 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-10 21:32:57 +0000 mlenk
-Fix another build failure with GCC 4.7
-... similar to commit r2133.
-
-
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2146 70169cfe-8b10-0410-8925-dcb4b91034d8
-
-------------------------------------------------------------------
-2012-05-08 22:54:40 +0000 martin
-Fixed a typo.
-Getting the public key of a certificate works now.
-
-git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@2145 70169cfe-8b10-0410-8925-dcb4b91034d8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/configure new/gwenhywfar-4.8.0beta/configure
--- old/gwenhywfar-4.7.0beta/configure 2013-08-21 17:43:29.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/configure 2013-10-22 20:22:05.000000000 +0200
@@ -2763,7 +2763,7 @@
# versions
#
GWENHYWFAR_VERSION_MAJOR=4
-GWENHYWFAR_VERSION_MINOR=7
+GWENHYWFAR_VERSION_MINOR=8
GWENHYWFAR_VERSION_PATCHLEVEL=0
GWENHYWFAR_VERSION_BUILD=0
GWENHYWFAR_VERSION_TAG="beta"
@@ -2774,8 +2774,8 @@
#
# SO version for Gwenhywfar
#
-GWENHYWFAR_SO_CURRENT="67"
-GWENHYWFAR_SO_AGE="7"
+GWENHYWFAR_SO_CURRENT="68"
+GWENHYWFAR_SO_AGE="8"
GWENHYWFAR_SO_REVISION="0"
GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/configure.ac new/gwenhywfar-4.8.0beta/configure.ac
--- old/gwenhywfar-4.7.0beta/configure.ac 2013-08-21 17:43:15.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/configure.ac 2013-10-22 20:21:51.000000000 +0200
@@ -28,7 +28,7 @@
# versions
#
GWENHYWFAR_VERSION_MAJOR=4
-GWENHYWFAR_VERSION_MINOR=7
+GWENHYWFAR_VERSION_MINOR=8
GWENHYWFAR_VERSION_PATCHLEVEL=0
GWENHYWFAR_VERSION_BUILD=0
dnl "stable", "rcX", "betaX", "cvs"
@@ -40,8 +40,8 @@
#
# SO version for Gwenhywfar
#
-GWENHYWFAR_SO_CURRENT="67"
-GWENHYWFAR_SO_AGE="7"
+GWENHYWFAR_SO_CURRENT="68"
+GWENHYWFAR_SO_AGE="8"
GWENHYWFAR_SO_REVISION="0"
GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/gui/fox16/fox16_gui_dialog.cpp new/gwenhywfar-4.8.0beta/gui/fox16/fox16_gui_dialog.cpp
--- old/gwenhywfar-4.7.0beta/gui/fox16/fox16_gui_dialog.cpp 2013-08-05 22:53:58.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/gui/fox16/fox16_gui_dialog.cpp 2013-08-23 13:25:09.000000000 +0200
@@ -58,6 +58,7 @@
,_widgetCount(0)
,_mainWidget(NULL)
,m_iconSource(NULL)
+,m_sizeChanged(FALSE)
{
}
@@ -70,6 +71,7 @@
,_widgetCount(0)
,_mainWidget(NULL)
,m_iconSource(NULL)
+,m_sizeChanged(FALSE)
{
}
@@ -500,10 +502,12 @@
case GWEN_DialogProperty_Width:
f->recalc();
f->resize(value, f->getHeight());
+ m_sizeChanged=TRUE;
return 0;
case GWEN_DialogProperty_Height:
f->recalc();
f->resize(f->getWidth(), value);
+ m_sizeChanged=TRUE;
return 0;
case GWEN_DialogProperty_Enabled:
if (value==0)
@@ -1914,12 +1918,16 @@
/* create X11 server side resources */
xw->create();
+ m_sizeChanged=FALSE;
rv=GWEN_Dialog_EmitSignalToAll(_dialog, GWEN_DialogEvent_TypeInit, "");
if (rv<0) {
DBG_INFO(0, "Error initializing dialog: %d", rv);
return false;
}
-
+ if (!m_sizeChanged) {
+ DBG_ERROR(0, "Resizing dialog myself");
+ xw->resize(xw->getDefaultWidth(), xw->getDefaultHeight());
+ }
xw->layout();
return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/gui/fox16/fox16_gui_dialog_l.hpp new/gwenhywfar-4.8.0beta/gui/fox16/fox16_gui_dialog_l.hpp
--- old/gwenhywfar-4.7.0beta/gui/fox16/fox16_gui_dialog_l.hpp 2012-12-30 19:58:03.000000000 +0100
+++ new/gwenhywfar-4.8.0beta/gui/fox16/fox16_gui_dialog_l.hpp 2013-08-23 12:55:06.000000000 +0200
@@ -97,6 +97,7 @@
FXIconSource *m_iconSource;
std::list<FXIcon*> m_iconList;
std::list<RadioButtonGroup*> m_radioGroups;
+ bool m_sizeChanged;
FOX16_GuiDialog();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/gui/fox16/fox16_htmllabel.cpp new/gwenhywfar-4.8.0beta/gui/fox16/fox16_htmllabel.cpp
--- old/gwenhywfar-4.7.0beta/gui/fox16/fox16_htmllabel.cpp 2010-08-28 13:44:13.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/gui/fox16/fox16_htmllabel.cpp 2013-08-23 13:24:07.000000000 +0200
@@ -46,7 +46,7 @@
:FXFrame(p, opts, x, y, w, h, pl, pr, pt, pb)
,m_htmlCtx(NULL)
,m_minWidth(0)
-,m_maxDefaultWidth(MAX_DEFAULT_WIDTH)
+,m_maxDefaultWidth(-1)
,m_haveDefaultDims(false)
,m_mediaPaths(NULL)
,m_icon(NULL)
@@ -111,18 +111,14 @@
void FOX16_HtmlLabel::calcDefaultDims() {
#if 0
int w;
- int wNeeded;
- m_htmlCtx->layout(-1, -1);
- wNeeded=m_htmlCtx->getWidth();
- w=wNeeded;
- if (w>m_maxDefaultWidth)
- w=m_maxDefaultWidth;
- if (w<width)
+ if (options & FLAGS_NO_WORDWRAP)
+ w=-1;
+ else if (options & FLAGS_USE_FULL_WIDTH)
w=width;
- if (w<wNeeded) {
- m_htmlCtx->layout(w-border*2, -1);
- }
+ else
+ w=m_maxDefaultWidth;
+ m_htmlCtx->layout(w-border*2, -1);
m_defaultWidth=m_htmlCtx->getWidth();
m_defaultHeight=m_htmlCtx->getHeight();
m_haveDefaultDims=true;
@@ -133,12 +129,41 @@
w=-1;
else if (options & FLAGS_USE_FULL_WIDTH)
w=width;
- else
+ else if (m_maxDefaultWidth!=-1)
w=m_maxDefaultWidth;
+ else {
+ int wTmp=1024;
+ int mask=1024;
+ int i;
+
+ for (i=0; i<10; i++) {
+ double ar, nw, nh;
+
+ m_htmlCtx->layout(wTmp-border*2, -1);
+ nw=(double) (m_htmlCtx->getWidth());
+ nh=(double)(m_htmlCtx->getHeight());
+ ar=nw/nh;
+
+ if (ar>=3.5 && ar<4.0)
+ break;
+
+ if (ar>4.0)
+ /* w/h too high, so we need to reduce the width */
+ wTmp&=~mask;
+
+ mask>>=1;
+ wTmp|=mask;
+ }
+ w=wTmp;
+ }
+
+ /* TODO: handle icon size correctly */
+
m_htmlCtx->layout(w-border*2, -1);
m_defaultWidth=m_htmlCtx->getWidth();
m_defaultHeight=m_htmlCtx->getHeight();
m_haveDefaultDims=true;
+ //DBG_ERROR(0, "Labelsize: %d / %d", m_defaultWidth, m_defaultHeight);
#endif
}
@@ -155,6 +180,9 @@
w=m_defaultWidth;
if (m_icon)
w+=m_icon->getWidth()+ICON_SPACE;
+
+ //DBG_ERROR(0, "GetDefaultWidth[%s]: Width= %d", m_text.text(), w);
+
return w;
}
@@ -176,6 +204,8 @@
h=ih;
}
+ //DBG_ERROR(0, "GetDefaultHeight[%s]: Height= %d", m_text.text(), h);
+
return h;
}
@@ -189,6 +219,7 @@
dc.fillRectangle(border, border, width-(border*2), height-(border*2));
if (m_htmlCtx) {
+ //DBG_ERROR(0, "Paint: Labelsize= %d / %d", m_htmlCtx->getWidth(), m_htmlCtx->getHeight());
if (m_icon) {
int th;
int ih;
@@ -236,8 +267,13 @@
m_haveDefaultDims=false;
if (options & FLAGS_NO_WORDWRAP)
w=-1;
- else
+ else if (options & FLAGS_USE_FULL_WIDTH) {
w=width;
+ if (m_icon)
+ w-=(m_icon->getWidth()+ICON_SPACE);
+ }
+ else
+ w=m_maxDefaultWidth;
if (m_htmlCtx==NULL)
updateHtml();
@@ -247,7 +283,14 @@
#else
int w;
- m_haveDefaultDims=false;
+ //DBG_ERROR(0, "Layout[%s]: Width=%d, height=%d", m_text.text(), width, height);
+
+ if (m_htmlCtx==NULL)
+ updateHtml();
+
+ if (!m_haveDefaultDims)
+ calcDefaultDims();
+
if (options & FLAGS_NO_WORDWRAP)
w=-1;
else if (options & FLAGS_USE_FULL_WIDTH) {
@@ -256,13 +299,12 @@
w-=(m_icon->getWidth()+ICON_SPACE);
}
else
- w=m_maxDefaultWidth;
+ w=m_defaultWidth;
- if (m_htmlCtx==NULL)
- updateHtml();
m_htmlCtx->layout(w-border*2, height-border*2);
update();
flags&=~FLAG_DIRTY;
+
#endif
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/gui/fox16/libtest.cpp new/gwenhywfar-4.8.0beta/gui/fox16/libtest.cpp
--- old/gwenhywfar-4.7.0beta/gui/fox16/libtest.cpp 2012-12-30 23:04:16.000000000 +0100
+++ new/gwenhywfar-4.8.0beta/gui/fox16/libtest.cpp 2013-08-23 13:11:53.000000000 +0200
@@ -523,6 +523,63 @@
+int test11(int argc, char **argv) {
+ FXApp application("libtest","Martin Preuss");
+ FOX16_Gui *gui;
+ char buffer[65];
+
+ application.init(argc,argv);
+
+ application.create();
+
+ gui=new FOX16_Gui(&application);
+ GWEN_Gui_SetGui(gui->getCInterface());
+
+ GWEN_Gui_InputBox(GWEN_GUI_INPUT_FLAGS_SHOW,
+ "This is the Title",
+ "<html>This is quite a long HTML text. This is the second sentence, which is a bit longer "
+ "than the first one.<br>In any case this sentence should begin on its own line</html>"
+
+ "This is quite a long HTML text. This is the second sentence, which is a bit longer "
+ "than the first one.\nIn any case this sentence should begin on its own line.",
+ buffer,
+ 1,
+ sizeof(buffer)-1,
+ 0);
+
+
+ return 0;
+}
+
+
+
+int test12(int argc, char **argv) {
+ FXApp application("libtest","Martin Preuss");
+ FOX16_Gui *gui;
+ char buffer[65];
+
+ application.init(argc,argv);
+
+ application.create();
+
+ gui=new FOX16_Gui(&application);
+ GWEN_Gui_SetGui(gui->getCInterface());
+
+ GWEN_Gui_InputBox(GWEN_GUI_INPUT_FLAGS_SHOW,
+ "This is the Title",
+ "<html><b>This</b> is quite a long HTML text. This is the second sentence, which is a bit longer "
+ "than the first one.<br>In any case this sentence should begin on its own line.</html>",
+ buffer,
+ 1,
+ sizeof(buffer)-1,
+ 0);
+
+
+ return 0;
+}
+
+
+
int main(int argc, char **argv) {
GWEN_Init();
@@ -550,6 +607,10 @@
return test9(argc, argv);
else if (strcasecmp(argv[1], "10")==0)
return test10(argc, argv);
+ else if (strcasecmp(argv[1], "11")==0)
+ return test11(argc, argv);
+ else if (strcasecmp(argv[1], "12")==0)
+ return test12(argc, argv);
}
else
return test7(argc, argv);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/gwenhywfar.spec new/gwenhywfar-4.8.0beta/gwenhywfar.spec
--- old/gwenhywfar-4.7.0beta/gwenhywfar.spec 2013-08-21 17:43:34.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/gwenhywfar.spec 2013-10-22 20:22:11.000000000 +0200
@@ -3,7 +3,7 @@
%define name gwenhywfar
-%define version 4.7.0beta
+%define version 4.8.0beta
%define rpm_cxxflags \"-O2 -march=i486 -mcpu=i586\"
%define rpm_cflags \"-O2 -march=i486 -mcpu=i586\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/base/stringlist2.c new/gwenhywfar-4.8.0beta/src/base/stringlist2.c
--- old/gwenhywfar-4.7.0beta/src/base/stringlist2.c 2011-06-13 17:28:49.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/base/stringlist2.c 2013-09-29 18:53:54.000000000 +0200
@@ -80,6 +80,104 @@
+int GWEN_StringList2_toDb(GWEN_STRINGLIST2 *sl2, GWEN_DB_NODE *db, const char *name) {
+ GWEN_DB_DeleteVar(db, name);
+
+ if (sl2) {
+ GWEN_STRINGLIST2_ITERATOR *it;
+
+ it=GWEN_StringList2_First(sl2);
+ if (it) {
+ const char *s;
+
+ s=GWEN_StringList2Iterator_Data(it);
+ while(s) {
+ int rv;
+
+ rv=GWEN_DB_SetCharValue(db, 0, name, s);
+ if (rv<0) {
+ DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
+ return rv;
+ }
+
+ s=GWEN_StringList2Iterator_Next(it);
+ }
+ GWEN_StringList2Iterator_free(it);
+ }
+ }
+
+ return 0;
+}
+
+
+
+GWEN_STRINGLIST2 *GWEN_StringList2_fromDb(GWEN_DB_NODE *db, const char *name, GWEN_STRINGLIST2_INSERTMODE m) {
+ GWEN_STRINGLIST2 *sl2;
+ int i;
+
+ sl2=GWEN_StringList2_new();
+ for (i=0; ; i++) {
+ const char *s;
+
+ s=GWEN_DB_GetCharValue(db, name, i, NULL);
+ if (!s)
+ break;
+ GWEN_StringList2_AppendString(sl2, s, 0, m);
+ }
+
+ return sl2;
+}
+
+
+
+int GWEN_StringList2_toXml(GWEN_STRINGLIST2 *sl2, GWEN_XMLNODE *node) {
+ GWEN_STRINGLIST2_ITERATOR *it;
+
+ it=GWEN_StringList2_First(sl2);
+ if (it) {
+ const char *s;
+
+ s=GWEN_StringList2Iterator_Data(it);
+ while(s) {
+ GWEN_XMLNode_SetCharValue(node, "elem", s);
+ s=GWEN_StringList2Iterator_Next(it);
+ }
+ GWEN_StringList2Iterator_free(it);
+ }
+
+ return 0;
+}
+
+
+
+GWEN_STRINGLIST2 *GWEN_StringList2_fromXml(GWEN_XMLNODE *node, GWEN_STRINGLIST2_INSERTMODE m) {
+ GWEN_STRINGLIST2 *sl2;
+ GWEN_XMLNODE *n;
+
+ sl2=GWEN_StringList2_new();
+
+
+ n=GWEN_XMLNode_GetFirstTag(node);
+ while(n) {
+ GWEN_XMLNODE *dn;
+
+ dn=GWEN_XMLNode_GetFirstData(n);
+ if (dn) {
+ const char *s;
+
+ s=GWEN_XMLNode_GetData(dn);
+ if (s) {
+ GWEN_StringList2_AppendString(sl2, s, 0, m);
+ }
+ }
+ n=GWEN_XMLNode_GetNextTag(n);
+ }
+
+ return sl2;
+}
+
+
+
void GWEN_StringList2_SetSenseCase(GWEN_STRINGLIST2 *sl2, int i){
assert(sl2);
sl2->senseCase=i;
@@ -268,6 +366,31 @@
+const char *GWEN_StringList2_GetStringAt(const GWEN_STRINGLIST2 *sl2, int idx) {
+ GWEN_STRINGLIST2_ITERATOR *it;
+ GWEN_REFPTR *rp;
+
+ it=GWEN_StringList2_First(sl2);
+ if (it) {
+ rp=GWEN_ListIterator_DataRefPtr((GWEN_LIST_ITERATOR*)it);
+
+ while(rp) {
+ const char *t;
+
+ t=(const char*)GWEN_RefPtr_GetData(rp);
+ assert(t);
+ if (idx--==0) {
+ GWEN_StringList2Iterator_free(it);
+ return t;
+ }
+ rp=GWEN_ListIterator_NextRefPtr((GWEN_LIST_ITERATOR*)it);
+ }
+ GWEN_StringList2Iterator_free(it);
+ }
+
+ return NULL;
+}
+
@@ -334,6 +457,13 @@
}
+
+unsigned int GWEN_StringList2_GetCount(const GWEN_STRINGLIST2 *l) {
+ assert(l);
+ return GWEN_List_GetSize(l->listPtr);
+}
+
+
void GWEN_StringList2_Dump(const GWEN_STRINGLIST2 *sl2){
GWEN_STRINGLIST2_ITERATOR *it;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/base/stringlist2.h new/gwenhywfar-4.8.0beta/src/base/stringlist2.h
--- old/gwenhywfar-4.7.0beta/src/base/stringlist2.h 2011-06-13 17:28:54.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/base/stringlist2.h 2013-09-29 18:48:51.000000000 +0200
@@ -33,6 +33,8 @@
#include <gwenhywfar/types.h>
#include <gwenhywfar/refptr.h>
#include <gwenhywfar/list.h>
+#include <gwenhywfar/db.h>
+#include <gwenhywfar/xml.h>
#ifdef __cplusplus
extern "C" {
@@ -57,6 +59,20 @@
GWEN_STRINGLIST2 *GWEN_StringList2_dup(GWEN_STRINGLIST2 *sl2);
+GWENHYWFAR_API
+int GWEN_StringList2_toDb(GWEN_STRINGLIST2 *sl2, GWEN_DB_NODE *db, const char *varName);
+
+GWENHYWFAR_API
+GWEN_STRINGLIST2 *GWEN_StringList2_fromDb(GWEN_DB_NODE *db, const char *name, GWEN_STRINGLIST2_INSERTMODE m);
+
+
+GWENHYWFAR_API
+int GWEN_StringList2_toXml(GWEN_STRINGLIST2 *sl2, GWEN_XMLNODE *node);
+
+GWENHYWFAR_API
+GWEN_STRINGLIST2 *GWEN_StringList2_fromXml(GWEN_XMLNODE *node, GWEN_STRINGLIST2_INSERTMODE m);
+
+
/**
* Normally this group of functions ignores cases when comparing two strings.
* You can change this behaviour here.
@@ -115,9 +131,11 @@
* @return !=0 if found, 0 otherwise
*/
GWENHYWFAR_API int GWEN_StringList2_HasString(const GWEN_STRINGLIST2 *sl2,
- const char *s);
+ const char *s);
+GWENHYWFAR_API const char *GWEN_StringList2_GetStringAt(const GWEN_STRINGLIST2 *sl2, int idx);
+
GWENHYWFAR_API
@@ -156,6 +174,12 @@
GWENHYWFAR_API void GWEN_StringList2_Dump(const GWEN_STRINGLIST2 *sl2);
+GWENHYWFAR_API int GWEN_StringList2_toXml(GWEN_STRINGLIST2 *sl2, GWEN_XMLNODE *node);
+
+
+GWENHYWFAR_API unsigned int GWEN_StringList2_GetCount(const GWEN_STRINGLIST2 *l);
+
+
#ifdef __cplusplus
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/os/gwendate.c new/gwenhywfar-4.8.0beta/src/os/gwendate.c
--- old/gwenhywfar-4.7.0beta/src/os/gwendate.c 2013-08-21 17:13:45.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/os/gwendate.c 2013-10-05 21:38:22.000000000 +0200
@@ -610,6 +610,215 @@
+GWEN_DATE *GWEN_Date_GetThisMonthStart(const GWEN_DATE *dt) {
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), GWEN_Date_GetMonth(dt), 1);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt) {
+ int day;
+
+ switch(GWEN_Date_GetMonth(dt)) {
+ case 1:
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 10:
+ case 12:
+ day=31;
+ break;
+ case 2:
+ if (GWEN_Date_IsLeapYear(GWEN_Date_GetYear(dt)))
+ day=29;
+ else
+ day=28;
+ break;
+
+ case 4:
+ case 6:
+ case 9:
+ case 11:
+ day=30;
+ break;
+ }
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), GWEN_Date_GetMonth(dt), day);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisQuarterYearStart(const GWEN_DATE *dt) {
+ int m;
+
+ m=(GWEN_Date_GetMonth(dt)-1)>>2;
+ switch(m) {
+ case 0:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 1, 1);
+ case 1:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 4, 1);
+ case 2:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 7, 1);
+ case 3:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 10, 1);
+ }
+
+ return NULL;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisQuarterYearEnd(const GWEN_DATE *dt) {
+ int m;
+
+ m=(GWEN_Date_GetMonth(dt)-1)>>2;
+ switch(m) {
+ case 0:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 3, 31);
+ case 1:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 6, 30);
+ case 2:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 9, 30);
+ case 3:
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 12, 31);
+ }
+
+ return NULL;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisHalfYearStart(const GWEN_DATE *dt) {
+ if (GWEN_Date_GetMonth(dt)<7)
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 1, 1);
+ else
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 7, 1);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisHalfYearEnd(const GWEN_DATE *dt) {
+ if (GWEN_Date_GetMonth(dt)<7)
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 6, 30);
+ else
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 12, 31);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisYearStart(const GWEN_DATE *dt) {
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 1, 1);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetThisYearEnd(const GWEN_DATE *dt) {
+ return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), 12, 31);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastMonthStart(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ GWEN_DATE *result;
+ int j;
+
+ tmpDate=GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), GWEN_Date_GetMonth(dt), 1);
+ j=GWEN_Date_GetJulian(tmpDate)-1;
+ GWEN_Date_free(tmpDate);
+ tmpDate=GWEN_Date_fromJulian(j);
+ result=GWEN_Date_fromGregorian(GWEN_Date_GetYear(tmpDate), GWEN_Date_GetMonth(tmpDate), 1);
+ GWEN_Date_free(tmpDate);
+ return result;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastMonthEnd(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ int j;
+
+ tmpDate=GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), GWEN_Date_GetMonth(dt), 1);
+ j=GWEN_Date_GetJulian(tmpDate)-1;
+ GWEN_Date_free(tmpDate);
+ return GWEN_Date_fromJulian(j);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastQuarterYearStart(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ GWEN_DATE *result;
+
+ tmpDate=GWEN_Date_GetLastQuarterYearEnd(dt);
+ result=GWEN_Date_GetThisQuarterYearStart(tmpDate);
+ GWEN_Date_free(tmpDate);
+ return result;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastQuarterYearEnd(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ int j;
+
+ tmpDate=GWEN_Date_GetThisQuarterYearStart(dt);
+ j=GWEN_Date_GetJulian(tmpDate)-1;
+ GWEN_Date_free(tmpDate);
+ return GWEN_Date_fromJulian(j);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastHalfYearStart(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ GWEN_DATE *result;
+
+ tmpDate=GWEN_Date_GetLastHalfYearEnd(dt);
+ result=GWEN_Date_GetThisHalfYearStart(tmpDate);
+ GWEN_Date_free(tmpDate);
+ return result;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastHalfYearEnd(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ int j;
+
+ tmpDate=GWEN_Date_GetThisHalfYearStart(dt);
+ j=GWEN_Date_GetJulian(tmpDate)-1;
+ GWEN_Date_free(tmpDate);
+ return GWEN_Date_fromJulian(j);
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastYearStart(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ GWEN_DATE *result;
+
+ tmpDate=GWEN_Date_GetLastYearEnd(dt);
+ result=GWEN_Date_GetThisYearStart(tmpDate);
+ GWEN_Date_free(tmpDate);
+ return result;
+}
+
+
+
+GWEN_DATE *GWEN_Date_GetLastYearEnd(const GWEN_DATE *dt) {
+ GWEN_DATE *tmpDate;
+ int j;
+
+ tmpDate=GWEN_Date_GetThisYearStart(dt);
+ j=GWEN_Date_GetJulian(tmpDate)-1;
+ GWEN_Date_free(tmpDate);
+ return GWEN_Date_fromJulian(j);
+}
+
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/os/gwendate.h new/gwenhywfar-4.8.0beta/src/os/gwendate.h
--- old/gwenhywfar-4.7.0beta/src/os/gwendate.h 2013-08-21 17:11:32.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/os/gwendate.h 2013-09-22 01:07:49.000000000 +0200
@@ -115,6 +115,32 @@
GWENHYWFAR_API GWEN_DATE *GWEN_Date_fromDb(GWEN_DB_NODE *db);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisMonthStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisQuarterYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisQuarterYearEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisHalfYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisHalfYearEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetThisYearEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastMonthStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastMonthEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastQuarterYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastQuarterYearEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastHalfYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastHalfYearEnd(const GWEN_DATE *dt);
+
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastYearStart(const GWEN_DATE *dt);
+GWENHYWFAR_API GWEN_DATE *GWEN_Date_GetLastYearEnd(const GWEN_DATE *dt);
+
+
+
#ifdef __cplusplus
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/ressource.rc new/gwenhywfar-4.8.0beta/src/ressource.rc
--- old/gwenhywfar-4.7.0beta/src/ressource.rc 2013-08-21 17:43:34.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/ressource.rc 2013-10-22 20:22:11.000000000 +0200
@@ -43,8 +43,8 @@
// Version
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4, 7, 0, 0
- PRODUCTVERSION 4, 7, 0, 0
+ FILEVERSION 4, 8, 0, 0
+ PRODUCTVERSION 4, 8, 0, 0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L // Windows NT
@@ -58,14 +58,14 @@
//VALUE "Comments", "\0"
VALUE "CompanyName", " Aquamaniac\0"
VALUE "FileDescription", "Multi purpose library\0"
- VALUE "FileVersion", "v4.7.0beta\0"
+ VALUE "FileVersion", "v4.8.0beta\0"
VALUE "InternalName", "Gwenhywfar\0"
VALUE "LegalCopyright", "Copyright � 2003 by Martin Preuss\0"
VALUE "LegalTrademarks", "Aquamaniac\0"
VALUE "OriginalFilename", "GWENHYWFAR32.DLL\0"
//VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Gwenhywfar\0"
- VALUE "ProductVersion", "v4.7.0beta-0\0"
+ VALUE "ProductVersion", "v4.8.0beta-0\0"
VALUE "Author", "Martin Preuss\0"
VALUE "Email", "martin(a)libchipcard.de\0"
VALUE "Homepage", "http://gwenhywfar.sf.net/\0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/src/version.h new/gwenhywfar-4.8.0beta/src/version.h
--- old/gwenhywfar-4.7.0beta/src/version.h 2013-08-21 17:43:34.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/src/version.h 2013-10-22 20:22:11.000000000 +0200
@@ -31,12 +31,12 @@
#define GWEN_VERSION_MAJOR 4
#define GWENHYWFAR_VERSION_MAJOR 4
-#define GWENHYWFAR_VERSION_MINOR 7
+#define GWENHYWFAR_VERSION_MINOR 8
#define GWENHYWFAR_VERSION_PATCHLEVEL 0
#define GWENHYWFAR_VERSION_BUILD 0
#define GWENHYWFAR_VERSION_TAG "beta"
-#define GWENHYWFAR_VERSION_FULL_STRING "4.7.0beta-0"
-#define GWENHYWFAR_VERSION_STRING "4.7.0"
+#define GWENHYWFAR_VERSION_FULL_STRING "4.8.0beta-0"
+#define GWENHYWFAR_VERSION_STRING "4.8.0"
#define GWENHYWFAR_SO_EFFECTIVE 60
#define GWENHYWFAR_SO_EFFECTIVE_STR "60"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/Makefile.am new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/Makefile.am
--- old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/Makefile.am 2013-08-16 14:38:14.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/Makefile.am 2013-09-12 19:36:51.000000000 +0200
@@ -25,7 +25,8 @@
uint8_t.tm2 \
uint8_t_array.tm2 \
gwen_bindata.tm2 \
- double_array.tm2
+ double_array.tm2 \
+ gwen_stringlist2.tm2
sources:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/Makefile.in new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/Makefile.in
--- old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/Makefile.in 2013-08-21 17:43:29.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/Makefile.in 2013-10-22 20:22:05.000000000 +0200
@@ -375,7 +375,8 @@
uint8_t.tm2 \
uint8_t_array.tm2 \
gwen_bindata.tm2 \
- double_array.tm2
+ double_array.tm2 \
+ gwen_stringlist2.tm2
all: all-am
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/gwen_bindata.tm2 new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/gwen_bindata.tm2
--- old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/gwen_bindata.tm2 2013-08-16 14:44:28.000000000 +0200
+++ new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/gwen_bindata.tm2 2013-10-04 23:09:03.000000000 +0200
@@ -4,6 +4,7 @@
<typedef id="GWEN_BINDATA" type="opaque" lang="c" >
<identifier>GWEN_BINDATA</identifier>
+ <aqdb_type>AQDB_DataType_Bin</aqdb_type>
<codedefs>
@@ -63,16 +64,76 @@
<codedef id="toXml">
<code>
+ {
+ if ($(src).length && $(src).pointer) {
+ GWEN_BUFFER *tbuf;
+ int rv;
+
+ tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
+ rv=GWEN_Base64_Encode((const unsigned char*) $(src).pointer, $(src).length, tbuf, 80);
+ if (rv < 0) {
+ DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
+ }
+ else {
+ GWEN_XMLNode_SetCharValue($(db), "$(name)", GWEN_Buffer_GetStart(tbuf));
+ GWEN_Buffer_free(tbuf);
+ }
+ }
+ }
</code>
</codedef>
<codedef id="fromXml">
<code>
+ {
+ const char *s;
+
+ s=GWEN_XMLNode_GetCharValue($(db), "$(name)", $(default));
+ if (s) {
+ GWEN_BUFFER *tbuf;
+ int rv;
+
+ tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
+ rv=GWEN_Base64_Decode((const unsigned char*)s, strlen(s), tbuf);
+ if (rv < 0) {
+ DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
+ }
+ else {
+ char *t;
+ uint32_t len;
+
+ len=GWEN_Buffer_GetUsedBytes(tbuf);
+ t=GWEN_Buffer_GetStart(tbuf);
+ if (GWEN_Buffer_Relinquish(tbuf) < 0) {
+ uint8_t *dest;
+
+ dest=(uint8_t*) malloc(len);
+ memmove(dest, t, len);
+ $(dst).pointer=dest;
+ $(dst).length=len;
+ }
+ else {
+ $(dst).pointer=(uint8_t*) t;
+ $(dst).length=len;
+ }
+ }
+ GWEN_Buffer_free(tbuf);
+ }
+ }
</code>
</codedef>
<codedef id="toDb">
<code>
+ {
+ if ($(src).length && $(src).pointer) {
+ GWEN_DB_SetBinValue($(db), GWEN_DB_FLAGS_OVERWRITE_VARS, "$(name)", $(src).pointer, $(src).length);
+ }
+ else {
+ GWEN_DB_DeleteVar($(db), "$(name)");
+ $(retval)=0;
+ }
+ }
</code>
</codedef>
@@ -80,6 +141,20 @@
<codedef id="fromDb">
<code>
+ {
+ const void *v;
+ unsigned int vlen;
+
+ v=GWEN_DB_GetBinValue($(db), "$(name)", 0, NULL, 0, &vlen);
+ if (v && vlen) {
+ uint8_t *dest;
+
+ dest=(uint8_t*) malloc(vlen);
+ memmove(dest, v, vlen);
+ $(dst).pointer=dest;
+ $(dst).length=vlen;
+ }
+ }
</code>
</codedef>
@@ -87,6 +162,12 @@
<codedef id="toObject">
<code>
+ {
+ if ($(src).length && $(src).pointer)
+ $(retval)=AQDB_Object_SetField($(db), $(fieldId), $(src).pointer, $(src).length);
+ else
+ $(retval)=AQDB_Object_SetField($(db), $(fieldId), NULL, 0);
+ }
</code>
</codedef>
@@ -94,6 +175,24 @@
<codedef id="fromObject">
<code>
+ {
+ uint8_t *data=NULL;
+ uint32_t len=0;
+ int rv;
+
+ rv=AQDB_Object_GetField($(db), $(fieldId), &data, &len);
+ if (rv < 0) {
+ $(retval)=rv;
+ }
+ else {
+ uint8_t *dest;
+
+ dest=(uint8_t*) malloc(len);
+ memmove(dest, data, len);
+ $(dst).pointer=dest;
+ $(dst).length=len;
+ }
+ }
</code>
</codedef>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/gwen_stringlist2.tm2 new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/gwen_stringlist2.tm2
--- old/gwenhywfar-4.7.0beta/tools/typemaker2/types/c/gwen_stringlist2.tm2 1970-01-01 01:00:00.000000000 +0100
+++ new/gwenhywfar-4.8.0beta/tools/typemaker2/types/c/gwen_stringlist2.tm2 2013-09-21 17:54:12.000000000 +0200
@@ -0,0 +1,140 @@
+<?xml?>
+
+<tm2>
+
+ <typedef id="gwen_stringlist2" type="pointer" lang="c" >
+ <identifier>GWEN_STRINGLIST2</identifier>
+ <aqdb_type>AQDB_DataType_String</aqdb_type>
+
+
+ <codedefs>
+
+ <codedef id="construct">
+ <code>
+ $(dst)=$(preset);
+ </code>
+ </codedef>
+
+ <codedef id="destruct">
+ <code>
+ GWEN_StringList2_free($(src));
+ </code>
+ </codedef>
+
+ <codedef id="assign">
+ <code>
+ $(dst)=$(src);
+ </code>
+ </codedef>
+
+ <codedef id="dup">
+ <code>
+ $(dst)=GWEN_StringList2_dup($(src));
+ </code>
+ </codedef>
+
+ <codedef id="compare">
+ <code>
+ <!-- TODO -->
+ $(retval)=0;
+ </code>
+ </codedef>
+
+ <codedef id="toXml">
+ <!-- !attribute -->
+ <memberFlagsMask> attribute</memberFlagsMask>
+ <memberFlagsValue> </memberFlagsValue>
+ <code>
+ if ($(src)){
+ GWEN_XMLNODE *n;
+
+ n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "$(name)");
+ GWEN_StringList2_toXml($(src), n);
+ GWEN_XMLNode_AddChild($(db), n);
+ }
+ </code>
+ </codedef>
+
+ <codedef id="fromXml">
+ <!-- !attribute -->
+ <memberFlagsMask> attribute</memberFlagsMask>
+ <memberFlagsValue> </memberFlagsValue>
+ <code>
+ {
+ GWEN_XMLNODE *n;
+
+ n=GWEN_XMLNode_FindFirstTag($(db), "$(name)", 0, 0);
+ if(n) {
+ $(dst)=GWEN_StringList2_fromXml(n, GWEN_StringList2_IntertMode_AlwaysAdd);
+ }
+ else
+ $(dst)=NULL;
+ }
+ </code>
+ </codedef>
+
+
+
+ <codedef id="toDb">
+ <code>
+ if ($(src)){
+ $(retval)=GWEN_StringList2_toDb($(src), $(db), "$(name)");
+ }
+ else {
+ GWEN_DB_DeleteVar($(db), "$(name)");
+ $(retval)=0;
+ }
+ </code>
+ </codedef>
+
+
+
+ <codedef id="fromDb">
+ <code>
+ {
+ $(dst)=GWEN_StringList2_fromDb($(db), "$(name)", GWEN_StringList2_IntertMode_AlwaysAdd);
+ }
+ </code>
+ </codedef>
+
+
+
+ <codedef id="toObject">
+ <code>
+ #error "Not implemented"
+ </code>
+ </codedef>
+
+
+
+ <codedef id="fromObject">
+ <code>
+ #error "Not implemented"
+ </code>
+ </codedef>
+
+
+
+ <codedef id="toHashString">
+ <code>
+ #error "Not implemented"
+ </code>
+ </codedef>
+
+ </codedefs>
+
+
+
+ <defaults>
+ <!-- defaults flags etc for member declarations of this type -->
+ <default>NULL</default>
+ <preset>NULL</preset>
+ <flags>own</flags>
+ <setflags>assign</setflags>
+ <getflags>none</getflags>
+ <dupflags>const</dupflags>
+ </defaults>
+
+ </typedef>
+
+</tm2>
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package btrfsprogs for openSUSE:Factory checked in at 2013-11-01 17:41:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/btrfsprogs (Old)
and /work/SRC/openSUSE:Factory/.btrfsprogs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "btrfsprogs"
Changes:
--------
--- /work/SRC/openSUSE:Factory/btrfsprogs/btrfsprogs.changes 2013-10-09 23:47:33.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.btrfsprogs.new/btrfsprogs.changes 2013-11-01 17:41:12.000000000 +0100
@@ -1,0 +2,21 @@
+Thu Oct 31 01:05:56 CET 2013 - dsterba(a)suse.cz
+
+- fsck updates
+- more mkfs sanity checks
+- qgroup rescan wait
+- Added patches:
+ * 0050-Btrfs-progs-commit-the-csum_root-if-we-do-init-csum-.patch
+ * 0051-btrfs-progs-Fix-getopt-on-arm-ppc-platforms.patch
+ * 0052-btrfs-progs-fix-duplicate-__-su-typedefs-on-ppc64.patch
+ * 0053-btrfs-progs-use-reentrant-localtime.patch
+ * 0054-btrfs-progs-don-t-have-to-report-ENOMEDIUM-error-dur.patch
+ * 0055-Btrfs-progs-added-btrfs-quota-rescan-w-switch-wait.patch
+ * 0056-btrfs-progs-fix-qgroup-realloc-inheritance.patch
+ * 0057-Btrfs-progs-fix-restore-command-leaving-corrupted-fi.patch
+ * 0058-btrfs-progs-avoid-write-to-the-disk-before-sure-to-c.patch
+ * 0059-btrfs-progs-error-if-device-for-mkfs-is-too-small.patch
+ * 0060-btrfs-progs-error-if-device-have-no-space-to-make-pr.patch
+ * 0061-btrfs-progs-calculate-available-blocks-on-device-pro.patch
+ * 0062-Btrfs-progs-keep-track-of-transid-failures-and-fix-t.patch
+
+-------------------------------------------------------------------
New:
----
0050-Btrfs-progs-commit-the-csum_root-if-we-do-init-csum-.patch
0051-btrfs-progs-Fix-getopt-on-arm-ppc-platforms.patch
0052-btrfs-progs-fix-duplicate-__-su-typedefs-on-ppc64.patch
0053-btrfs-progs-use-reentrant-localtime.patch
0054-btrfs-progs-don-t-have-to-report-ENOMEDIUM-error-dur.patch
0055-Btrfs-progs-added-btrfs-quota-rescan-w-switch-wait.patch
0056-btrfs-progs-fix-qgroup-realloc-inheritance.patch
0057-Btrfs-progs-fix-restore-command-leaving-corrupted-fi.patch
0058-btrfs-progs-avoid-write-to-the-disk-before-sure-to-c.patch
0059-btrfs-progs-error-if-device-for-mkfs-is-too-small.patch
0060-btrfs-progs-error-if-device-have-no-space-to-make-pr.patch
0061-btrfs-progs-calculate-available-blocks-on-device-pro.patch
0062-Btrfs-progs-keep-track-of-transid-failures-and-fix-t.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ btrfsprogs.spec ++++++
--- /var/tmp/diff_new_pack.PkrSMA/_old 2013-11-01 17:41:13.000000000 +0100
+++ /var/tmp/diff_new_pack.PkrSMA/_new 2013-11-01 17:41:13.000000000 +0100
@@ -35,6 +35,19 @@
Patch12: 0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch
Patch40: 0040-btrfs-progs-fix-loop-device-mount-checks.patch
Patch1: btrfs-progs-mkfs-default-extref.diff
+Patch50: 0050-Btrfs-progs-commit-the-csum_root-if-we-do-init-csum-.patch
+Patch51: 0051-btrfs-progs-Fix-getopt-on-arm-ppc-platforms.patch
+Patch52: 0052-btrfs-progs-fix-duplicate-__-su-typedefs-on-ppc64.patch
+Patch53: 0053-btrfs-progs-use-reentrant-localtime.patch
+Patch54: 0054-btrfs-progs-don-t-have-to-report-ENOMEDIUM-error-dur.patch
+Patch55: 0055-Btrfs-progs-added-btrfs-quota-rescan-w-switch-wait.patch
+Patch56: 0056-btrfs-progs-fix-qgroup-realloc-inheritance.patch
+Patch57: 0057-Btrfs-progs-fix-restore-command-leaving-corrupted-fi.patch
+Patch58: 0058-btrfs-progs-avoid-write-to-the-disk-before-sure-to-c.patch
+Patch59: 0059-btrfs-progs-error-if-device-for-mkfs-is-too-small.patch
+Patch60: 0060-btrfs-progs-error-if-device-have-no-space-to-make-pr.patch
+Patch61: 0061-btrfs-progs-calculate-available-blocks-on-device-pro.patch
+Patch62: 0062-Btrfs-progs-keep-track-of-transid-failures-and-fix-t.patch
Patch1000: local-version-override.patch
Patch1001: btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
Patch1002: btrfs-progs-add-man-page-for-btrfs-convert.patch
@@ -83,6 +96,19 @@
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
+%patch50 -p1
+%patch51 -p1
+%patch52 -p1
+%patch53 -p1
+%patch54 -p1
+%patch55 -p1
+%patch56 -p1
+%patch57 -p1
+%patch58 -p1
+%patch59 -p1
+%patch60 -p1
+%patch61 -p1
+%patch62 -p1
%build
make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \
++++++ 0050-Btrfs-progs-commit-the-csum_root-if-we-do-init-csum-.patch ++++++
>From bdccfd46b1f2ff668351790db42e8831ca4ec4b4 Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik(a)fusionio.com>
Date: Fri, 14 Jun 2013 14:25:54 -0400
Subject: [PATCH 50/62] Btrfs-progs: commit the csum_root if we do
--init-csum-tree
This is just an oddity with the commit stuff in btrfs-progs. It will just
update the generation of the root you call with, which in btrfsck case would
have been the fs_root. But because we didn't actually update the fs_root we
wouldn't have cow'ed the fs root and therefore the generation will not match the
node which will make the file system unmountable. Fix this by calling with the
csum_root which is the one we're messing with. Thanks,
Signed-off-by: Josef Bacik <jbacik(a)fusionio.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
cmds-check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 8015288318a2..dbb41e5a4d5b 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -5800,7 +5800,7 @@ int cmd_check(int argc, char **argv)
return -EIO;
}
- ret = btrfs_commit_transaction(trans, root);
+ ret = btrfs_commit_transaction(trans, info->csum_root);
if (ret)
exit(1);
goto out;
--
1.8.3.1
++++++ 0051-btrfs-progs-Fix-getopt-on-arm-ppc-platforms.patch ++++++
>From 892bfedb24519d95dbe3d5cdc44d26adbc1c93dc Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba(a)suse.cz>
Date: Tue, 9 Jul 2013 18:38:29 +0200
Subject: [PATCH 51/62] btrfs-progs: Fix getopt on arm/ppc platforms
(same as commit bb0eabc383e9a3fde7cdb02591ca88243f3e31fb)
There, 'char' is unsigned, so once assigned '-1' from getopt, it gets
the value 255. Then, it compared to '-1' gives false.
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
btrfs-crc.c | 2 +-
cmds-device.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/btrfs-crc.c b/btrfs-crc.c
index e4cda4312700..1990534ad4d2 100644
--- a/btrfs-crc.c
+++ b/btrfs-crc.c
@@ -34,7 +34,7 @@ void usage(void)
int main(int argc, char **argv)
{
- char c;
+ int c;
unsigned long checksum = 0;
char *str;
char *buf;
diff --git a/cmds-device.c b/cmds-device.c
index 41e79d375ce4..9e7328b20a55 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -294,7 +294,7 @@ static int cmd_dev_stats(int argc, char **argv)
int ret;
int fdmnt;
int i;
- char c;
+ int c;
int err = 0;
__u64 flags = 0;
--
1.8.3.1
++++++ 0052-btrfs-progs-fix-duplicate-__-su-typedefs-on-ppc64.patch ++++++
>From 2fdbfac178348ec229db866bccec8dd0f23738ab Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek(a)suse.cz>
Date: Tue, 9 Jul 2013 18:38:46 +0200
Subject: [PATCH 52/62] btrfs-progs: fix duplicate __[su]* typedefs on ppc64
The <ext2fs/ext2_types.h> header does attempt to avoid conflicts with
<linux/types.h>, but on ppc64, <asm-generic/int-ll64.h> gets somehow
included by other headers.
Include <linux/types.h> explicitly, so that <ext2fs/ext2_types.h>
notices it. The proper fix would be to fix <ext2fs/ext2_types.h> to not
use its own typedefs.
Originally observed in btrfs-convert, put the include into kerncompat.h
to avoid future problems.
Signed-off-by: Michal Marek <mmarek(a)suse.cz>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
kerncompat.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/kerncompat.h b/kerncompat.h
index 9c116b4fe841..6584818d0af3 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -26,6 +26,7 @@
#include <endian.h>
#include <byteswap.h>
#include <assert.h>
+#include <linux/types.h>
#ifndef READ
#define READ 0
--
1.8.3.1
++++++ 0053-btrfs-progs-use-reentrant-localtime.patch ++++++
>From 2fac6f99128560c5993a02d2de0cc3d8238f3b51 Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba(a)suse.cz>
Date: Tue, 9 Jul 2013 18:39:24 +0200
Subject: [PATCH 53/62] btrfs-progs: use reentrant localtime
localtime may return NULL (when an error is detected eg. after setting
tzname), followed by a segfault when the values is about to be used.
localtime_r works, does not set tzname and does not return NULL.
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
btrfs-list.c | 10 ++++++----
cmds-subvolume.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/btrfs-list.c b/btrfs-list.c
index 4fab85882165..ea80bfeef2f1 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1337,10 +1337,12 @@ static void print_subvolume_column(struct root_info *subv,
printf("%llu", subv->top_id);
break;
case BTRFS_LIST_OTIME:
- if (subv->otime)
- strftime(tstr, 256, "%Y-%m-%d %X",
- localtime(&subv->otime));
- else
+ if (subv->otime) {
+ struct tm tm;
+
+ localtime_r(&subv->otime, &tm);
+ strftime(tstr, 256, "%Y-%m-%d %X", &tm);
+ } else
strcpy(tstr, "-");
printf("%s", tstr);
break;
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index ccb476274240..faf05cab2ad9 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -898,10 +898,12 @@ static int cmd_subvol_show(int argc, char **argv)
uuid_unparse(get_ri.puuid, uuidparse);
printf("\tParent uuid: \t\t%s\n", uuidparse);
- if (get_ri.otime)
- strftime(tstr, 256, "%Y-%m-%d %X",
- localtime(&get_ri.otime));
- else
+ if (get_ri.otime) {
+ struct tm tm;
+
+ localtime_r(&get_ri.otime, &tm);
+ strftime(tstr, 256, "%Y-%m-%d %X", &tm);
+ } else
strcpy(tstr, "-");
printf("\tCreation time: \t\t%s\n", tstr);
--
1.8.3.1
++++++ 0054-btrfs-progs-don-t-have-to-report-ENOMEDIUM-error-dur.patch ++++++
>From 3b167f3ea4e8b8ea292326924653d8862114626e Mon Sep 17 00:00:00 2001
From: Anand Jain <anand.jain(a)oracle.com>
Date: Fri, 26 Jul 2013 01:35:30 +0800
Subject: [PATCH 54/62] btrfs-progs: don't have to report ENOMEDIUM error
during open
when we scan /proc/partitions the cdrom is scanned
as well, and we don't have to report ENOMEDIUM errors
against it.
Signed-off-by: Anand Jain <anand.jain(a)oracle.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
utils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/utils.c b/utils.c
index be0bfd5ecac2..6c1a96f2032f 100644
--- a/utils.c
+++ b/utils.c
@@ -1414,8 +1414,9 @@ scan_again:
fd = open(fullpath, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "failed to open %s: %s\n",
- fullpath, strerror(errno));
+ if (errno != ENOMEDIUM)
+ fprintf(stderr, "failed to open %s: %s\n",
+ fullpath, strerror(errno));
continue;
}
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
--
1.8.3.1
++++++ 0055-Btrfs-progs-added-btrfs-quota-rescan-w-switch-wait.patch ++++++
>From d74078b9e01ad6eab5ba4d951917c29a70e7be18 Mon Sep 17 00:00:00 2001
From: Jan Schmidt <list.btrfs(a)jan-o-sch.net>
Date: Mon, 6 May 2013 21:15:18 +0200
Subject: [PATCH 55/62] Btrfs-progs: added "btrfs quota rescan" -w switch
(wait)
With -w one can wait for a rescan operation to finish. It can be used when
starting a rescan operation or later to wait for the currently running
rescan operation to finish. Waiting is interruptible.
Signed-off-by: Jan Schmidt <list.btrfs(a)jan-o-sch.net>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
cmds-quota.c | 19 +++++++++++++++++--
ioctl.h | 1 +
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/cmds-quota.c b/cmds-quota.c
index 2e2971a41df7..af98d6e71570 100644
--- a/cmds-quota.c
+++ b/cmds-quota.c
@@ -93,10 +93,11 @@ static int cmd_quota_disable(int argc, char **argv)
}
static const char * const cmd_quota_rescan_usage[] = {
- "btrfs quota rescan [-s] <path>",
+ "btrfs quota rescan [-sw] <path>",
"Trash all qgroup numbers and scan the metadata again with the current config.",
"",
"-s show status of a running rescan operation",
+ "-w wait for rescan operation to finish (can be already in progress)",
NULL
};
@@ -108,21 +109,30 @@ static int cmd_quota_rescan(int argc, char **argv)
char *path = NULL;
struct btrfs_ioctl_quota_rescan_args args;
int ioctlnum = BTRFS_IOC_QUOTA_RESCAN;
+ int wait_for_completion = 0;
optind = 1;
while (1) {
- int c = getopt(argc, argv, "s");
+ int c = getopt(argc, argv, "sw");
if (c < 0)
break;
switch (c) {
case 's':
ioctlnum = BTRFS_IOC_QUOTA_RESCAN_STATUS;
break;
+ case 'w':
+ wait_for_completion = 1;
+ break;
default:
usage(cmd_quota_rescan_usage);
}
}
+ if (ioctlnum != BTRFS_IOC_QUOTA_RESCAN && wait_for_completion) {
+ fprintf(stderr, "ERROR: -w cannot be used with -s\n");
+ return 12;
+ }
+
if (check_argc_exact(argc - optind, 1))
usage(cmd_quota_rescan_usage);
@@ -137,6 +147,11 @@ static int cmd_quota_rescan(int argc, char **argv)
ret = ioctl(fd, ioctlnum, &args);
e = errno;
+
+ if (wait_for_completion && (ret == 0 || e == EINPROGRESS)) {
+ ret = ioctl(fd, BTRFS_IOC_QUOTA_RESCAN_WAIT, &args);
+ e = errno;
+ }
close(fd);
if (ioctlnum == BTRFS_IOC_QUOTA_RESCAN) {
diff --git a/ioctl.h b/ioctl.h
index abe6dd4234d9..c260bbf6b4bb 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -529,6 +529,7 @@ struct btrfs_ioctl_clone_range_args {
struct btrfs_ioctl_quota_rescan_args)
#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
struct btrfs_ioctl_quota_rescan_args)
+#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
char[BTRFS_LABEL_SIZE])
#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
--
1.8.3.1
++++++ 0056-btrfs-progs-fix-qgroup-realloc-inheritance.patch ++++++
>From 85a8cc9ecfb9b61c5feaaf3ba861f27a2501691d Mon Sep 17 00:00:00 2001
From: Zach Brown <zab(a)redhat.com>
Date: Wed, 14 Aug 2013 16:16:40 -0700
Subject: [PATCH 56/62] btrfs-progs: fix qgroup realloc inheritance
qgroup.c:82:23: warning: memcpy with byte count of 0
qgroup.c:83:23: warning: memcpy with byte count of 0
The inheritance wasn't copying qgroups[] because a confused sizeof()
gave 0 byte memcpy()s. It's been like this for the year since it was
merged, so I guess this isn't a very important thing to do :).
Signed-off-by: Zach Brown <zab(a)redhat.com>
Reviewed-by: Arne Jansen <sensille(a)gmx.net>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
qgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qgroup.c b/qgroup.c
index dafde12becf6..e860b309e77c 100644
--- a/qgroup.c
+++ b/qgroup.c
@@ -74,7 +74,7 @@ int qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int n,
if (*inherit) {
struct btrfs_qgroup_inherit *i = *inherit;
- int s = sizeof(out->qgroups);
+ int s = sizeof(out->qgroups[0]);
out->num_qgroups = i->num_qgroups;
out->num_ref_copies = i->num_ref_copies;
--
1.8.3.1
++++++ 0057-Btrfs-progs-fix-restore-command-leaving-corrupted-fi.patch ++++++
>From 18d8ff57c3cd9ee31829b19fcd6ca57ed201720a Mon Sep 17 00:00:00 2001
From: Filipe David Borba Manana <fdmanana(a)gmail.com>
Date: Tue, 3 Sep 2013 12:19:58 +0100
Subject: [PATCH 57/62] Btrfs-progs: fix restore command leaving corrupted
files
When there are files that have parts shared with snapshots, the
restore command was incorrectly restoring them, as it was not
taking into account the offset and number of bytes fields from
the file extent item. Besides leaving the recovered file corrupt,
it was also inneficient as it read and wrote more data than needed
(with each extent copy overwriting portions of the one previously
written).
The following steps show how to reproduce this corruption issue:
$ mkfs.btrfs -f /dev/sdb3
$ mount /dev/sdb3 /mnt/btrfs
$ perl -e '$d = "\x41" . ("\x00" x (1024*1024+349)); open($f,">","/mnt/btrfs/foobar"); print $f $d; close($f);'
$ du -b /mnt/btrfs/foobar
1048926 /mnt/btrfs/foobar
$ md5sum /mnt/btrfs/foobar
f9f778f3a7410c40e4ed104a3a63c3c4 /mnt/btrfs/foobar
$ btrfs subvolume snapshot /mnt/btrfs /mnt/btrfs/my_snap
$ perl -e 'open($f, "+<", "/mnt/btrfs/foobar"); seek($f, 4096, 0); print $f "\xff"; close($f);'
$ md5sum /mnt/btrfs/foobar
b983fcefd4622a03a78936484c40272b /mnt/btrfs/foobar
$ umount /mnt/btrfs
$ btrfs restore /dev/sdb3 /tmp/copy
$ du -b /tmp/copy/foobar
1048926 /tmp/copy/foobar
$ md5sum /tmp/copy/foobar
88db338cbc1c44dfabae083f1ce642d5 /tmp/copy/foobar
$ od -t x1 -j 8192 -N 4 /tmp/copy/foobar
0020000 41 00 00 00
0020004
$ mount /dev/sdb3 /mnt/btrfs
$ od -t x1 -j 8192 -N 4 /mnt/btrfs/foobar
0020000 00 00 00 00
0020004
$ md5sum /mnt/btrfs/foobar
b983fcefd4622a03a78936484c40272b /mnt/btrfs/foobar
Tested this change with zlib, lzo compression and file sizes larger
than 1GiB, and found no regression or other corruption issues (so far
at least).
Signed-off-by: Filipe David Borba Manana <fdmanana(a)gmail.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
cmds-restore.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/cmds-restore.c b/cmds-restore.c
index e48df40320f6..9688599742d9 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -272,6 +272,7 @@ static int copy_one_extent(struct btrfs_root *root, int fd,
u64 bytenr;
u64 ram_size;
u64 disk_size;
+ u64 num_bytes;
u64 length;
u64 size_left;
u64 dev_bytenr;
@@ -288,7 +289,9 @@ static int copy_one_extent(struct btrfs_root *root, int fd,
disk_size = btrfs_file_extent_disk_num_bytes(leaf, fi);
ram_size = btrfs_file_extent_ram_bytes(leaf, fi);
offset = btrfs_file_extent_offset(leaf, fi);
- size_left = disk_size;
+ num_bytes = btrfs_file_extent_num_bytes(leaf, fi);
+ size_left = num_bytes;
+ bytenr += offset;
if (offset)
printf("offset is %Lu\n", offset);
@@ -296,7 +299,7 @@ static int copy_one_extent(struct btrfs_root *root, int fd,
if (disk_size == 0)
return 0;
- inbuf = malloc(disk_size);
+ inbuf = malloc(size_left);
if (!inbuf) {
fprintf(stderr, "No memory\n");
return -1;
@@ -351,8 +354,8 @@ again:
goto again;
if (compress == BTRFS_COMPRESS_NONE) {
- while (total < ram_size) {
- done = pwrite(fd, inbuf+total, ram_size-total,
+ while (total < num_bytes) {
+ done = pwrite(fd, inbuf+total, num_bytes-total,
pos+total);
if (done < 0) {
ret = -1;
@@ -365,7 +368,7 @@ again:
goto out;
}
- ret = decompress(inbuf, outbuf, disk_size, &ram_size, compress);
+ ret = decompress(inbuf, outbuf, num_bytes, &ram_size, compress);
if (ret) {
num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
bytenr, length);
--
1.8.3.1
++++++ 0058-btrfs-progs-avoid-write-to-the-disk-before-sure-to-c.patch ++++++
>From 6620f2caf5b50c28737eff1b522c22c153f9b1fa Mon Sep 17 00:00:00 2001
From: Anand Jain <anand.jain(a)oracle.com>
Date: Wed, 7 Aug 2013 20:11:25 +0800
Subject: [PATCH 58/62] btrfs-progs: avoid write to the disk before sure to
create fs
This patch provides fix for the following bug,
When mkfs.btrfs fails the disks shouldn't be written.
------------
btrfs fi show /dev/sdb
Label: none uuid: 60fb76f4-3b4d-4632-a7da-6a44dea5573d
Total devices 1 FS bytes used 24.00KiB
devid 1 size 2.00GiB used 20.00MiB path /dev/sdb
mkfs.btrfs -dsingle -mraid1 /dev/sdb -f
::
unable to create FS with metadata profile 16 (have 1 devices)
btrfs fi show /dev/sdb
Label: none uuid: 2da2179d-ecb1-4a4e-a44d-e7613a08c18d
Total devices 1 FS bytes used 24.00KiB
devid 1 size 2.00GiB used 20.00MiB path /dev/sdb
-------------
Signed-off-by: Anand Jain <anand.jain(a)oracle.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
mkfs.c | 104 +++++++++++++++++++++++++---------------------------------------
utils.c | 41 +++++++++++++++++++++++++
utils.h | 2 ++
3 files changed, 84 insertions(+), 63 deletions(-)
diff --git a/mkfs.c b/mkfs.c
index 26be20df90d9..8a68f8a9f762 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -195,83 +195,28 @@ static int create_raid_groups(struct btrfs_trans_handle *trans,
int metadata_profile_opt, int mixed, int ssd)
{
u64 num_devices = btrfs_super_num_devices(root->fs_info->super_copy);
- u64 allowed = 0;
- u64 devices_for_raid = num_devices;
int ret;
- /*
- * Set default profiles according to number of added devices.
- * For mixed groups defaults are single/single.
- */
- if (!metadata_profile_opt && !mixed) {
- if (num_devices == 1 && ssd)
- printf("Detected a SSD, turning off metadata "
- "duplication. Mkfs with -m dup if you want to "
- "force metadata duplication.\n");
- metadata_profile = (num_devices > 1) ?
- BTRFS_BLOCK_GROUP_RAID1 : (ssd) ? 0: BTRFS_BLOCK_GROUP_DUP;
- }
- if (!data_profile_opt && !mixed) {
- data_profile = (num_devices > 1) ?
- BTRFS_BLOCK_GROUP_RAID0 : 0; /* raid0 or single */
- }
-
- if (devices_for_raid > 4)
- devices_for_raid = 4;
-
- switch (devices_for_raid) {
- default:
- case 4:
- allowed |= BTRFS_BLOCK_GROUP_RAID10;
- case 3:
- allowed |= BTRFS_BLOCK_GROUP_RAID6;
- case 2:
- allowed |= BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
- BTRFS_BLOCK_GROUP_RAID5;
- break;
- case 1:
- allowed |= BTRFS_BLOCK_GROUP_DUP;
- }
-
- if (metadata_profile & ~allowed) {
- fprintf(stderr, "unable to create FS with metadata "
- "profile %llu (have %llu devices)\n", metadata_profile,
- num_devices);
- exit(1);
- }
- if (data_profile & ~allowed) {
- fprintf(stderr, "unable to create FS with data "
- "profile %llu (have %llu devices)\n", data_profile,
- num_devices);
- exit(1);
- }
-
- /* allow dup'ed data chunks only in mixed mode */
- if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) {
- fprintf(stderr, "dup for data is allowed only in mixed mode\n");
- exit(1);
- }
-
- if (allowed & metadata_profile) {
+ if (metadata_profile) {
u64 meta_flags = BTRFS_BLOCK_GROUP_METADATA;
ret = create_one_raid_group(trans, root,
BTRFS_BLOCK_GROUP_SYSTEM |
- (allowed & metadata_profile));
+ metadata_profile);
BUG_ON(ret);
if (mixed)
meta_flags |= BTRFS_BLOCK_GROUP_DATA;
ret = create_one_raid_group(trans, root, meta_flags |
- (allowed & metadata_profile));
+ metadata_profile);
BUG_ON(ret);
}
- if (!mixed && num_devices > 1 && (allowed & data_profile)) {
+ if (!mixed && num_devices > 1 && data_profile) {
ret = create_one_raid_group(trans, root,
BTRFS_BLOCK_GROUP_DATA |
- (allowed & data_profile));
+ data_profile);
BUG_ON(ret);
}
recow_roots(trans, root);
@@ -1362,14 +1307,48 @@ int main(int ac, char **av)
}
}
- /* if we are here that means all devs are good to btrfsify */
optind = saved_optind;
dev_cnt = ac - optind;
+ file = av[optind++];
+ ssd = is_ssd(file);
+
+ /*
+ * Set default profiles according to number of added devices.
+ * For mixed groups defaults are single/single.
+ */
+ if (!mixed) {
+ if (!metadata_profile_opt) {
+ if (dev_cnt == 1 && ssd)
+ printf("Detected a SSD, turning off metadata "
+ "duplication. Mkfs with -m dup if you want to "
+ "force metadata duplication.\n");
+
+ metadata_profile = (dev_cnt > 1) ?
+ BTRFS_BLOCK_GROUP_RAID1 : (ssd) ?
+ 0: BTRFS_BLOCK_GROUP_DUP;
+ }
+ if (!data_profile_opt) {
+ data_profile = (dev_cnt > 1) ?
+ BTRFS_BLOCK_GROUP_RAID0 : 0; /* raid0 or single */
+ }
+ } else {
+ /* this is not needed but just for completeness */
+ metadata_profile = 0;
+ data_profile = 0;
+ }
+
+ ret = test_num_disk_vs_raid(metadata_profile, data_profile,
+ dev_cnt, mixed, estr);
+ if (ret) {
+ fprintf(stderr, "Error: %s\n", estr);
+ exit(1);
+ }
+
+ /* if we are here that means all devs are good to btrfsify */
printf("\nWARNING! - %s IS EXPERIMENTAL\n", BTRFS_BUILD_VERSION);
printf("WARNING! - see http://btrfs.wiki.kernel.org before using\n\n");
- file = av[optind++];
dev_cnt--;
if (!source_dir_set) {
@@ -1412,7 +1391,6 @@ int main(int ac, char **av)
dev_block_count = block_count;
}
- ssd = is_ssd(file);
if (mixed) {
if (metadata_profile != data_profile) {
diff --git a/utils.c b/utils.c
index 6c1a96f2032f..b2c6a06ffaa5 100644
--- a/utils.c
+++ b/utils.c
@@ -1766,6 +1766,47 @@ out:
return ret;
}
+int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
+ u64 dev_cnt, int mixed, char *estr)
+{
+ size_t sz = 100;
+ u64 allowed = 0;
+
+ switch (dev_cnt) {
+ default:
+ case 4:
+ allowed |= BTRFS_BLOCK_GROUP_RAID10;
+ case 3:
+ allowed |= BTRFS_BLOCK_GROUP_RAID6;
+ case 2:
+ allowed |= BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
+ BTRFS_BLOCK_GROUP_RAID5;
+ break;
+ case 1:
+ allowed |= BTRFS_BLOCK_GROUP_DUP;
+ }
+
+ if (metadata_profile & ~allowed) {
+ snprintf(estr, sz, "unable to create FS with metadata "
+ "profile %llu (have %llu devices)\n",
+ metadata_profile, dev_cnt);
+ return 1;
+ }
+ if (data_profile & ~allowed) {
+ snprintf(estr, sz, "unable to create FS with data "
+ "profile %llu (have %llu devices)\n",
+ metadata_profile, dev_cnt);
+ return 1;
+ }
+
+ if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) {
+ snprintf(estr, sz,
+ "dup for data is allowed only in mixed mode");
+ return 1;
+ }
+ return 0;
+}
+
/* Check if disk is suitable for btrfs
* returns:
* 1: something is wrong, estr provides the error
diff --git a/utils.h b/utils.h
index 3c17e14b79cd..720601723413 100644
--- a/utils.h
+++ b/utils.h
@@ -65,5 +65,7 @@ u64 btrfs_device_size(int fd, struct stat *st);
/* Helper to always get proper size of the destination string */
#define strncpy_null(dest, src) __strncpy__null(dest, src, sizeof(dest))
int test_dev_for_mkfs(char *file, int force_overwrite, char *estr);
+int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
+ u64 dev_cnt, int mixed, char *estr);
#endif
--
1.8.3.1
++++++ 0059-btrfs-progs-error-if-device-for-mkfs-is-too-small.patch ++++++
>From 684d9a33f77967a9b50b597cece1b2b2e29d2b8d Mon Sep 17 00:00:00 2001
From: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Date: Thu, 5 Sep 2013 15:53:34 +0900
Subject: [PATCH 59/62] btrfs-progs: error if device for mkfs is too small
Eric pointed out that mkfs abort if specified volume is too small:
# truncate --size=2m testfile
# ./mkfs.btrfs testfile
:
SMALL VOLUME: forcing mixed metadata/data groups
mkfs.btrfs: volumes.c:852: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted (core dumped)
As the first step to fix problems around there, let mkfs to report
error if the size of target volume is less than the size of the first
system block group, BTRFS_MKFS_SYSTEM_GROUP_SIZE (= 4MB).
Reported-by: Eric Sandeen <sandeen(a)redhat.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
mkfs.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mkfs.c b/mkfs.c
index 8a68f8a9f762..9a017c1dc95b 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1400,6 +1400,12 @@ int main(int ac, char **av)
}
}
+ /* To create the first block group and chunk 0 in make_btrfs */
+ if (dev_block_count < BTRFS_MKFS_SYSTEM_GROUP_SIZE) {
+ fprintf(stderr, "device is too small to make filesystem\n");
+ exit(1);
+ }
+
blocks[0] = BTRFS_SUPER_INFO_OFFSET;
for (i = 1; i < 7; i++) {
blocks[i] = BTRFS_SUPER_INFO_OFFSET + 1024 * 1024 +
--
1.8.3.1
++++++ 0060-btrfs-progs-error-if-device-have-no-space-to-make-pr.patch ++++++
>From b11f9613e3b0be7e4b560419a4fec7d7d7264664 Mon Sep 17 00:00:00 2001
From: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Date: Thu, 5 Sep 2013 15:55:08 +0900
Subject: [PATCH 60/62] btrfs-progs: error if device have no space to make
primary chunks
The previous patch works fine if the size of specified volume to mkfs
is less than 4MB. However usually btrfs requires more than 4MB to work,
and the minimum preferred size is depending on the raid setting etc.
This patch let mkfs print error message if it cannot allocate one of
chunks should be there at first.
[before]
# truncate --size=4500K testfile
# ./mkfs.btrfs -f testfile
:
SMALL VOLUME: forcing mixed metadata/data groups
mkfs.btrfs: mkfs.c:84: make_root_dir: Assertion `!(ret)' failed.
Aborted (core dumped)
[After]
# truncate --size=4500K testfile
# ./mkfs.btrfs -f testfile
:
SMALL VOLUME: forcing mixed metadata/data groups
no space to alloc data/metadata chunk
failed to setup the root directory
TBD is calculate minimum size for setting and put it in the error
message to let user know how large amount of volume is required.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
mkfs.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/mkfs.c b/mkfs.c
index 9a017c1dc95b..f7105073a173 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -81,6 +81,11 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
&chunk_start, &chunk_size,
BTRFS_BLOCK_GROUP_METADATA |
BTRFS_BLOCK_GROUP_DATA);
+ if (ret == -ENOSPC) {
+ fprintf(stderr,
+ "no space to alloc data/metadata chunk\n");
+ goto err;
+ }
BUG_ON(ret);
ret = btrfs_make_block_group(trans, root, 0,
BTRFS_BLOCK_GROUP_METADATA |
@@ -93,6 +98,10 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
ret = btrfs_alloc_chunk(trans, root->fs_info->extent_root,
&chunk_start, &chunk_size,
BTRFS_BLOCK_GROUP_METADATA);
+ if (ret == -ENOSPC) {
+ fprintf(stderr, "no space to alloc metadata chunk\n");
+ goto err;
+ }
BUG_ON(ret);
ret = btrfs_make_block_group(trans, root, 0,
BTRFS_BLOCK_GROUP_METADATA,
@@ -110,6 +119,10 @@ static int make_root_dir(struct btrfs_root *root, int mixed)
ret = btrfs_alloc_chunk(trans, root->fs_info->extent_root,
&chunk_start, &chunk_size,
BTRFS_BLOCK_GROUP_DATA);
+ if (ret == -ENOSPC) {
+ fprintf(stderr, "no space to alloc data chunk\n");
+ goto err;
+ }
BUG_ON(ret);
ret = btrfs_make_block_group(trans, root, 0,
BTRFS_BLOCK_GROUP_DATA,
@@ -181,6 +194,10 @@ static int create_one_raid_group(struct btrfs_trans_handle *trans,
ret = btrfs_alloc_chunk(trans, root->fs_info->extent_root,
&chunk_start, &chunk_size, type);
+ if (ret == -ENOSPC) {
+ fprintf(stderr, "not enough free space\n");
+ exit(1);
+ }
BUG_ON(ret);
ret = btrfs_make_block_group(trans, root->fs_info->extent_root, 0,
type, BTRFS_FIRST_CHUNK_TREE_OBJECTID,
--
1.8.3.1
++++++ 0061-btrfs-progs-calculate-available-blocks-on-device-pro.patch ++++++
>From db3c0b4f365acb5ee9fa7e37d440b2ef6ff5636c Mon Sep 17 00:00:00 2001
From: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Date: Thu, 5 Sep 2013 15:57:19 +0900
Subject: [PATCH 61/62] btrfs-progs: calculate available blocks on device
properly
I found that mkfs.btrfs aborts when assigned multi volumes contain
a small volume:
# parted /dev/sdf p
Model: LSI MegaRAID SAS RMB (scsi)
Disk /dev/sdf: 72.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 72.4GB 72.4GB primary
2 72.4GB 72.8GB 461MB primary
# ./mkfs.btrfs -f /dev/sdf1 /dev/sdf2
:
SMALL VOLUME: forcing mixed metadata/data groups
adding device /dev/sdf2 id 2
mkfs.btrfs: volumes.c:852: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted (core dumped)
This failure of btrfs_alloc_chunk was caused by following steps:
1) since there is only small space in the small device, mkfs was
going to allocate a chunk from free space as much as available.
So mkfs called btrfs_alloc_chunk with
size = device->total_bytes - device->used_bytes.
2) (According to the comment in source code, to avoid overwriting
superblock,) btrfs_alloc_chunk starts taking chunks at an offset
of 1MB. It means that the layout of a disk will be like:
[[1MB at beginning for sb][allocated chunks]* ... free space ... ]
and you can see that the available free space for allocation is:
avail = device->total_bytes - device->used_bytes - 1MB.
3) Therefore there is only free space 1MB less than requested. damn.
>From further investigations I also found that this issue is easily
reproduced by using -A, --alloc-start option:
# truncate --size=1G testfile
# ./mkfs.btrfs -A900M -f testfile
:
mkfs.btrfs: volumes.c:852: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted (core dumped)
In this case there is only 100MB for allocation but btrfs_alloc_chunk
was going to allocate more than the 100MB.
The root cause of both of above troubles is a same simple bug:
btrfs_chunk_alloc does not calculate available bytes properly even
though it researches how many devices have enough room to have a
chunk to be allocated.
So this patch introduces new function btrfs_device_avail_bytes()
which returns available bytes for allocation in specified device.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi(a)jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
ctree.h | 8 +++++
volumes.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 106 insertions(+), 6 deletions(-)
diff --git a/ctree.h b/ctree.h
index 0b0d701fe679..90be7abe9ebf 100644
--- a/ctree.h
+++ b/ctree.h
@@ -811,6 +811,14 @@ struct btrfs_csum_item {
u8 csum;
} __attribute__ ((__packed__));
+/*
+ * We don't want to overwrite 1M at the beginning of device, even though
+ * there is our 1st superblock at 64k. Some possible reasons:
+ * - the first 64k blank is useful for some boot loader/manager
+ * - the first 1M could be scratched by buggy partitioner or somesuch
+ */
+#define BTRFS_BLOCK_RESERVED_1M_FOR_SUPER ((u64)1024 * 1024)
+
/* tag for the radix tree of block groups in ram */
#define BTRFS_BLOCK_GROUP_DATA (1ULL << 0)
#define BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1)
diff --git a/volumes.c b/volumes.c
index 0ff22833d6be..e8d7f258dddb 100644
--- a/volumes.c
+++ b/volumes.c
@@ -268,7 +268,7 @@ static int find_free_dev_extent(struct btrfs_trans_handle *trans,
struct btrfs_dev_extent *dev_extent = NULL;
u64 hole_size = 0;
u64 last_byte = 0;
- u64 search_start = 0;
+ u64 search_start = root->fs_info->alloc_start;
u64 search_end = device->total_bytes;
int ret;
int slot = 0;
@@ -283,10 +283,12 @@ static int find_free_dev_extent(struct btrfs_trans_handle *trans,
/* we don't want to overwrite the superblock on the drive,
* so we make sure to start at an offset of at least 1MB
*/
- search_start = max((u64)1024 * 1024, search_start);
+ search_start = max(BTRFS_BLOCK_RESERVED_1M_FOR_SUPER, search_start);
- if (root->fs_info->alloc_start + num_bytes <= device->total_bytes)
- search_start = max(root->fs_info->alloc_start, search_start);
+ if (search_start >= search_end) {
+ ret = -ENOSPC;
+ goto error;
+ }
key.objectid = device->devid;
key.offset = search_start;
@@ -660,6 +662,94 @@ static u32 find_raid56_stripe_len(u32 data_devices, u32 dev_stripe_target)
return 64 * 1024;
}
+/*
+ * btrfs_device_avail_bytes - count bytes available for alloc_chunk
+ *
+ * It is not equal to "device->total_bytes - device->bytes_used".
+ * We do not allocate any chunk in 1M at beginning of device, and not
+ * allowed to allocate any chunk before alloc_start if it is specified.
+ * So search holes from max(1M, alloc_start) to device->total_bytes.
+ */
+static int btrfs_device_avail_bytes(struct btrfs_trans_handle *trans,
+ struct btrfs_device *device,
+ u64 *avail_bytes)
+{
+ struct btrfs_path *path;
+ struct btrfs_root *root = device->dev_root;
+ struct btrfs_key key;
+ struct btrfs_dev_extent *dev_extent = NULL;
+ struct extent_buffer *l;
+ u64 search_start = root->fs_info->alloc_start;
+ u64 search_end = device->total_bytes;
+ u64 extent_end = 0;
+ u64 free_bytes = 0;
+ int ret;
+ int slot = 0;
+
+ search_start = max(BTRFS_BLOCK_RESERVED_1M_FOR_SUPER, search_start);
+
+ path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
+
+ key.objectid = device->devid;
+ key.offset = root->fs_info->alloc_start;
+ key.type = BTRFS_DEV_EXTENT_KEY;
+
+ path->reada = 2;
+ ret = btrfs_search_slot(trans, root, &key, path, 0, 0);
+ if (ret < 0)
+ goto error;
+ ret = btrfs_previous_item(root, path, 0, key.type);
+ if (ret < 0)
+ goto error;
+
+ while (1) {
+ l = path->nodes[0];
+ slot = path->slots[0];
+ if (slot >= btrfs_header_nritems(l)) {
+ ret = btrfs_next_leaf(root, path);
+ if (ret == 0)
+ continue;
+ if (ret < 0)
+ goto error;
+ break;
+ }
+ btrfs_item_key_to_cpu(l, &key, slot);
+
+ if (key.objectid < device->devid)
+ goto next;
+ if (key.objectid > device->devid)
+ break;
+ if (btrfs_key_type(&key) != BTRFS_DEV_EXTENT_KEY)
+ goto next;
+ if (key.offset > search_end)
+ break;
+ if (key.offset > search_start)
+ free_bytes += key.offset - search_start;
+
+ dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
+ extent_end = key.offset + btrfs_dev_extent_length(l,
+ dev_extent);
+ if (extent_end > search_start)
+ search_start = extent_end;
+ if (search_start > search_end)
+ break;
+next:
+ path->slots[0]++;
+ cond_resched();
+ }
+
+ if (search_start < search_end)
+ free_bytes += search_end - search_start;
+
+ *avail_bytes = free_bytes;
+ ret = 0;
+error:
+ btrfs_free_path(path);
+ return ret;
+}
+
int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
struct btrfs_root *extent_root, u64 *start,
u64 *num_bytes, u64 type)
@@ -678,7 +768,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
u64 calc_size = 8 * 1024 * 1024;
u64 min_free;
u64 max_chunk_size = 4 * calc_size;
- u64 avail;
+ u64 avail = 0;
u64 max_avail = 0;
u64 percent_max;
int num_stripes = 1;
@@ -782,7 +872,9 @@ again:
/* build a private list of devices we will allocate from */
while(index < num_stripes) {
device = list_entry(cur, struct btrfs_device, dev_list);
- avail = device->total_bytes - device->bytes_used;
+ ret = btrfs_device_avail_bytes(trans, device, &avail);
+ if (ret)
+ return ret;
cur = cur->next;
if (avail >= min_free) {
list_move_tail(&device->dev_list, &private_devs);
--
1.8.3.1
++++++ 0062-Btrfs-progs-keep-track-of-transid-failures-and-fix-t.patch ++++++
>From 174273941f266c5ba71da02cc4d71a95ca41bc20 Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik(a)fusionio.com>
Date: Tue, 1 Oct 2013 09:00:19 -0400
Subject: [PATCH 62/62] Btrfs-progs: keep track of transid failures and fix
them if possible
A user was reporting an issue with bad transid errors on his blocks. The thing
is that btrfs-progs will ignore transid failures for things like restore and
fsck so we can do a best effort to fix a users file system. So fsck can put
together a coherent view of the file system with stale blocks. So if everything
else is ok in the mind of fsck then we can recow these blocks to fix the
generation and the user can get their file system back. Thanks,
Signed-off-by: Josef Bacik <jbacik(a)fusionio.com>
Signed-off-by: David Sterba <dsterba(a)suse.cz>
Signed-off-by: Chris Mason <chris.mason(a)fusionio.com>
---
cmds-check.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ctree.c | 7 ++++++-
ctree.h | 1 +
disk-io.c | 15 +++++++++++++++
extent_io.c | 2 ++
extent_io.h | 2 ++
6 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index dbb41e5a4d5b..924aac08f350 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -5675,6 +5675,47 @@ static int reinit_extent_tree(struct btrfs_fs_info *fs_info)
return btrfs_commit_transaction(trans, fs_info->extent_root);
}
+static int recow_extent_buffer(struct btrfs_root *root, struct extent_buffer *eb)
+{
+ struct btrfs_path *path;
+ struct btrfs_trans_handle *trans;
+ struct btrfs_key key;
+ int ret;
+
+ printf("Recowing metadata block %llu\n", eb->start);
+ key.objectid = btrfs_header_owner(eb);
+ key.type = BTRFS_ROOT_ITEM_KEY;
+ key.offset = (u64)-1;
+
+ root = btrfs_read_fs_root(root->fs_info, &key);
+ if (IS_ERR(root)) {
+ fprintf(stderr, "Couldn't find owner root %llu\n",
+ key.objectid);
+ return PTR_ERR(root);
+ }
+
+ path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
+
+ trans = btrfs_start_transaction(root, 1);
+ if (IS_ERR(trans)) {
+ btrfs_free_path(path);
+ return PTR_ERR(trans);
+ }
+
+ path->lowest_level = btrfs_header_level(eb);
+ if (path->lowest_level)
+ btrfs_node_key_to_cpu(eb, &key, 0);
+ else
+ btrfs_item_key_to_cpu(eb, &key, 0);
+
+ ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
+ btrfs_commit_transaction(trans, root);
+ btrfs_free_path(path);
+ return ret;
+}
+
static struct option long_options[] = {
{ "super", 1, NULL, 's' },
{ "repair", 0, NULL, 0 },
@@ -5826,6 +5867,23 @@ int cmd_check(int argc, char **argv)
fprintf(stderr, "checking root refs\n");
ret = check_root_refs(root, &root_cache);
+ if (ret)
+ goto out;
+
+ while (repair && !list_empty(&root->fs_info->recow_ebs)) {
+ struct extent_buffer *eb;
+
+ eb = list_first_entry(&root->fs_info->recow_ebs,
+ struct extent_buffer, recow);
+ ret = recow_extent_buffer(root, eb);
+ if (ret)
+ break;
+ }
+
+ if (!list_empty(&root->fs_info->recow_ebs)) {
+ fprintf(stderr, "Transid errors in file system\n");
+ ret = 1;
+ }
out:
free_root_recs_tree(&root_cache);
close_ctree(root);
diff --git a/ctree.c b/ctree.c
index 1a4f3f06f38a..e7ccfa03fb0e 100644
--- a/ctree.c
+++ b/ctree.c
@@ -346,7 +346,8 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans,
(unsigned long)btrfs_header_fsid(cow),
BTRFS_FSID_SIZE);
- WARN_ON(btrfs_header_generation(buf) > trans->transid);
+ WARN_ON(!(buf->flags & EXTENT_BAD_TRANSID) &&
+ btrfs_header_generation(buf) > trans->transid);
update_ref_for_cow(trans, root, buf, cow);
@@ -370,6 +371,10 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans,
btrfs_free_extent(trans, root, buf->start, buf->len,
0, root->root_key.objectid, level, 1);
}
+ if (!list_empty(&buf->recow)) {
+ list_del_init(&buf->recow);
+ free_extent_buffer(buf);
+ }
free_extent_buffer(buf);
btrfs_mark_buffer_dirty(cow);
*cow_ret = cow;
diff --git a/ctree.h b/ctree.h
index 90be7abe9ebf..61cd93b91937 100644
--- a/ctree.h
+++ b/ctree.h
@@ -952,6 +952,7 @@ struct btrfs_fs_info {
struct btrfs_extent_ops *extent_ops;
struct list_head dirty_cowonly_roots;
+ struct list_head recow_ebs;
struct btrfs_fs_devices *fs_devices;
struct list_head space_info;
diff --git a/disk-io.c b/disk-io.c
index 1b91de6fc90d..d97ff8c706c9 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -180,6 +180,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
(unsigned long long)parent_transid,
(unsigned long long)btrfs_header_generation(eb));
if (ignore) {
+ eb->flags |= EXTENT_BAD_TRANSID;
printk("Ignoring transid failure\n");
return 0;
}
@@ -274,6 +275,12 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
csum_tree_block(root, eb, 1) == 0 &&
verify_parent_transid(eb->tree, eb, parent_transid, ignore)
== 0) {
+ if (eb->flags & EXTENT_BAD_TRANSID &&
+ list_empty(&eb->recow)) {
+ list_add_tail(&eb->recow,
+ &root->fs_info->recow_ebs);
+ eb->refs++;
+ }
btrfs_set_buffer_uptodate(eb);
return eb;
}
@@ -748,6 +755,7 @@ struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr)
mutex_init(&fs_info->fs_mutex);
INIT_LIST_HEAD(&fs_info->dirty_cowonly_roots);
INIT_LIST_HEAD(&fs_info->space_info);
+ INIT_LIST_HEAD(&fs_info->recow_ebs);
if (!writable)
fs_info->readonly = 1;
@@ -899,6 +907,13 @@ FREE_EXTENT_CACHE_BASED_TREE(mapping_cache, free_map_lookup);
void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info)
{
+ while (!list_empty(&fs_info->recow_ebs)) {
+ struct extent_buffer *eb;
+ eb = list_first_entry(&fs_info->recow_ebs,
+ struct extent_buffer, recow);
+ list_del_init(&eb->recow);
+ free_extent_buffer(eb);
+ }
free_mapping_cache_tree(&fs_info->mapping_tree.cache_tree);
extent_io_tree_cleanup(&fs_info->extent_cache);
extent_io_tree_cleanup(&fs_info->free_space_cache);
diff --git a/extent_io.c b/extent_io.c
index 464bd07e8d1a..398ee26b4a79 100644
--- a/extent_io.c
+++ b/extent_io.c
@@ -585,6 +585,7 @@ static struct extent_buffer *__alloc_extent_buffer(struct extent_io_tree *tree,
eb->dev_bytenr = (u64)-1;
eb->cache_node.start = bytenr;
eb->cache_node.size = blocksize;
+ INIT_LIST_HEAD(&eb->recow);
free_some_buffers(tree);
ret = insert_cache_extent(&tree->cache, &eb->cache_node);
@@ -608,6 +609,7 @@ void free_extent_buffer(struct extent_buffer *eb)
struct extent_io_tree *tree = eb->tree;
BUG_ON(eb->flags & EXTENT_DIRTY);
list_del_init(&eb->lru);
+ list_del_init(&eb->recow);
remove_cache_extent(&tree->cache, &eb->cache_node);
BUG_ON(tree->cache_size < eb->len);
tree->cache_size -= eb->len;
diff --git a/extent_io.h b/extent_io.h
index 2604dcef31e3..45080c2661ae 100644
--- a/extent_io.h
+++ b/extent_io.h
@@ -39,6 +39,7 @@
#define EXTENT_DEFRAG_DONE (1 << 7)
#define EXTENT_BUFFER_FILLED (1 << 8)
#define EXTENT_CSUM (1 << 9)
+#define EXTENT_BAD_TRANSID (1 << 10)
#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK)
#define BLOCK_GROUP_DATA EXTENT_WRITEBACK
@@ -72,6 +73,7 @@ struct extent_buffer {
u32 len;
struct extent_io_tree *tree;
struct list_head lru;
+ struct list_head recow;
int refs;
int flags;
int fd;
--
1.8.3.1
++++++ local-version-override.patch ++++++
--- /var/tmp/diff_new_pack.PkrSMA/_old 2013-11-01 17:41:13.000000000 +0100
+++ /var/tmp/diff_new_pack.PkrSMA/_new 2013-11-01 17:41:13.000000000 +0100
@@ -7,7 +7,7 @@
# Released under the GNU GPLv2
-v="v0.20-rc1"
-+v="v0.20-rc1+20130701"
++v="v0.20-rc1+20131031"
which git &> /dev/null
if [ $? == 0 -a -d .git ]; then
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package aqbanking for openSUSE:Factory checked in at 2013-11-01 17:40:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/aqbanking (Old)
and /work/SRC/openSUSE:Factory/.aqbanking.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "aqbanking"
Changes:
--------
--- /work/SRC/openSUSE:Factory/aqbanking/aqbanking.changes 2013-09-23 08:46:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.aqbanking.new/aqbanking.changes 2013-11-01 17:40:51.000000000 +0100
@@ -1,0 +2,17 @@
+Wed Oct 23 15:19:46 UTC 2013 - nico.kruber(a)gmail.com
+
+- fix build for SLE
+
+-------------------------------------------------------------------
+Wed Oct 23 14:56:19 UTC 2013 - nico.kruber(a)gmail.com
+
+- Update to version 5.1.0beta:
+ + improvements to the SEPA exporter
+ (ability to create bank valid transfers and debits)
+ + add fields required for SEPA debits to AB_TRANSACTION
+ + SEPA debits should work (not tested yet)
+ + add a command to AqBanking-CLI to add a SEPA debit to a
+ ImExporterContext file from which orders in SEPA format can be
+ exported
+
+-------------------------------------------------------------------
Old:
----
aqbanking-5.0.32beta.tar.gz
New:
----
aqbanking-5.1.0beta.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ aqbanking.spec ++++++
--- /var/tmp/diff_new_pack.CJx6ig/_old 2013-11-01 17:40:52.000000000 +0100
+++ /var/tmp/diff_new_pack.CJx6ig/_new 2013-11-01 17:40:52.000000000 +0100
@@ -26,7 +26,7 @@
%define q4b_cfgmoddir %{fronts_libdir}/q4banking/cfgmodules
Name: aqbanking
-Version: 5.0.32beta
+Version: 5.1.0beta
Release: 0
# FIXME Still unable to use parallel make. Last checked: 2011-09-25
Summary: Library for Online Banking Functions and Financial Data Import and Export
@@ -44,7 +44,11 @@
BuildRequires: gwenhywfar-devel >= 4.7.0
BuildRequires: gwenhywfar-tools
BuildRequires: ktoblzcheck-devel >= 1.10
+%if !0%{?sles_version}
BuildRequires: pkgconfig(gtk+-2.0)
+%else
+BuildRequires: gtk2-devel
+%endif
%if %build_ofx
BuildRequires: libofx-devel
%endif
@@ -118,7 +122,7 @@
make
%install
-%make_install
+%makeinstall
find %{buildroot} -type f -name "*.la" -delete -print
# Remove files that we'll have elsewhere
rm %{buildroot}%{_datadir}/doc/%{name}/{AUTHORS,COPYING,ChangeLog,README}
++++++ aqbanking-5.0.32beta.tar.gz -> aqbanking-5.1.0beta.tar.gz ++++++
++++ 2838 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0