openSUSE Commits
Threads by month
- ----- 2024 -----
- 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
August 2018
- 1 participants
- 1600 discussions
Hello community,
here is the log from the commit of package libyui for openSUSE:Factory checked in at 2018-08-02 14:55:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui (Old)
and /work/SRC/openSUSE:Factory/.libyui.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui"
Thu Aug 2 14:55:52 2018 rev:35 rq:626654 version:3.4.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui/libyui.changes 2018-05-17 19:31:52.962410950 +0200
+++ /work/SRC/openSUSE:Factory/.libyui.new/libyui.changes 2018-08-02 14:56:00.672062754 +0200
@@ -1,0 +2,8 @@
+Thu Jul 26 07:45:20 UTC 2018 - lslezak(a)suse.cz
+
+- Improved the FSize class to handle arbitrary sizes, use the boost
+ multiprecision library instead of `long long` which overflows for
+ values > 8EiB (bsc#991090)
+- 3.4.2
+
+-------------------------------------------------------------------
Old:
----
libyui-3.4.1.tar.bz2
New:
----
libyui-3.4.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-doc.spec ++++++
--- /var/tmp/diff_new_pack.1vw1Ed/_old 2018-08-02 14:56:01.432064026 +0200
+++ /var/tmp/diff_new_pack.1vw1Ed/_new 2018-08-02 14:56:01.436064032 +0200
@@ -17,10 +17,10 @@
%define parent libyui
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 3.4.1
+Version: 3.4.2
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui.spec ++++++
--- /var/tmp/diff_new_pack.1vw1Ed/_old 2018-08-02 14:56:01.452064059 +0200
+++ /var/tmp/diff_new_pack.1vw1Ed/_new 2018-08-02 14:56:01.452064059 +0200
@@ -17,15 +17,20 @@
Name: libyui
-Version: 3.4.1
+Version: 3.4.2
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
+# optionally build with code coverage reporting,
+# this uses debug build, do not use in production!
+%bcond_with coverage
+
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
+BuildRequires: libboost_test-devel
%else
BuildRequires: boost-devel
%endif
@@ -33,6 +38,12 @@
BuildRequires: gcc-c++
BuildRequires: pkg-config
+%if %{with coverage}
+# normally the coverage feature should not be used out of CI
+# but to be on the safe side...
+BuildRequires: lcov
+%endif
+
Url: http://github.com/libyui/
Summary: GUI-abstraction library
License: LGPL-2.1 or LGPL-3.0
@@ -70,6 +81,7 @@
%if 0%{?suse_version} > 1325
Requires: libboost_headers-devel
+Requires: libboost_test-devel
%else
Requires: boost-devel
%endif
@@ -99,29 +111,41 @@
%build
./bootstrap.sh
-
-export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
-export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
-
mkdir build
cd build
+%if %{with coverage}
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_CODE_COVERAGE=ON"
+# the debug build type is incompatible with the default $RPM_OPT_FLAGS,
+# do not use them
+export CFLAGS="-DNDEBUG $(getconf LFS_CFLAGS)"
+export CXXFLAGS="-DNDEBUG $(getconf LFS_CFLAGS)"
+%else
+export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
+export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
%if %{?_with_debug:1}%{!?_with_debug:0}
-cmake .. \
- -DYPREFIX=%{_prefix} \
- -DDOC_DIR=%{_docdir} \
- -DLIB_DIR=%{_lib} \
- -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RELWITHDEBINFO"
%else
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RELEASE"
+%endif
+%endif
+
cmake .. \
-DYPREFIX=%{_prefix} \
-DDOC_DIR=%{_docdir} \
-DLIB_DIR=%{_lib} \
- -DCMAKE_BUILD_TYPE=RELEASE
-%endif
+ $CMAKE_OPTS
make %{?jobs:-j%jobs}
+%check
+cd build
+make test
+%if %{with coverage}
+# generate code coverage data
+make coverage
+%endif
+
%install
cd build
make install DESTDIR="$RPM_BUILD_ROOT"
++++++ libyui-3.4.1.tar.bz2 -> libyui-3.4.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/.travis.yml new/libyui-3.4.2/.travis.yml
--- old/libyui-3.4.1/.travis.yml 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/.travis.yml 2018-07-31 09:50:54.000000000 +0200
@@ -8,4 +8,4 @@
script:
# the "libyui-travis" script is included in the base libyui/devel image
# see https://github.com/libyui/docker-devel/blob/master/libyui-travis
- - docker run -it libyui-image libyui-travis
+ - docker run -it -e COVERALLS_TOKEN="$COVERALLS_TOKEN" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" libyui-image libyui-travis
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/Makefile.cvs new/libyui-3.4.2/Makefile.cvs
--- old/libyui-3.4.1/Makefile.cvs 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/Makefile.cvs 2018-07-31 09:50:54.000000000 +0200
@@ -2,6 +2,11 @@
# Makefile.cvs
#
+# enable coverage if $COVERAGE is set to 1
+ifeq ($(COVERAGE), 1)
+EXTRA_PARAMS := -DENABLE_CODE_COVERAGE=ON
+endif
+
all: configure
configure: clean
@@ -9,7 +14,7 @@
mkdir build ; \
cd build ; \
cmake .. \
- -DCMAKE_BUILD_TYPE=RELEASE
+ -DCMAKE_BUILD_TYPE=RELEASE $(EXTRA_PARAMS)
install: configure
cd build ; \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/PROJECTINFO.cmake new/libyui-3.4.2/PROJECTINFO.cmake
--- old/libyui-3.4.1/PROJECTINFO.cmake 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/PROJECTINFO.cmake 2018-07-31 09:50:54.000000000 +0200
@@ -4,7 +4,7 @@
##### MAKE ALL NEEDED CHANGES HERE #####
-SET( SUBDIRS src examples )
+SET( SUBDIRS src examples tests )
SET( LIB_DEPS Boost )
SET( LIB_LINKER dl pthread )
SET( EXTRA_INCLUDES ) # set include-dir which are not picked by CMake automagically here.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/README.md new/libyui-3.4.2/README.md
--- old/libyui-3.4.1/README.md 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/README.md 2018-07-31 09:50:54.000000000 +0200
@@ -1,6 +1,9 @@
# LibYUI - The Base Library
[![Build Status](https://travis-ci.org/libyui/libyui.svg?branch=master)](https://tra…
+[![Coverage Status](
+https://coveralls.io/repos/github/libyui/libyui/badge.svg?branch=master)](
+https://coveralls.io/github/libyui/libyui?branch=master)
Libyui is a widget abstraction library providing Qt, GTK and ncurses
frontends. Originally it was developed for [YaST](https://yast.github.io/)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/VERSION.cmake new/libyui-3.4.2/VERSION.cmake
--- old/libyui-3.4.1/VERSION.cmake 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/VERSION.cmake 2018-07-31 09:50:54.000000000 +0200
@@ -1,6 +1,6 @@
SET( VERSION_MAJOR "3")
SET( VERSION_MINOR "4" )
-SET( VERSION_PATCH "1" )
+SET( VERSION_PATCH "2" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )
##### This is need for the libyui core, ONLY.
@@ -8,7 +8,7 @@
# Currently you must also change so_version in libyui.spec
# *and also in **all** other* libyui-*.spec files in the other repositories.
# Yes, such a design is suboptimal.
-SET( SONAME_MAJOR "8" )
-SET( SONAME_MINOR "1" )
+SET( SONAME_MAJOR "9" )
+SET( SONAME_MINOR "0" )
SET( SONAME_PATCH "0" )
SET( SONAME "${SONAME_MAJOR}.${SONAME_MINOR}.${SONAME_PATCH}" )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/buildtools/LibyuiCommon.cmake new/libyui-3.4.2/buildtools/LibyuiCommon.cmake
--- old/libyui-3.4.1/buildtools/LibyuiCommon.cmake 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/buildtools/LibyuiCommon.cmake 2018-07-31 09:50:54.000000000 +0200
@@ -58,6 +58,8 @@
OPTION( ENABLE_WERROR "Enable the -Werror compiler-flag?" ON )
OPTION( RESPECT_FLAGS "Shall I respect the system c/ldflags?" OFF )
OPTION( INSTALL_DOCS "Shall \"make install\" install the docs?" OFF )
+ OPTION( ENABLE_TESTS "Enable tests?" ON)
+ OPTION( ENABLE_CODE_COVERAGE "Enable code coverage report?" OFF)
ENDMACRO( SET_OPTIONS )
@@ -116,6 +118,59 @@
)
ENDIF( NOT BUILD_TYPE_PASSED )
+ IF ( ENABLE_TESTS OR ENABLE_CODE_COVERAGE)
+ ENABLE_TESTING()
+ # add a wrapper "tests" target, the builtin "test" cannot be extended :-(
+ ADD_CUSTOM_TARGET(tests
+ $(MAKE)
+ COMMAND $(MAKE) test
+ )
+ ENDIF ( ENABLE_TESTS OR ENABLE_CODE_COVERAGE)
+
+ IF ( ENABLE_CODE_COVERAGE )
+ # pass the coverage options to GCC
+ ADD_DEFINITIONS(--coverage)
+ LINK_LIBRARIES(--coverage)
+ # force debug build to not optimize the code, the optimized out code
+ # might be reported as not covered
+ SET( CMAKE_BUILD_TYPE DEBUG CACHE
+ STRING "set to DEBUG"
+ FORCE
+ )
+
+ FIND_PROGRAM( LCOV_PATH lcov )
+ FIND_PROGRAM( GENHTML_PATH genhtml )
+
+ IF(LCOV_PATH AND GENHTML_PATH)
+ # save the coverage data to coverage/ subdir
+ SET(COVERAGE_DATA "coverage/coverage.info")
+ ADD_CUSTOM_TARGET(coverage
+ # remove the previous coverage data
+ rm -rf coverage/*
+ COMMAND mkdir -p coverage
+ # collect the coverage data, ignore external files (/usr/include/...), ignore tests
+ COMMAND ${LCOV_PATH} --no-external --exclude '*/tests/*' -o ${COVERAGE_DATA} -c -d . -q
+ # generate the HTML coverage report
+ COMMAND ${GENHTML_PATH} -o coverage --legend --title "libyui code coverage" -q ${COVERAGE_DATA}
+ # print the coverage summary on the terminal
+ COMMAND ${LCOV_PATH} --list ${COVERAGE_DATA}
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ COMMENT "Generating the code coverage report..."
+ )
+ # display a comment when finished
+ ADD_CUSTOM_COMMAND(TARGET coverage POST_BUILD
+ COMMAND ;
+ COMMENT "Code coverage gerated to ./coverage/index.html file."
+ )
+ # automatically collect code coverage after "tests" target is finished
+ ADD_CUSTOM_COMMAND(TARGET tests POST_BUILD
+ COMMAND $(MAKE) coverage
+ )
+ ELSE(LCOV_PATH AND GENHTML_PATH)
+ MESSAGE(FATAL_ERROR "lcov is not installed, code coverage report cannot be generated.")
+ ENDIF(LCOV_PATH AND GENHTML_PATH)
+ ENDIF ( ENABLE_CODE_COVERAGE )
+
SET( CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" )
SET( CMAKE_C_FLAGS_DEBUG "-O0 -g3" )
SET( CMAKE_CXX_FLAGS_MINSIZEREL "-Os" )
@@ -566,6 +621,8 @@
ENDIF( ENABLE_DEBUG OR ${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO" OR ${CMAKE_BUILD_TYPE} STREQUAL "DEBUG" )
MESSAGE( STATUS " Build a static library, too: ${ENABLE_STATIC}" )
MESSAGE( STATUS " Build the examples, too: ${ENABLE_EXAMPLES}" )
+ MESSAGE( STATUS " Build the tests, too: ${ENABLE_TESTS}" )
+ MESSAGE( STATUS " Generate test code coverage: ${ENABLE_CODE_COVERAGE}" )
MESSAGE( STATUS "" )
IF( INSTALL_DOCS AND DOXYGEN_FOUND )
MESSAGE( STATUS "RUN `make docs` BEFORE `make install` !!!" )
@@ -723,3 +780,25 @@
)
ENDMACRO( PROCESS_EXAMPLES )
+
+
+
+MACRO( PROCESS_TESTS )
+
+ FIND_PACKAGE(Boost COMPONENTS unit_test_framework REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ../src ${CMAKE_INCLUDE_PATH} )
+ ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DTESTS_SRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}" )
+
+ # expect the tests in *_test.cc files
+ FILE(GLOB unit_tests "*_test.cc")
+ FOREACH(unit_test ${unit_tests})
+ # strip the .cc suffix
+ GET_FILENAME_COMPONENT(unit_test_bin ${unit_test} NAME_WE)
+ # build the test executable
+ ADD_EXECUTABLE(${unit_test_bin} ${unit_test})
+ TARGET_LINK_LIBRARIES (${unit_test_bin} ${BASELIB} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} )
+ # add it to the test suite
+ ADD_TEST(NAME ${unit_test_bin} COMMAND ${unit_test_bin})
+ ENDFOREACH(unit_test)
+
+ENDMACRO( PROCESS_TESTS )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/package/libyui-doc.spec new/libyui-3.4.2/package/libyui-doc.spec
--- old/libyui-3.4.1/package/libyui-doc.spec 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/package/libyui-doc.spec 2018-07-31 09:50:54.000000000 +0200
@@ -17,10 +17,10 @@
%define parent libyui
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 3.4.1
+Version: 3.4.2
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/package/libyui.changes new/libyui-3.4.2/package/libyui.changes
--- old/libyui-3.4.1/package/libyui.changes 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/package/libyui.changes 2018-07-31 09:50:54.000000000 +0200
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Jul 26 07:45:20 UTC 2018 - lslezak(a)suse.cz
+
+- Improved the FSize class to handle arbitrary sizes, use the boost
+ multiprecision library instead of `long long` which overflows for
+ values > 8EiB (bsc#991090)
+- 3.4.2
+
+-------------------------------------------------------------------
Wed May 9 07:34:16 UTC 2018 - mliska(a)suse.cz
- Fix GCC 8 warning: -Werror=catch-value (boo#1084636).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/package/libyui.spec new/libyui-3.4.2/package/libyui.spec
--- old/libyui-3.4.1/package/libyui.spec 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/package/libyui.spec 2018-07-31 09:50:54.000000000 +0200
@@ -16,15 +16,20 @@
#
Name: libyui
-Version: 3.4.1
+Version: 3.4.2
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
+# optionally build with code coverage reporting,
+# this uses debug build, do not use in production!
+%bcond_with coverage
+
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
+BuildRequires: libboost_test-devel
%else
BuildRequires: boost-devel
%endif
@@ -32,6 +37,12 @@
BuildRequires: gcc-c++
BuildRequires: pkg-config
+%if %{with coverage}
+# normally the coverage feature should not be used out of CI
+# but to be on the safe side...
+BuildRequires: lcov
+%endif
+
Url: http://github.com/libyui/
Summary: GUI-abstraction library
License: LGPL-2.1 or LGPL-3.0
@@ -69,6 +80,7 @@
%if 0%{?suse_version} > 1325
Requires: libboost_headers-devel
+Requires: libboost_test-devel
%else
Requires: boost-devel
%endif
@@ -98,29 +110,41 @@
%build
./bootstrap.sh
-
-export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
-export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
-
mkdir build
cd build
+%if %{with coverage}
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_CODE_COVERAGE=ON"
+# the debug build type is incompatible with the default $RPM_OPT_FLAGS,
+# do not use them
+export CFLAGS="-DNDEBUG $(getconf LFS_CFLAGS)"
+export CXXFLAGS="-DNDEBUG $(getconf LFS_CFLAGS)"
+%else
+export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
+export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG $(getconf LFS_CFLAGS)"
%if %{?_with_debug:1}%{!?_with_debug:0}
-cmake .. \
- -DYPREFIX=%{_prefix} \
- -DDOC_DIR=%{_docdir} \
- -DLIB_DIR=%{_lib} \
- -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RELWITHDEBINFO"
%else
+CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RELEASE"
+%endif
+%endif
+
cmake .. \
-DYPREFIX=%{_prefix} \
-DDOC_DIR=%{_docdir} \
-DLIB_DIR=%{_lib} \
- -DCMAKE_BUILD_TYPE=RELEASE
-%endif
+ $CMAKE_OPTS
make %{?jobs:-j%jobs}
+%check
+cd build
+make test
+%if %{with coverage}
+# generate code coverage data
+make coverage
+%endif
+
%install
cd build
make install DESTDIR="$RPM_BUILD_ROOT"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/src/FSize.cc new/libyui-3.4.2/src/FSize.cc
--- old/libyui-3.4.1/src/FSize.cc 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/src/FSize.cc 2018-07-31 09:50:54.000000000 +0200
@@ -1,5 +1,7 @@
/*
Copyright (C) 2000-2012 Novell, Inc
+ Copyright (C) 2018 SUSE LLC
+
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
@@ -25,14 +27,28 @@
/-*/
-#include <stdio.h>
-#include <stdlib.h>
#include <iostream>
+#include <sstream>
#include "FSize.h"
+// arbitrary precision float for floating point division
+#include <boost/multiprecision/cpp_bin_float.hpp>
+
+using boost::multiprecision::cpp_int;
+
+const cpp_int FSize::KB = 1024;
+const cpp_int FSize::MB = FSize::KB * 1024;
+const cpp_int FSize::GB = FSize::MB * 1024;
+const cpp_int FSize::TB = FSize::GB * 1024;
+const cpp_int FSize::PB = FSize::TB * 1024;
+const cpp_int FSize::EB = FSize::PB * 1024;
+const cpp_int FSize::ZB = FSize::EB * 1024;
+const cpp_int FSize::YB = FSize::ZB * 1024;
+
+
FSize::FSize( const std::string &sizeStr, const Unit unit_r )
- : _size( atoll( sizeStr.c_str() ) * factor( unit_r ) )
+ : _size( cpp_int(sizeStr) * factor( unit_r ) )
{
}
@@ -45,11 +61,11 @@
//
FSize & FSize::fillBlock( FSize blocksize_r )
{
- if ( _size && blocksize_r ) {
- long long diff = _size % blocksize_r;
+ if ( _size > 0 && cpp_int(blocksize_r) > 0) {
+ cpp_int diff = _size % cpp_int(blocksize_r);
if ( diff ) {
if ( _size > 0 )
- _size += blocksize_r;
+ _size += cpp_int(blocksize_r);
_size -= diff;
}
}
@@ -65,16 +81,24 @@
//
FSize::Unit FSize::bestUnit() const
{
- long long usize( _size < 0 ? -_size : _size );
+ cpp_int usize = abs(_size);
if ( usize < KB )
- return B;
+ return Unit::B;
if ( usize < MB )
- return K;
+ return Unit::K;
if ( usize < GB )
- return M;
+ return Unit::M;
if ( usize < TB )
- return G;
- return T;
+ return Unit::G;
+ if ( usize < PB )
+ return Unit::T;
+ if ( usize < EB )
+ return Unit::P;
+ if ( usize < ZB )
+ return Unit::E;
+ if ( usize < YB )
+ return Unit::Z;
+ return Unit::Y;
}
//
@@ -89,26 +113,36 @@
if ( prec == bestPrec ) {
switch ( unit_r )
{
- case T: prec = 3; break;
- case G: prec = 2; break;
- case M: prec = 1; break;
- case K: prec = 1; break;
- case B: prec = 0; break;
+ case Unit::Y: prec = 3; break;
+ case Unit::Z: prec = 3; break;
+ case Unit::E: prec = 3; break;
+ case Unit::P: prec = 3; break;
+ case Unit::T: prec = 3; break;
+ case Unit::G: prec = 2; break;
+ case Unit::M: prec = 1; break;
+ case Unit::K: prec = 1; break;
+ case Unit::B: prec = 0; break;
}
- } else if ( unit_r == B )
+} else if ( unit_r == Unit::B )
prec = 0; // doesn't make sense for Byte
- char buffer[80]; // should be long enough for any numeric sprintf()
- snprintf( buffer, sizeof( buffer ),
- "%*.*f",
- fw, prec, ( double( _size ) / factor( unit_r ) ) );
-
- std::string ret( buffer );
+ std::ostringstream str;
+ // set the precision and field width, use fixed notation (not the scientific Xe+Y)
+ str << std::setprecision(prec) << std::setfill(' ') << std::setw(fw) << std::fixed;
+
+ if (prec == 0)
+ // no decimal part required, we can use integer division,
+ // add one unit half for correct rounding
+ str << (_size + (factor( unit_r ) / 2))/ factor( unit_r );
+ else
+ // otherwise convert to boost floats
+ str << (boost::multiprecision::cpp_bin_float_50)( _size ) /
+ (boost::multiprecision::cpp_bin_float_50)(factor( unit_r ) );
if ( showunit )
- ret += std::string(" ") + unit( unit_r );
+ str << " " << unit( unit_r );
- return ret;
+ return str.str();
}
@@ -123,3 +157,15 @@
{
return form();
}
+
+std::ostream& operator<<(std::ostream &ostr, const FSize &fsize)
+{
+ ostr << fsize.asString();
+ return ostr;
+}
+
+std::ostream& operator<<(std::ostream &ostr, const FSize::Unit unit)
+{
+ ostr << FSize::unit(unit);
+ return ostr;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/src/FSize.h new/libyui-3.4.2/src/FSize.h
--- old/libyui-3.4.1/src/FSize.h 2018-05-14 14:10:38.000000000 +0200
+++ new/libyui-3.4.2/src/FSize.h 2018-07-31 09:50:54.000000000 +0200
@@ -1,5 +1,6 @@
/*
Copyright (C) 2000-2012 Novell, Inc
+ Copyright (C) 2018 SUSE LLC
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
@@ -21,7 +22,7 @@
Author: Michael Andres <ma(a)suse.de>
Maintainer: Michael Andres <ma(a)suse.de>
- Purpose: Store and operate on (file/package/partition) sizes (long long).
+ Purpose: Store and operate on (file/package/partition) sizes.
/-*/
#ifndef _FSize_h_
@@ -30,45 +31,65 @@
#include <iosfwd>
#include <string>
+// arbitrary precision integer
+#include <boost/multiprecision/cpp_int.hpp>
+// generate additional operators via the boost templates
+#include <boost/operators.hpp>
+
//
// CLASS NAME : FSize
//
/**
- * Store and operate on (file/package/partition) sizes (long long).
+ * Store and operate on (file/package/partition) sizes.
**/
-class FSize {
+class FSize :
+ // generate > / * + - <= => !== operators
+ boost::ordered_field_operators<FSize>,
+ // generate postfix ++ --
+ boost::unit_steppable<FSize>
+ {
public:
/**
* The Units
**/
- enum Unit { B = 0, K, M, G, T };
+ enum class Unit { B, K, M, G, T, P, E, Z, Y };
private:
/**
- * The size in Byte
+ * The size (in bytes)
+ * @see https://www.boost.org/doc/libs/release/libs/multiprecision/doc/html/index.h…
**/
- long long _size;
+ boost::multiprecision::cpp_int _size;
public:
- static const long long KB = 1024;
- static const long long MB = 1024 * KB;
- static const long long GB = 1024 * MB;
- static const long long TB = 1024 * GB;
+ static const boost::multiprecision::cpp_int KB;
+ static const boost::multiprecision::cpp_int MB;
+ static const boost::multiprecision::cpp_int GB;
+ static const boost::multiprecision::cpp_int TB;
+ static const boost::multiprecision::cpp_int PB;
+ static const boost::multiprecision::cpp_int EB;
+ // these do not fit long long anymore!
+ static const boost::multiprecision::cpp_int ZB;
+ static const boost::multiprecision::cpp_int YB;
/**
- * Return ammount of Byte in Unit.
+ * Return ammount of bytes in Unit.
**/
- static long long factor( const Unit unit_r ) {
+ static boost::multiprecision::cpp_int factor( const Unit unit_r ) {
switch ( unit_r ) {
- case T: return TB;
- case G: return GB;
- case M: return MB;
- case K: return KB;
- case B: break;
+ case Unit::Y: return YB;
+ case Unit::Z: return ZB;
+ case Unit::E: return EB;
+ case Unit::P: return PB;
+ case Unit::T: return TB;
+ case Unit::G: return GB;
+ case Unit::M: return MB;
+ case Unit::K: return KB;
+ case Unit::B: break;
}
return 1;
}
@@ -78,11 +99,15 @@
**/
static const char * unit( const Unit unit_r ) {
switch ( unit_r ) {
- case T: return "TB";
- case G: return "GB";
- case M: return "MB";
- case K: return "kB";
- case B: break;
+ case Unit::Y: return "YiB";
+ case Unit::Z: return "ZiB";
+ case Unit::E: return "EiB";
+ case Unit::P: return "PiB";
+ case Unit::T: return "TiB";
+ case Unit::G: return "GiB";
+ case Unit::M: return "MiB";
+ case Unit::K: return "KiB";
+ case Unit::B: break;
}
return "B";
}
@@ -90,55 +115,71 @@
public:
/**
- * Construct from size in Byte.
+ * Construct from size in certain unit.
+ * E.g. <code>FSize( 1, FSize::Unit::K )<code> makes 1024 Byte.
**/
- FSize( const long long size_r = 0 )
- : _size( size_r )
+ FSize( const boost::multiprecision::cpp_int &size_r = 0, const Unit unit_r = Unit::B)
+ : _size( boost::multiprecision::cpp_int(size_r) * factor( unit_r ) )
{}
/**
- * Construct from size in certain unit.
- * E.g. <code>FSize( 1, FSize::K )<code> makes 1024 Byte.
+ * Construct from size in Byte.
+ * @param size_r the initial value
**/
- FSize( const long long size_r, const Unit unit_r )
- : _size( size_r * factor( unit_r ) )
+ FSize( double size_r )
+ : _size( size_r )
{}
/**
Construct from string containing a number in given unit.
+ * @param sizeStr input string - must contain *only* numbers
+ * @param unit_r optional unit, bytes by default
+ * @throws std::runtime_error if the string contains any non numeric characters,
+ * even a trailing white space!
*/
- FSize( const std::string &sizeStr, const Unit unit_r = B );
+ FSize( const std::string &sizeStr, const Unit unit_r = Unit::B );
/**
- * Conversion to long long
- **/
- operator long long() const { return _size; }
-
- FSize & operator+=( const long long rhs ) { _size += rhs; return *this; }
- FSize & operator-=( const long long rhs ) { _size -= rhs; return *this; }
- FSize & operator*=( const long long rhs ) { _size *= rhs; return *this; }
- FSize & operator/=( const long long rhs ) { _size /= rhs; return *this; }
-
- FSize & operator++(/*prefix*/) { _size += 1; return *this; }
- FSize & operator--(/*prefix*/) { _size -= 1; return *this; }
-
- FSize operator++(int/*postfix*/) { return _size++; }
- FSize operator--(int/*postfix*/) { return _size--; }
+ * Conversions to native data types - only explicit as it might overflow
+ * If the value is out of range then the behavior depends on the boost version
+ * - 1.67 - the min/max values for the corresponding type are returned
+ * - 1.66 - returns just the lower bits
+ **/
+ explicit operator long long() const { return static_cast<long long>(_size); }
+ explicit operator int() const { return static_cast<int>(_size); }
+ explicit operator double() const { return static_cast<double>(_size); }
+
+ operator boost::multiprecision::cpp_int() const { return _size; }
+ boost::multiprecision::cpp_int in_unit(const Unit unit_r) const { return _size / factor( unit_r ); }
+
+ // unary minus
+ FSize operator-() const { return FSize(-_size); }
+ FSize & operator+=( const FSize &rhs ) { _size += boost::multiprecision::cpp_int(rhs); return *this; }
+ FSize & operator-=( const FSize &rhs ) { _size -= boost::multiprecision::cpp_int(rhs); return *this; }
+ FSize & operator*=( const FSize &rhs ) { _size *= boost::multiprecision::cpp_int(rhs); return *this; }
+ FSize & operator/=( const FSize &rhs ) { _size /= boost::multiprecision::cpp_int(rhs); return *this; }
+
+ bool operator<( const FSize &rhs ) const { return _size < boost::multiprecision::cpp_int(rhs); }
+ bool operator==( const FSize &rhs ) const { return _size == boost::multiprecision::cpp_int(rhs); }
+
+ // ++operator (the prefix variant)
+ FSize & operator++() { _size += 1; return *this; }
+ // --operator (the prefix variant)
+ FSize & operator--() { _size -= 1; return *this; }
/**
* Adjust size to multiple of <code>blocksize_r</code>
**/
- FSize & fillBlock( FSize blocksize_r = KB );
+ FSize & fillBlock( FSize blocksize_r = boost::multiprecision::cpp_int(KB) );
/**
- * Return size adjusted to multiple of <code>blocksize_r</code>
+ * Return a new size adjusted to multiple of <code>blocksize_r</code>
**/
- FSize fullBlock( FSize blocksize_r = KB ) const { FSize ret( _size ); return ret.fillBlock( blocksize_r ); }
-
- /**
- * Return size in Unit ( not rounded )
- **/
- long long operator()( const Unit unit_r ) const { return _size / factor( unit_r ); }
+ FSize fullBlock( FSize blocksize_r = boost::multiprecision::cpp_int(KB) ) const
+ {
+ FSize ret( _size );
+ return ret.fillBlock( blocksize_r );
+ }
/**
* Return the best unit for string representation.
@@ -176,5 +217,8 @@
std::string asString() const;
};
+// stream operators
+std::ostream& operator<<(std::ostream &ostr, const FSize&);
+std::ostream& operator<<(std::ostream &ostr, const FSize::Unit);
#endif // _FSize_h_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/tests/CMakeLists.txt new/libyui-3.4.2/tests/CMakeLists.txt
--- old/libyui-3.4.1/tests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libyui-3.4.2/tests/CMakeLists.txt 2018-07-31 09:50:54.000000000 +0200
@@ -0,0 +1 @@
+PROCESS_TESTS()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/tests/FSize_test.cc new/libyui-3.4.2/tests/FSize_test.cc
--- old/libyui-3.4.1/tests/FSize_test.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libyui-3.4.2/tests/FSize_test.cc 2018-07-31 09:50:54.000000000 +0200
@@ -0,0 +1,419 @@
+/*
+ Copyright (C) 2018 SUSE LLC
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) version 3.0 of the License. This library
+ is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this library; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ Floor, Boston, MA 02110-1301 USA
+*/
+
+// This is an unit test for the FSize class
+
+#define BOOST_TEST_MODULE FSize_tests
+#include <boost/test/unit_test.hpp>
+#include <boost/version.hpp>
+
+#include <limits>
+#include <sstream>
+
+#include "FSize.h"
+
+using boost::multiprecision::cpp_int;
+
+// decrease the log level to warnings
+struct LogWarnings {
+ // global initialization before running any test
+ void setup() {
+ boost::unit_test::unit_test_log.set_threshold_level( boost::unit_test::log_warnings );
+ }
+ // cleanup after all tests are finished
+ void teardown() { }
+};
+
+BOOST_TEST_GLOBAL_FIXTURE( LogWarnings );
+
+BOOST_AUTO_TEST_CASE( constructor )
+{
+ // check the default constructor
+ FSize fsize;
+ BOOST_CHECK_EQUAL( fsize, 0 );
+
+ // check an int parameter
+ FSize fsize_int(42);
+ BOOST_CHECK_EQUAL( fsize_int, 42 );
+
+ // check a long long parameter
+ FSize fsize_long(1LL << 40);
+ BOOST_CHECK_EQUAL( fsize_long, 1LL << 40);
+
+ // check a double parameter
+ FSize fsize_double(42.0);
+ BOOST_CHECK_EQUAL( fsize_double, 42.0);
+ // the decimal part is ignored
+ BOOST_CHECK_EQUAL( fsize_double, FSize(42.1));
+ BOOST_CHECK_EQUAL( fsize_double, FSize(42.5));
+ BOOST_CHECK_EQUAL( fsize_double, FSize(42.9));
+
+ // check negative number
+ FSize fsize_int_neg(-42);
+ BOOST_CHECK_EQUAL( fsize_int_neg, -42 );
+
+ // create with units
+ long long u = 1;
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::B), 1);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::K), u *= 1024);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::M), u *= 1024);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::G), u *= 1024);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::T), u *= 1024);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::P), u *= 1024);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::E), u *= 1024);
+ // too much for a long long...
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::Z), cpp_int(1) << 70);
+ BOOST_CHECK_EQUAL( FSize(1, FSize::Unit::Y), cpp_int(1) << 80);
+
+ BOOST_CHECK_EQUAL( FSize(128, FSize::Unit::K), 128 * 1024);
+ BOOST_CHECK_EQUAL( FSize(-128, FSize::Unit::K), -(128 * 1024));
+
+ // from string
+ BOOST_CHECK_EQUAL( FSize("128", FSize::Unit::K), 128 * 1024);
+ BOOST_CHECK_EQUAL( FSize("-128", FSize::Unit::K), -128 * 1024);
+ BOOST_CHECK_EQUAL( FSize("856", FSize::Unit::M), 856 * 1024 * 1024);
+
+ // throws std::runtime_error exception for invalid data!!
+ BOOST_CHECK_THROW( FSize("72.89", FSize::Unit::K), std::runtime_error);
+ BOOST_CHECK_THROW( FSize(" 72 ", FSize::Unit::K), std::runtime_error);
+ BOOST_CHECK_THROW( FSize("72asdf", FSize::Unit::K), std::runtime_error);
+}
+
+BOOST_AUTO_TEST_CASE( comparing_positive )
+{
+ FSize fsize(42);
+ BOOST_CHECK_EQUAL( fsize == 42, true );
+ BOOST_CHECK_EQUAL( fsize != 42, false );
+
+ BOOST_CHECK_EQUAL( fsize > 0, true );
+ BOOST_CHECK_EQUAL( fsize > 10, true );
+ BOOST_CHECK_EQUAL( fsize > 42, false );
+ BOOST_CHECK_EQUAL( fsize > -42, true );
+
+ BOOST_CHECK_EQUAL( fsize >= 0, true );
+ BOOST_CHECK_EQUAL( fsize >= 10, true );
+ BOOST_CHECK_EQUAL( fsize >= 42, true );
+ BOOST_CHECK_EQUAL( fsize >= -42, true );
+
+ BOOST_CHECK_EQUAL( fsize < 0, false );
+ BOOST_CHECK_EQUAL( fsize < 10, false );
+ BOOST_CHECK_EQUAL( fsize < 42, false );
+ BOOST_CHECK_EQUAL( fsize < -42, false );
+
+ BOOST_CHECK_EQUAL( fsize < 0, false );
+ BOOST_CHECK_EQUAL( fsize < 10, false );
+ BOOST_CHECK_EQUAL( fsize <= 42, true );
+ BOOST_CHECK_EQUAL( fsize <= -42, false );
+}
+
+BOOST_AUTO_TEST_CASE( comparing_negative )
+{
+ FSize fsize(-42);
+ BOOST_CHECK_EQUAL( fsize == -42, true );
+ BOOST_CHECK_EQUAL( fsize != -42, false );
+
+ BOOST_CHECK_EQUAL( fsize > 0, false );
+ BOOST_CHECK_EQUAL( fsize > 10, false );
+ BOOST_CHECK_EQUAL( fsize > -42, false );
+ BOOST_CHECK_EQUAL( fsize > -52, true );
+
+ BOOST_CHECK_EQUAL( fsize >= 0, false );
+ BOOST_CHECK_EQUAL( fsize >= 10, false );
+ BOOST_CHECK_EQUAL( fsize >= -42, true );
+ BOOST_CHECK_EQUAL( fsize >= -52, true );
+
+ BOOST_CHECK_EQUAL( fsize < 0, true );
+ BOOST_CHECK_EQUAL( fsize < 10, true );
+ BOOST_CHECK_EQUAL( fsize < 42, true );
+ BOOST_CHECK_EQUAL( fsize < -42, false );
+ BOOST_CHECK_EQUAL( fsize < -52, false );
+
+ BOOST_CHECK_EQUAL( fsize < 0, true );
+ BOOST_CHECK_EQUAL( fsize < 10, true );
+ BOOST_CHECK_EQUAL( fsize <= 42, true );
+ BOOST_CHECK_EQUAL( fsize <= -42, true );
+ BOOST_CHECK_EQUAL( fsize <= -52, false );
+}
+
+BOOST_AUTO_TEST_CASE( comparing_fsizes )
+{
+ FSize fsize(100);
+ FSize fsize_copy(fsize);
+ FSize fsize_double(100.0);
+ FSize fsize_negative(-100);
+ FSize fsize_different(200);
+
+ BOOST_CHECK_EQUAL( fsize, fsize_copy );
+ BOOST_CHECK_EQUAL( fsize, fsize_double );
+ BOOST_CHECK_NE( fsize, fsize_different );
+ BOOST_CHECK_NE( fsize, fsize_negative );
+
+ BOOST_CHECK_EQUAL( fsize < fsize_copy, false );
+ BOOST_CHECK_EQUAL( fsize > fsize_copy, false );
+ BOOST_CHECK_EQUAL( fsize <= fsize_copy, true );
+ BOOST_CHECK_EQUAL( fsize >= fsize_copy, true );
+ BOOST_CHECK_EQUAL( fsize < fsize_different, true );
+ BOOST_CHECK_EQUAL( fsize > fsize_different, false );
+ BOOST_CHECK_EQUAL( fsize <= fsize_different, true );
+ BOOST_CHECK_EQUAL( fsize >= fsize_different, false );
+}
+
+BOOST_AUTO_TEST_CASE( comparing_with_limits )
+{
+ // 2^1024
+ FSize fsize(cpp_int(1) << 1024);
+
+ // even bigger than the max long long
+ BOOST_CHECK(fsize > std::numeric_limits<long long>::max());
+ // even bigger than the max unsigned long long
+ BOOST_CHECK(fsize > std::numeric_limits<unsigned long long>::max());
+ // even bigger than the max double
+ BOOST_CHECK(fsize > std::numeric_limits<double>::max());
+
+ // compare with the negative limits
+ fsize *= -1;
+ // even lower than the min long long
+ BOOST_CHECK(fsize < std::numeric_limits<long long>::min());
+ // even lower than the min unsigned long long
+ BOOST_CHECK(fsize < std::numeric_limits<unsigned long long>::min());
+ // even lower than the min double
+ BOOST_CHECK(fsize < std::numeric_limits<double>::min());
+}
+
+BOOST_AUTO_TEST_CASE( operators_on_self )
+{
+ FSize fsize(42);
+
+ fsize += 42;
+ BOOST_CHECK(fsize == 84);
+ fsize -= 42;
+ BOOST_CHECK(fsize == 42);
+ fsize -= 42;
+ BOOST_CHECK(fsize == 0);
+ fsize -= 42;
+ BOOST_CHECK(fsize == -42);
+ fsize *= -1;
+ BOOST_CHECK(fsize == 42);
+ fsize *= 8;
+ BOOST_CHECK(fsize == 336);
+ fsize /= 6;
+ BOOST_CHECK(fsize == 56);
+
+ // check some bigger values, 10TiB
+ FSize fsize2(10, FSize::Unit::T);
+ // 10TiB / 10 => 1TiB
+ fsize2 /= 10;
+ BOOST_CHECK(fsize2 == FSize::TB);
+}
+
+BOOST_AUTO_TEST_CASE( operators )
+{
+ BOOST_CHECK_EQUAL(FSize(20) + FSize(22), 42);
+ BOOST_CHECK_EQUAL(FSize(64) - FSize(22), 42);
+ BOOST_CHECK_EQUAL(FSize(64) * FSize(4), 256);
+ BOOST_CHECK_EQUAL(FSize(1024) / FSize(8), 128);
+
+ BOOST_CHECK_EQUAL(20 + FSize(22), 42);
+ BOOST_CHECK_EQUAL(64 - FSize(22), 42);
+ BOOST_CHECK_EQUAL(64 * FSize(4), 256);
+ BOOST_CHECK_EQUAL(1024 / FSize(8), 128);
+
+ BOOST_CHECK_EQUAL(FSize(20) + 22, 42);
+ BOOST_CHECK_EQUAL(FSize(64) - 22, 42);
+ BOOST_CHECK_EQUAL(FSize(64) * 4, 256);
+ BOOST_CHECK_EQUAL(FSize(1024) / 8, 128);
+
+ // unary minus
+ BOOST_CHECK_EQUAL(-FSize(120), -120);
+
+ // increment/decrement
+ FSize test(120);
+ // post increment
+ BOOST_CHECK_EQUAL(test++, 120);
+ // changed
+ BOOST_CHECK_EQUAL(test, 121);
+ // pre increment
+ BOOST_CHECK_EQUAL(++test, 122);
+ // not changed
+ BOOST_CHECK_EQUAL(test, 122);
+
+ // post decrement
+ BOOST_CHECK_EQUAL(test--, 122);
+ // changed
+ BOOST_CHECK_EQUAL(test, 121);
+ // pre decrement
+ BOOST_CHECK_EQUAL(--test, 120);
+ // not changed
+ BOOST_CHECK_EQUAL(test, 120);
+}
+
+BOOST_AUTO_TEST_CASE( fillBlock )
+{
+ BOOST_CHECK_EQUAL(FSize(0).fillBlock(), 0);
+ BOOST_CHECK_EQUAL(FSize(1).fillBlock(), 1024);
+ BOOST_CHECK_EQUAL(FSize(4000).fillBlock(), 4096);
+ BOOST_CHECK_EQUAL(FSize(42 * 1024).fillBlock(), 42 * 1024);
+ BOOST_CHECK_EQUAL(FSize(42 * 1024).fillBlock(32 * 1024), 65536);
+
+ // fillBlock() changes the object
+ int value = 42 * 1024; // 42KiB
+ FSize fsize(value);
+ BOOST_CHECK_EQUAL(fsize.fillBlock(32 * 1024), 65536);
+ // not equal to the original size
+ BOOST_CHECK_NE(fsize, value);
+}
+
+BOOST_AUTO_TEST_CASE( fullBlock )
+{
+ BOOST_CHECK_EQUAL(FSize(0).fullBlock(), 0);
+ BOOST_CHECK_EQUAL(FSize(1).fullBlock(), 1024);
+ BOOST_CHECK_EQUAL(FSize(4000).fullBlock(), 4096);
+ BOOST_CHECK_EQUAL(FSize(42 * 1024).fullBlock(), 42 * 1024);
+ BOOST_CHECK_EQUAL(FSize(42 * 1024).fullBlock(32 * 1024), 65536);
+
+ // fullBlock() creates a new object
+ int value = 42 * 1024; // 42KiB
+ FSize fsize(value);
+ BOOST_CHECK_EQUAL(fsize.fullBlock(32 * 1024), 65536);
+ // not changed
+ BOOST_CHECK_EQUAL(fsize, value);
+}
+
+BOOST_AUTO_TEST_CASE( bestUnit )
+{
+ BOOST_CHECK_EQUAL(FSize(0).bestUnit(), FSize::Unit::B);
+ BOOST_CHECK_EQUAL(FSize(999).bestUnit(), FSize::Unit::B);
+ BOOST_CHECK_EQUAL(FSize(1023).bestUnit(), FSize::Unit::B);
+ BOOST_CHECK_EQUAL(FSize(1024).bestUnit(), FSize::Unit::K);
+
+ BOOST_CHECK_EQUAL(FSize(1LL << 20).bestUnit(), FSize::Unit::M);
+ BOOST_CHECK_EQUAL(FSize(1LL << 30).bestUnit(), FSize::Unit::G);
+ BOOST_CHECK_EQUAL(FSize(1LL << 40).bestUnit(), FSize::Unit::T);
+ BOOST_CHECK_EQUAL(FSize(1LL << 50).bestUnit(), FSize::Unit::P);
+ BOOST_CHECK_EQUAL(FSize(1LL << 60).bestUnit(), FSize::Unit::E);
+ BOOST_CHECK_EQUAL(FSize(cpp_int(1) << 70).bestUnit(), FSize::Unit::Z);
+ BOOST_CHECK_EQUAL(FSize(cpp_int(1) << 80).bestUnit(), FSize::Unit::Y);
+}
+
+BOOST_AUTO_TEST_CASE( unit )
+{
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::B), "B");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::K), "KiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::M), "MiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::G), "GiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::T), "TiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::P), "PiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::E), "EiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::Z), "ZiB");
+ BOOST_CHECK_EQUAL(FSize::unit(FSize::Unit::Y), "YiB");
+}
+
+BOOST_AUTO_TEST_CASE( form )
+{
+ BOOST_CHECK_EQUAL(FSize(0).form(), "0 B");
+ BOOST_CHECK_EQUAL(FSize(1).form(), "1 B");
+ BOOST_CHECK_EQUAL(FSize(1024).form(), "1.0 KiB");
+ BOOST_CHECK_EQUAL(FSize(-1024).form(), "-1.0 KiB");
+ BOOST_CHECK_EQUAL(FSize(FSize::MB).form(), "1.0 MiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(), "117.7 MiB");
+ // requested unit
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K), "120563.3 KiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::M), "117.7 MiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::G), "0.11 GiB");
+ // too small for the required unit
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::T), "0.000 TiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::P), "0.000 PiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::E), "0.000 EiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::Z), "0.000 ZiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::Y), "0.000 YiB");
+
+ // field width
+ BOOST_CHECK_EQUAL(FSize(123456789).form(10), " 117.7 MiB");
+ // the width parameter does NOT include the units!
+ BOOST_CHECK_EQUAL(FSize(123456789).form(10).length(), 14);
+ // does not cut numbers for longer strings
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K, 5), "120563.3 KiB");
+
+ // precision
+ BOOST_CHECK_EQUAL(FSize(123456789).form(0, 3), "117.738 MiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(0, 0), "118 MiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K, 0, 3), "120563.271 KiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K, 0, 0), "120563 KiB");
+ // precision for bytes is ignored
+ BOOST_CHECK_EQUAL(FSize(1234).form(FSize::Unit::B, 0, 3), "1234 B");
+
+ // without units
+ BOOST_CHECK_EQUAL(FSize(123456789).form(0, 3, false), "117.738");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(0, 0, false), "118");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K, 0, 3, false), "120563.271");
+ BOOST_CHECK_EQUAL(FSize(123456789).form(FSize::Unit::K, 0, 0, false), "120563");
+}
+
+BOOST_AUTO_TEST_CASE( as_string )
+{
+ // the same behavior like form(), test just few examples
+ BOOST_CHECK_EQUAL(FSize(0).asString(), "0 B");
+ BOOST_CHECK_EQUAL(FSize(1).asString(), "1 B");
+ BOOST_CHECK_EQUAL(FSize(1024).asString(), "1.0 KiB");
+ BOOST_CHECK_EQUAL(FSize(-1024).asString(), "-1.0 KiB");
+ BOOST_CHECK_EQUAL(FSize(123456789).asString(), "117.7 MiB");
+}
+
+template<class T> std::string to_stream(const T& object)
+{
+ std::ostringstream str;
+
+ str << object;
+ return str.str();
+}
+
+BOOST_AUTO_TEST_CASE( output_operator )
+{
+ BOOST_CHECK_EQUAL(to_stream(FSize(0)), "0 B");
+ BOOST_CHECK_EQUAL(to_stream(FSize(1)), "1 B");
+ BOOST_CHECK_EQUAL(to_stream(FSize(1024)), "1.0 KiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize(1024)), "1.0 KiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize(123456789)), "117.7 MiB");
+
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::B), "B");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::K), "KiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::M), "MiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::G), "GiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::T), "TiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::P), "PiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::E), "EiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::Z), "ZiB");
+ BOOST_CHECK_EQUAL(to_stream(FSize::Unit::Y), "YiB");
+}
+
+BOOST_AUTO_TEST_CASE( long_long_conversion )
+{
+ if (BOOST_VERSION >= 106700)
+ {
+ // Boost 1.67 returns min/max values for the values out of range
+ // https://www.boost.org/users/history/version_1_67_0.html
+ BOOST_CHECK_EQUAL((long long)(FSize::ZB), std::numeric_limits<long long>::max());
+ BOOST_CHECK_EQUAL((long long)(-FSize::YB), std::numeric_limits<long long>::min());
+ }
+ else
+ {
+ // the cpp_int convertion is buggy in older boost
+ // the older Boost (at least the 1.66 version) returns just the lower bits
+ // in that case just print a warning and continue
+ BOOST_WARN_EQUAL((long long)(FSize::ZB), std::numeric_limits<long long>::max());
+ BOOST_WARN_EQUAL((long long)(-FSize::YB), std::numeric_limits<long long>::min());
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.1/tests/README.md new/libyui-3.4.2/tests/README.md
--- old/libyui-3.4.1/tests/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/libyui-3.4.2/tests/README.md 2018-07-31 09:50:54.000000000 +0200
@@ -0,0 +1,36 @@
+
+# Unit Tests
+
+This directory contains unit tests.
+
+The unit tests are enabled by default, if you want to disable them (not
+recommended!) then use the `-DENABLE_TESTS=OFF` cmake option.
+
+
+## Writing Tests
+
+- The test files should end with `_test.cc` suffix.
+- Use the boost test framework, see the [documentation](
+https://www.boost.org/doc/libs/release/libs/test/doc/html/index.html).
+
+
+## Running the Tests
+
+Run `make test`. If some some test fails and you need to get more details
+then directly run the test binary from `build/tests` directory, it will print
+the details on the console.
+
+
+## Code Coverage
+
+The code coverage reporting can be enabled using the `-DENABLE_CODE_COVERAGE=ON`
+cmake option or using the `make -f Makefile.cvs COVERAGE=1` initial call.
+The `lcov` package needs to be installed.
+
+To print the code coverage run `make`, `make test` and `make coverage`.
+There is an additional all-in-one target which build the sources, runs the tests
+and prints the code coverage - simply run `make tests`.
+
+The code coverage summary will be displayed on the console. If you need more
+details (e.g. which lines are covered) then open the `coverage/index.html`
+file in a web browser.
1
0
Hello community,
here is the log from the commit of package libyui-qt-graph for openSUSE:Factory checked in at 2018-08-02 14:55:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-qt-graph (Old)
and /work/SRC/openSUSE:Factory/.libyui-qt-graph.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt-graph"
Thu Aug 2 14:55:46 2018 rev:19 rq:626478 version:2.44.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-qt-graph/libyui-qt-graph.changes 2018-05-29 16:46:12.761203006 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-qt-graph.new/libyui-qt-graph.changes 2018-08-02 14:55:49.852044643 +0200
@@ -1,0 +2,7 @@
+Mon Jul 30 11:59:59 UTC 2018 - lslezak(a)suse.cz
+
+- Update the version to match the other packages (improvement
+ for handling big disks, bsc#991090)
+- 2.44.9
+
+-------------------------------------------------------------------
Old:
----
libyui-qt-graph-2.44.8.tar.bz2
New:
----
libyui-qt-graph-2.44.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-qt-graph-doc.spec ++++++
--- /var/tmp/diff_new_pack.VxnKSp/_old 2018-08-02 14:55:50.236045286 +0200
+++ /var/tmp/diff_new_pack.VxnKSp/_new 2018-08-02 14:55:50.240045292 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt-graph
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.44.8
+Version: 2.44.9
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui-qt-graph.spec ++++++
--- /var/tmp/diff_new_pack.VxnKSp/_old 2018-08-02 14:55:50.260045326 +0200
+++ /var/tmp/diff_new_pack.VxnKSp/_new 2018-08-02 14:55:50.264045332 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt-graph
-Version: 2.44.8
+Version: 2.44.9
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
BuildRequires: cmake >= 2.8
++++++ libyui-qt-graph-2.44.8.tar.bz2 -> libyui-qt-graph-2.44.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-graph-2.44.8/VERSION.cmake new/libyui-qt-graph-2.44.9/VERSION.cmake
--- old/libyui-qt-graph-2.44.8/VERSION.cmake 2018-05-25 11:48:52.000000000 +0200
+++ new/libyui-qt-graph-2.44.9/VERSION.cmake 2018-07-30 14:47:39.000000000 +0200
@@ -1,6 +1,6 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "44")
-SET(VERSION_PATCH "8")
+SET(VERSION_PATCH "9")
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
##### This is need for the libyui core, ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-graph-2.44.8/package/libyui-qt-graph-doc.spec new/libyui-qt-graph-2.44.9/package/libyui-qt-graph-doc.spec
--- old/libyui-qt-graph-2.44.8/package/libyui-qt-graph-doc.spec 2018-05-25 11:48:52.000000000 +0200
+++ new/libyui-qt-graph-2.44.9/package/libyui-qt-graph-doc.spec 2018-07-30 14:47:39.000000000 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt-graph
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.44.8
+Version: 2.44.9
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-graph-2.44.8/package/libyui-qt-graph.changes new/libyui-qt-graph-2.44.9/package/libyui-qt-graph.changes
--- old/libyui-qt-graph-2.44.8/package/libyui-qt-graph.changes 2018-05-25 11:48:52.000000000 +0200
+++ new/libyui-qt-graph-2.44.9/package/libyui-qt-graph.changes 2018-07-30 14:47:39.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Jul 30 11:59:59 UTC 2018 - lslezak(a)suse.cz
+
+- Update the version to match the other packages (improvement
+ for handling big disks, bsc#991090)
+- 2.44.9
+
+-------------------------------------------------------------------
Fri May 25 09:11:36 UTC 2018 - igonzalezsosa(a)suse.com
- Drop qt5_use_modules (related to bsc#1091286).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-graph-2.44.8/package/libyui-qt-graph.spec new/libyui-qt-graph-2.44.9/package/libyui-qt-graph.spec
--- old/libyui-qt-graph-2.44.8/package/libyui-qt-graph.spec 2018-05-25 11:48:52.000000000 +0200
+++ new/libyui-qt-graph-2.44.9/package/libyui-qt-graph.spec 2018-07-30 14:47:39.000000000 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt-graph
-Version: 2.44.8
+Version: 2.44.9
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
BuildRequires: cmake >= 2.8
1
0
Hello community,
here is the log from the commit of package salt for openSUSE:Factory checked in at 2018-08-02 14:55:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/salt (Old)
and /work/SRC/openSUSE:Factory/.salt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt"
Thu Aug 2 14:55:36 2018 rev:79 rq:626474 version:2018.3.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/salt/salt.changes 2018-05-17 18:07:15.487843746 +0200
+++ /work/SRC/openSUSE:Factory/.salt.new/salt.changes 2018-08-02 14:55:43.928034731 +0200
@@ -1,0 +2,55 @@
+Mon Jul 30 10:42:01 UTC 2018 - mihai.dinca(a)suse.com
+
+- Update to 2018.3.2
+ See https://docs.saltstack.com/en/latest/topics/releases/2018.3.2.html
+ for full changelog
+
+- Added:
+ * accounting-for-when-files-in-an-archive-contain-non-.patch
+ * add-all_versions-parameter-to-include-all-installed-.patch
+ * add-custom-suse-capabilities-as-grains.patch
+ * add-engine-relaying-libvirt-events.patch
+ * add-environment-variable-to-know-if-yum-is-invoked-f.patch
+ * add-other-attribute-to-gecos-fields-to-avoid-inconsi.patch
+ * align-suse-salt-master.service-limitnofiles-limit-wi.patch
+ * avoid-incomprehensive-message-if-crashes.patch
+ * fix-deprecation-warning-bsc-1095507.patch
+ * fix-diffing-binary-files-in-file.get_diff-bsc-109839.patch
+ * fix-unboundlocalerror-in-file.get_diff.patch
+ * fix-zypper.list_pkgs-to-be-aligned-with-pkg-state.patch
+ * prevent-zypper-from-parsing-repo-configuration-from-.patch
+ * remove-old-hack-when-reporting-multiversion-packages.patch
+ * show-recommendations-for-salt-ssh-cross-version-pyth.patch
+
+- Modified:
+ * activate-all-beacons-sources-config-pillar-grains.patch
+ * add-saltssh-multi-version-support-across-python-inte.patch
+ * avoid-excessive-syslogging-by-watchdog-cronjob-58.patch
+ * do-not-override-jid-on-returners-only-sending-back-t.patch
+ * enable-passing-a-unix_socket-for-mysql-returners-bsc.patch
+ * fall-back-to-pymysql.patch
+ * feat-add-grain-for-all-fqdns.patch
+ * fix-bsc-1065792.patch
+ * fix-decrease-loglevel-when-unable-to-resolve-addr.patch
+ * fix-for-ec2-rate-limit-failures.patch
+ * fix-for-errno-0-resolver-error-0-no-error-bsc-108758.patch
+ * fixed-usage-of-ipaddress.patch
+ * option-to-merge-current-pillar-with-opts-pillar-duri.patch
+ * run-salt-api-as-user-salt-bsc-1064520.patch
+ * run-salt-master-as-dedicated-salt-user.patch
+ * strip-trailing-commas-on-linux-user-gecos-fields.patch
+
+- Deleted:
+ * explore-module.run-response-to-catch-the-result-in-d.patch
+ * extra-filerefs-include-files-even-if-no-refs-in-stat.patch
+ * fix-cp.push-empty-file.patch
+ * fix-for-sorting-of-multi-version-packages-bsc-109717.patch
+ * fix-openscap-push.patch
+ * initialize-__context__-retcode-for-functions-handled.patch
+ * make-it-possible-to-use-login-pull-and-push-from-mod.patch
+ * move-log_file-option-to-changeable-defaults.patch
+ * provide-kwargs-to-pkg_resource.parse_targets-require.patch
+ * remove-obsolete-unicode-handling-in-pkg.info_install.patch
+
+
+-------------------------------------------------------------------
Old:
----
explore-module.run-response-to-catch-the-result-in-d.patch
extra-filerefs-include-files-even-if-no-refs-in-stat.patch
fix-cp.push-empty-file.patch
fix-openscap-push.patch
initialize-__context__-retcode-for-functions-handled.patch
make-it-possible-to-use-login-pull-and-push-from-mod.patch
move-log_file-option-to-changeable-defaults.patch
provide-kwargs-to-pkg_resource.parse_targets-require.patch
remove-obsolete-unicode-handling-in-pkg.info_install.patch
v2018.3.0.tar.gz
New:
----
accounting-for-when-files-in-an-archive-contain-non-.patch
add-all_versions-parameter-to-include-all-installed-.patch
add-custom-suse-capabilities-as-grains.patch
add-engine-relaying-libvirt-events.patch
add-environment-variable-to-know-if-yum-is-invoked-f.patch
add-other-attribute-to-gecos-fields-to-avoid-inconsi.patch
align-suse-salt-master.service-limitnofiles-limit-wi.patch
avoid-incomprehensive-message-if-crashes.patch
fix-deprecation-warning-bsc-1095507.patch
fix-diffing-binary-files-in-file.get_diff-bsc-109839.patch
fix-unboundlocalerror-in-file.get_diff.patch
fix-zypper.list_pkgs-to-be-aligned-with-pkg-state.patch
prevent-zypper-from-parsing-repo-configuration-from-.patch
remove-old-hack-when-reporting-multiversion-packages.patch
show-recommendations-for-salt-ssh-cross-version-pyth.patch
v2018.3.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ salt.spec ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.124036732 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.128036738 +0200
@@ -1,7 +1,7 @@
#
# spec file for package salt
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
%if 0%{?suse_version} >= 1320
# SLE15
%global build_py3 1
@@ -52,7 +53,7 @@
%bcond_with builddocs
Name: salt
-Version: 2018.3.0
+Version: 2018.3.2
Release: 0
Summary: A parallel remote execution system
License: Apache-2.0
@@ -71,43 +72,60 @@
Patch4: avoid-excessive-syslogging-by-watchdog-cronjob-58.patch
Patch5: feat-add-grain-for-all-fqdns.patch
Patch6: fix-bsc-1065792.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46006
-Patch7: remove-obsolete-unicode-handling-in-pkg.info_install.patch
-Patch8: fix-openscap-push.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/45972
-Patch9: move-log_file-option-to-changeable-defaults.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46416
-Patch10: fix-cp.push-empty-file.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46575
-Patch11: fix-decrease-loglevel-when-unable-to-resolve-addr.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46643
-Patch12: make-it-possible-to-use-login-pull-and-push-from-mod.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46413
-Patch13: explore-module.run-response-to-catch-the-result-in-d.patch
+Patch7: fix-decrease-loglevel-when-unable-to-resolve-addr.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46684
-Patch14: add-saltssh-multi-version-support-across-python-inte.patch
+Patch8: add-saltssh-multi-version-support-across-python-inte.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46635
-Patch15: fix-for-errno-0-resolver-error-0-no-error-bsc-108758.patch
+Patch9: fix-for-errno-0-resolver-error-0-no-error-bsc-108758.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46890
-Patch16: fall-back-to-pymysql.patch
+Patch10: fall-back-to-pymysql.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47149
-Patch17: strip-trailing-commas-on-linux-user-gecos-fields.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47155
-Patch18: provide-kwargs-to-pkg_resource.parse_targets-require.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47270
-Patch19: initialize-__context__-retcode-for-functions-handled.patch
+Patch11: strip-trailing-commas-on-linux-user-gecos-fields.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47232
-Patch20: fixed-usage-of-ipaddress.patch
-# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47497
-Patch21: extra-filerefs-include-files-even-if-no-refs-in-stat.patch
+Patch12: fixed-usage-of-ipaddress.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47504
-Patch22: option-to-merge-current-pillar-with-opts-pillar-duri.patch
+Patch13: option-to-merge-current-pillar-with-opts-pillar-duri.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47471
-Patch23: do-not-override-jid-on-returners-only-sending-back-t.patch
+Patch14: do-not-override-jid-on-returners-only-sending-back-t.patch
# PATCH-FIX_OPENSUSE bsc#1091371
-Patch24: enable-passing-a-unix_socket-for-mysql-returners-bsc.patch
+Patch15: enable-passing-a-unix_socket-for-mysql-returners-bsc.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47211
-Patch25: fix-for-ec2-rate-limit-failures.patch
+Patch16: fix-for-ec2-rate-limit-failures.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47638
+Patch17: add-all_versions-parameter-to-include-all-installed-.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47765
+Patch18: prevent-zypper-from-parsing-repo-configuration-from-.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47149
+Patch19: add-other-attribute-to-gecos-fields-to-avoid-inconsi.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47908
+Patch20: align-suse-salt-master.service-limitnofiles-limit-wi.patch
+# PATCH-FIX_OPENSUSE bsc#1095507
+Patch21: fix-deprecation-warning-bsc-1095507.patch
+# PATCH-FIX_OPENSUSE bsc#1057635
+Patch22: add-environment-variable-to-know-if-yum-is-invoked-f.patch
+# PATCH-FIX_OPENSUSE
+Patch23: add-custom-suse-capabilities-as-grains.patch
+# PATCH-FIX_OPENSUSE bsc#1098394 https://github.com/saltstack/salt/pull/47061
+Patch24: fix-diffing-binary-files-in-file.get_diff-bsc-109839.patch
+# PATCH-FIX_OPENSUSE bsc#1072599
+Patch25: show-recommendations-for-salt-ssh-cross-version-pyth.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47405
+Patch26: fix-unboundlocalerror-in-file.get_diff.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/48294
+Patch27: fix-zypper.list_pkgs-to-be-aligned-with-pkg-state.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47572
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/48015
+Patch28: accounting-for-when-files-in-an-archive-contain-non-.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/48712
+Patch29: remove-old-hack-when-reporting-multiversion-packages.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46461
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46928
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/46957
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/47243
+Patch30: add-engine-relaying-libvirt-events.patch
+# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/48781
+Patch31: avoid-incomprehensive-message-if-crashes.patch
# BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -193,12 +211,12 @@
# requirements/base.txt
%if 0%{?rhel}
BuildRequires: python-jinja2
-BuildRequires: python-yaml
BuildRequires: python-markupsafe
+BuildRequires: python-yaml
%else
BuildRequires: python-Jinja2
-BuildRequires: python-PyYAML
BuildRequires: python-MarkupSafe
+BuildRequires: python-PyYAML
%endif
BuildRequires: python-futures >= 2.0
@@ -231,16 +249,16 @@
# requirements/base.txt
%if 0%{?rhel}
Requires: python-jinja2
-Requires: python-yaml
Requires: python-markupsafe
+Requires: python-yaml
Requires: yum
%if 0%{?rhel} == 6
Requires: yum-plugin-security
%endif
%else
Requires: python-Jinja2
-Requires: python-PyYAML
Requires: python-MarkupSafe
+Requires: python-PyYAML
%endif
Requires: python-futures >= 2.0
@@ -280,7 +298,7 @@
Group: System/Management
Requires: %{name} = %{version}-%{release}
BuildRequires: python-rpm-macros
-BuildRequires: python3
+BuildRequires: python3 < 3.7
BuildRequires: python3-devel
# requirements/base.txt
%if 0%{?rhel}
@@ -311,7 +329,7 @@
%if %{with builddocs}
BuildRequires: python3-sphinx
%endif
-Requires: python3
+Requires: python3 < 3.7
#
%if ! 0%{?suse_version} > 1110
Requires: python3-certifi
@@ -591,6 +609,12 @@
%patch23 -p1
%patch24 -p1
%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
%build
%if 0%{?build_py2}
@@ -1232,7 +1256,8 @@
%{_mandir}/man1/salt-call.1.gz
%{_mandir}/man1/spm.1.gz
%config(noreplace) %{_sysconfdir}/logrotate.d/salt
-%doc LICENSE AUTHORS README.rst HACKING.rst README.SUSE
+%license LICENSE
+%doc AUTHORS README.rst HACKING.rst README.SUSE
#
%dir %attr(0750, root, salt) %{_sysconfdir}/salt
%dir %attr(0750, root, salt) %{_sysconfdir}/salt/pki
++++++ _lastrevision ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.164036798 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.164036798 +0200
@@ -1 +1 @@
-d20075a576c1c9931e083798899099cde1a4109e
\ No newline at end of file
+eb0ca38e07c96eb021ac7490ac1f61a54dc9d904
++++++ _service ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.180036826 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.180036826 +0200
@@ -3,7 +3,7 @@
<param name="url">https://github.com/openSUSE/salt-packaging.git</param>
<param name="subdir">salt</param>
<param name="filename">package</param>
- <param name="revision">2018.3.0</param>
+ <param name="revision">2018.3.2</param>
<param name="scm">git</param>
</service>
<service name="extract_file" mode="disabled">
@@ -12,8 +12,8 @@
</service>
<service name="download_url" mode="disabled">
<param name="host">codeload.github.com</param>
- <param name="path">saltstack/salt/tar.gz/v2018.3.0</param>
- <param name="filename">v2018.3.0.tar.gz</param>
+ <param name="path">saltstack/salt/tar.gz/v2018.3.2</param>
+ <param name="filename">v2018.3.2.tar.gz</param>
</service>
<service name="update_changelog" mode="disabled"></service>
</services>
++++++ accounting-for-when-files-in-an-archive-contain-non-.patch ++++++
>From 5305ee8bf07e40dc54aefcbb92016ff868135749 Mon Sep 17 00:00:00 2001
From: "Gareth J. Greenaway" <gareth(a)wiked.org>
Date: Wed, 9 May 2018 09:33:58 -0700
Subject: [PATCH] Accounting for when files in an archive contain
non-ascii characters
Updating integration/modules/test_archive to include filenames with unicode characters.
only convert to bytes when using Python2
Updating with requested changes.
Ensure member names are decoded before adding to various lists.
Adding a test to ensure archive.list returns the right results when a tar file contains a file with unicode in it's name.
---
salt/modules/archive.py | 13 +++---
salt/states/archive.py | 4 +-
tests/integration/modules/test_archive.py | 52 ++++++++++++++++++++++-
3 files changed, 59 insertions(+), 10 deletions(-)
diff --git a/salt/modules/archive.py b/salt/modules/archive.py
index 48f0efa18e..76cd3eeb97 100644
--- a/salt/modules/archive.py
+++ b/salt/modules/archive.py
@@ -186,12 +186,13 @@ def list_(name,
else {'fileobj': cached.stdout, 'mode': 'r|'}
with contextlib.closing(tarfile.open(**open_kwargs)) as tar_archive:
for member in tar_archive.getmembers():
+ _member = salt.utils.data.decode(member.name)
if member.issym():
- links.append(member.name)
+ links.append(_member)
elif member.isdir():
- dirs.append(member.name + '/')
+ dirs.append(_member + '/')
else:
- files.append(member.name)
+ files.append(_member)
return dirs, files, links
except tarfile.ReadError:
@@ -410,9 +411,9 @@ def list_(name,
item.sort()
if verbose:
- ret = {'dirs': sorted(dirs),
- 'files': sorted(files),
- 'links': sorted(links)}
+ ret = {'dirs': sorted(salt.utils.data.decode_list(dirs)),
+ 'files': sorted(salt.utils.data.decode_list(files)),
+ 'links': sorted(salt.utils.data.decode_list(links))}
ret['top_level_dirs'] = [x for x in ret['dirs']
if x.count('/') == 1]
ret['top_level_files'] = [x for x in ret['files']
diff --git a/salt/states/archive.py b/salt/states/archive.py
index 847c5e9914..6838b2202d 100644
--- a/salt/states/archive.py
+++ b/salt/states/archive.py
@@ -1090,7 +1090,7 @@ def extracted(name,
and not stat.S_ISDIR(x)),
(contents['links'], stat.S_ISLNK)):
for path in path_list:
- full_path = os.path.join(name, path)
+ full_path = salt.utils.path.join(name, path)
try:
path_mode = os.lstat(full_path.rstrip(os.sep)).st_mode
if not func(path_mode):
@@ -1259,7 +1259,7 @@ def extracted(name,
if options is None:
try:
with closing(tarfile.open(cached, 'r')) as tar:
- tar.extractall(name)
+ tar.extractall(salt.utils.stringutils.to_str(name))
files = tar.getnames()
if trim_output:
files = files[:trim_output]
diff --git a/tests/integration/modules/test_archive.py b/tests/integration/modules/test_archive.py
index 59fe2f5f61..4301b9e3b0 100644
--- a/tests/integration/modules/test_archive.py
+++ b/tests/integration/modules/test_archive.py
@@ -47,7 +47,7 @@ class ArchiveTest(ModuleCase):
self.arch = os.path.join(self.base_path, 'archive.{0}'.format(arch_fmt))
self.dst = os.path.join(self.base_path, '{0}_dst_dir'.format(arch_fmt))
- def _set_up(self, arch_fmt):
+ def _set_up(self, arch_fmt, unicode_filename=False):
'''
Create source file tree and destination directory
@@ -62,7 +62,11 @@ class ArchiveTest(ModuleCase):
# Create source
os.makedirs(self.src)
- with salt.utils.files.fopen(os.path.join(self.src, 'file'), 'w') as theorem:
+ if unicode_filename:
+ filename = 'file®'
+ else:
+ filename = 'file'
+ with salt.utils.files.fopen(os.path.join(self.src, filename), 'w') as theorem:
theorem.write(textwrap.dedent(salt.utils.stringutils.to_str(r'''\
Compression theorem of computational complexity theory:
@@ -150,6 +154,50 @@ class ArchiveTest(ModuleCase):
self._tear_down()
+ @skipIf(not salt.utils.path.which('tar'), 'Cannot find tar executable')
+ def test_tar_pack_unicode(self):
+ '''
+ Validate using the tar function to create archives
+ '''
+ self._set_up(arch_fmt='tar', unicode_filename=True)
+
+ # Test create archive
+ ret = self.run_function('archive.tar', ['-cvf', self.arch], sources=self.src)
+ self.assertTrue(isinstance(ret, list), six.text_type(ret))
+ self._assert_artifacts_in_ret(ret)
+
+ self._tear_down()
+
+ @skipIf(not salt.utils.path.which('tar'), 'Cannot find tar executable')
+ def test_tar_unpack_unicode(self):
+ '''
+ Validate using the tar function to extract archives
+ '''
+ self._set_up(arch_fmt='tar', unicode_filename=True)
+ self.run_function('archive.tar', ['-cvf', self.arch], sources=self.src)
+
+ # Test extract archive
+ ret = self.run_function('archive.tar', ['-xvf', self.arch], dest=self.dst)
+ self.assertTrue(isinstance(ret, list), six.text_type(ret))
+ self._assert_artifacts_in_ret(ret)
+
+ self._tear_down()
+
+ @skipIf(not salt.utils.path.which('tar'), 'Cannot find tar executable')
+ def test_tar_list_unicode(self):
+ '''
+ Validate using the tar function to extract archives
+ '''
+ self._set_up(arch_fmt='tar', unicode_filename=True)
+ self.run_function('archive.tar', ['-cvf', self.arch], sources=self.src)
+
+ # Test list archive
+ ret = self.run_function('archive.list', name=self.arch)
+ self.assertTrue(isinstance(ret, list), six.text_type(ret))
+ self._assert_artifacts_in_ret(ret)
+
+ self._tear_down()
+
@skipIf(not salt.utils.path.which('gzip'), 'Cannot find gzip executable')
def test_gzip(self):
'''
--
2.17.1
++++++ activate-all-beacons-sources-config-pillar-grains.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.204036866 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.204036866 +0200
@@ -1,4 +1,4 @@
-From 957ac8fe161db2c4b3b8fe8b84027bc15e144a49 Mon Sep 17 00:00:00 2001
+From 5b48dee2f1b9a8203490e97620581b3a04d42632 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo(a)suse.de>
Date: Tue, 17 Oct 2017 16:52:33 +0200
Subject: [PATCH] Activate all beacons sources: config/pillar/grains
@@ -8,7 +8,7 @@
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/minion.py b/salt/minion.py
-index df69d3c7bd..4a30e70be5 100644
+index 9468695880..0a6771dccd 100644
--- a/salt/minion.py
+++ b/salt/minion.py
@@ -439,7 +439,7 @@ class MinionBase(object):
@@ -21,6 +21,6 @@
return self.beacons.process(b_conf, self.opts['grains']) # pylint: disable=no-member
return []
--
-2.16.2
+2.13.7
++++++ add-all_versions-parameter-to-include-all-installed-.patch ++++++
>From 9de54cf6f7d8d6da4212842fef8c4c658a2a9b9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Mon, 14 May 2018 11:33:13 +0100
Subject: [PATCH] Add "all_versions" parameter to include all installed
version on rpm.info
Enable "all_versions" parameter for zypper.info_installed
Enable "all_versions" parameter for yumpkg.info_installed
Prevent adding failed packages when pkg name contains the arch (on SUSE)
Add 'all_versions' documentation for info_installed on yum/zypper modules
Add unit tests for info_installed with all_versions
Refactor: use dict.setdefault instead if-else statement
Allow removing only specific package versions with zypper and yum
---
salt/modules/rpm.py | 18 ++++++++---
salt/modules/yumpkg.py | 49 ++++++++++++++++++++++--------
salt/modules/zypper.py | 64 ++++++++++++++++++++++++++++++++-------
salt/states/pkg.py | 33 +++++++++++++++++++-
tests/unit/modules/test_yumpkg.py | 50 ++++++++++++++++++++++++++++++
tests/unit/modules/test_zypper.py | 50 ++++++++++++++++++++++++++++++
6 files changed, 236 insertions(+), 28 deletions(-)
diff --git a/salt/modules/rpm.py b/salt/modules/rpm.py
index d065f1e2d9..3683234f59 100644
--- a/salt/modules/rpm.py
+++ b/salt/modules/rpm.py
@@ -453,7 +453,7 @@ def diff(package, path):
return res
-def info(*packages, **attr):
+def info(*packages, **kwargs):
'''
Return a detailed package(s) summary information.
If no packages specified, all packages will be returned.
@@ -467,6 +467,9 @@ def info(*packages, **attr):
version, vendor, release, build_date, build_date_time_t, install_date, install_date_time_t,
build_host, group, source_rpm, arch, epoch, size, license, signature, packager, url, summary, description.
+ :param all_versions:
+ Return information for all installed versions of the packages
+
:return:
CLI example:
@@ -476,7 +479,9 @@ def info(*packages, **attr):
salt '*' lowpkg.info apache2 bash
salt '*' lowpkg.info apache2 bash attr=version
salt '*' lowpkg.info apache2 bash attr=version,build_date_iso,size
+ salt '*' lowpkg.info apache2 bash attr=version,build_date_iso,size all_versions=True
'''
+ all_versions = kwargs.get('all_versions', False)
# LONGSIZE is not a valid tag for all versions of rpm. If LONGSIZE isn't
# available, then we can just use SIZE for older versions. See Issue #31366.
rpm_tags = __salt__['cmd.run_stdout'](
@@ -516,7 +521,7 @@ def info(*packages, **attr):
"edition": "edition: %|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}\\n",
}
- attr = attr.get('attr', None) and attr['attr'].split(",") or None
+ attr = kwargs.get('attr', None) and kwargs['attr'].split(",") or None
query = list()
if attr:
for attr_k in attr:
@@ -610,8 +615,13 @@ def info(*packages, **attr):
if pkg_name.startswith('gpg-pubkey'):
continue
if pkg_name not in ret:
- ret[pkg_name] = pkg_data.copy()
- del ret[pkg_name]['edition']
+ if all_versions:
+ ret[pkg_name] = [pkg_data.copy()]
+ else:
+ ret[pkg_name] = pkg_data.copy()
+ del ret[pkg_name]['edition']
+ elif all_versions:
+ ret[pkg_name].append(pkg_data.copy())
return ret
diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py
index 747142264d..9ce4926790 100644
--- a/salt/modules/yumpkg.py
+++ b/salt/modules/yumpkg.py
@@ -994,31 +994,39 @@ def list_downloaded():
return ret
-def info_installed(*names):
+def info_installed(*names, **kwargs):
'''
.. versionadded:: 2015.8.1
Return the information of the named package(s), installed on the system.
+ :param all_versions:
+ Include information for all versions of the packages installed on the minion.
+
CLI example:
.. code-block:: bash
salt '*' pkg.info_installed <package1>
salt '*' pkg.info_installed <package1> <package2> <package3> ...
+ salt '*' pkg.info_installed <package1> <package2> <package3> all_versions=True
'''
+ all_versions = kwargs.get('all_versions', False)
ret = dict()
- for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names).items():
- t_nfo = dict()
- # Translate dpkg-specific keys to a common structure
- for key, value in pkg_nfo.items():
- if key == 'source_rpm':
- t_nfo['source'] = value
+ for pkg_name, pkgs_nfo in __salt__['lowpkg.info'](*names, **kwargs).items():
+ pkg_nfo = pkgs_nfo if all_versions else [pkgs_nfo]
+ for _nfo in pkg_nfo:
+ t_nfo = dict()
+ # Translate dpkg-specific keys to a common structure
+ for key, value in _nfo.items():
+ if key == 'source_rpm':
+ t_nfo['source'] = value
+ else:
+ t_nfo[key] = value
+ if not all_versions:
+ ret[pkg_name] = t_nfo
else:
- t_nfo[key] = value
-
- ret[pkg_name] = t_nfo
-
+ ret.setdefault(pkg_name, []).append(t_nfo)
return ret
@@ -1919,7 +1927,24 @@ def remove(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
raise CommandExecutionError(exc)
old = list_pkgs()
- targets = [x for x in pkg_params if x in old]
+ targets = []
+ for target in pkg_params:
+ # Check if package version set to be removed is actually installed:
+ # old[target] contains a comma-separated list of installed versions
+ if target in old and not pkg_params[target]:
+ targets.append(target)
+ elif target in old and pkg_params[target] in old[target].split(','):
+ arch = ''
+ pkgname = target
+ try:
+ namepart, archpart = target.rsplit('.', 1)
+ except ValueError:
+ pass
+ else:
+ if archpart in salt.utils.pkg.rpm.ARCHES:
+ arch = '.' + archpart
+ pkgname = namepart
+ targets.append('{0}-{1}{2}'.format(pkgname, pkg_params[target], arch))
if not targets:
return {}
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 668143bdd9..06f8335c18 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -470,28 +470,37 @@ def info_installed(*names, **kwargs):
Valid attributes are:
ignore, report
+ :param all_versions:
+ Include information for all versions of the packages installed on the minion.
+
CLI example:
.. code-block:: bash
salt '*' pkg.info_installed <package1>
salt '*' pkg.info_installed <package1> <package2> <package3> ...
- salt '*' pkg.info_installed <package1> attr=version,vendor
+ salt '*' pkg.info_installed <package1> <package2> <package3> all_versions=True
+ salt '*' pkg.info_installed <package1> attr=version,vendor all_versions=True
salt '*' pkg.info_installed <package1> <package2> <package3> ... attr=version,vendor
salt '*' pkg.info_installed <package1> <package2> <package3> ... attr=version,vendor errors=ignore
salt '*' pkg.info_installed <package1> <package2> <package3> ... attr=version,vendor errors=report
'''
+ all_versions = kwargs.get('all_versions', False)
ret = dict()
- for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names, **kwargs).items():
- t_nfo = dict()
- # Translate dpkg-specific keys to a common structure
- for key, value in six.iteritems(pkg_nfo):
- if key == 'source_rpm':
- t_nfo['source'] = value
+ for pkg_name, pkgs_nfo in __salt__['lowpkg.info'](*names, **kwargs).items():
+ pkg_nfo = pkgs_nfo if all_versions else [pkgs_nfo]
+ for _nfo in pkg_nfo:
+ t_nfo = dict()
+ # Translate dpkg-specific keys to a common structure
+ for key, value in six.iteritems(_nfo):
+ if key == 'source_rpm':
+ t_nfo['source'] = value
+ else:
+ t_nfo[key] = value
+ if not all_versions:
+ ret[pkg_name] = t_nfo
else:
- t_nfo[key] = value
- ret[pkg_name] = t_nfo
-
+ ret.setdefault(pkg_name, []).append(t_nfo)
return ret
@@ -1494,7 +1503,14 @@ def _uninstall(name=None, pkgs=None):
raise CommandExecutionError(exc)
old = list_pkgs()
- targets = [target for target in pkg_params if target in old]
+ targets = []
+ for target in pkg_params:
+ # Check if package version set to be removed is actually installed:
+ # old[target] contains a comma-separated list of installed versions
+ if target in old and pkg_params[target] in old[target].split(','):
+ targets.append(target + "-" + pkg_params[target])
+ elif target in old and not pkg_params[target]:
+ targets.append(target)
if not targets:
return {}
@@ -1517,6 +1533,32 @@ def _uninstall(name=None, pkgs=None):
return ret
+def normalize_name(name):
+ '''
+ Strips the architecture from the specified package name, if necessary.
+ Circumstances where this would be done include:
+
+ * If the arch is 32 bit and the package name ends in a 32-bit arch.
+ * If the arch matches the OS arch, or is ``noarch``.
+
+ CLI Example:
+
+ .. code-block:: bash
+
+ salt '*' pkg.normalize_name zsh.x86_64
+ '''
+ try:
+ arch = name.rsplit('.', 1)[-1]
+ if arch not in salt.utils.pkg.rpm.ARCHES + ('noarch',):
+ return name
+ except ValueError:
+ return name
+ if arch in (__grains__['osarch'], 'noarch') \
+ or salt.utils.pkg.rpm.check_32(arch, osarch=__grains__['osarch']):
+ return name[:-(len(arch) + 1)]
+ return name
+
+
def remove(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
diff --git a/salt/states/pkg.py b/salt/states/pkg.py
index 2682ee17f9..ed405cb6b5 100644
--- a/salt/states/pkg.py
+++ b/salt/states/pkg.py
@@ -415,6 +415,16 @@ def _find_remove_targets(name=None,
if __grains__['os'] == 'FreeBSD' and origin:
cver = [k for k, v in six.iteritems(cur_pkgs) if v['origin'] == pkgname]
+ elif __grains__['os_family'] == 'Suse':
+ # On SUSE systems. Zypper returns packages without "arch" in name
+ try:
+ namepart, archpart = pkgname.rsplit('.', 1)
+ except ValueError:
+ cver = cur_pkgs.get(pkgname, [])
+ else:
+ if archpart in salt.utils.pkg.rpm.ARCHES + ("noarch",):
+ pkgname = namepart
+ cver = cur_pkgs.get(pkgname, [])
else:
cver = cur_pkgs.get(pkgname, [])
@@ -844,6 +854,17 @@ def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
cver = new_pkgs.get(pkgname.split('%')[0])
elif __grains__['os_family'] == 'Debian':
cver = new_pkgs.get(pkgname.split('=')[0])
+ elif __grains__['os_family'] == 'Suse':
+ # On SUSE systems. Zypper returns packages without "arch" in name
+ try:
+ namepart, archpart = pkgname.rsplit('.', 1)
+ except ValueError:
+ cver = new_pkgs.get(pkgname)
+ else:
+ if archpart in salt.utils.pkg.rpm.ARCHES + ("noarch",):
+ cver = new_pkgs.get(namepart)
+ else:
+ cver = new_pkgs.get(pkgname)
else:
cver = new_pkgs.get(pkgname)
if not cver and pkgname in new_caps:
@@ -2674,7 +2695,17 @@ def _uninstall(
changes = __salt__['pkg.{0}'.format(action)](name, pkgs=pkgs, version=version, **kwargs)
new = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
- failed = [x for x in pkg_params if x in new]
+ failed = []
+ for x in pkg_params:
+ if __grains__['os_family'] in ['Suse', 'RedHat']:
+ # Check if the package version set to be removed is actually removed:
+ if x in new and not pkg_params[x]:
+ failed.append(x)
+ elif x in new and pkg_params[x] in new[x]:
+ failed.append(x + "-" + pkg_params[x])
+ elif x in new:
+ failed.append(x)
+
if action == 'purge':
new_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
removed=True,
diff --git a/tests/unit/modules/test_yumpkg.py b/tests/unit/modules/test_yumpkg.py
index 28b6e1294c..c73f2582b9 100644
--- a/tests/unit/modules/test_yumpkg.py
+++ b/tests/unit/modules/test_yumpkg.py
@@ -601,3 +601,53 @@ class YumTestCase(TestCase, LoaderModuleMockMixin):
'--branch=foo', '--exclude=kernel*', 'upgrade'],
output_loglevel='trace',
python_shell=False)
+
+ def test_info_installed_with_all_versions(self):
+ '''
+ Test the return information of all versions for the named package(s), installed on the system.
+
+ :return:
+ '''
+ run_out = {
+ 'virgo-dummy': [
+ {'build_date': '2015-07-09T10:55:19Z',
+ 'vendor': 'openSUSE Build Service',
+ 'description': 'This is the Virgo dummy package used for testing SUSE Manager',
+ 'license': 'GPL-2.0', 'build_host': 'sheep05', 'url': 'http://www.suse.com',
+ 'build_date_time_t': 1436432119, 'relocations': '(not relocatable)',
+ 'source_rpm': 'virgo-dummy-1.0-1.1.src.rpm', 'install_date': '2016-02-23T16:31:57Z',
+ 'install_date_time_t': 1456241517, 'summary': 'Virgo dummy package', 'version': '1.0',
+ 'signature': 'DSA/SHA1, Thu Jul 9 08:55:33 2015, Key ID 27fa41bd8a7c64f9',
+ 'release': '1.1', 'group': 'Applications/System', 'arch': 'i686', 'size': '17992'},
+ {'build_date': '2015-07-09T10:15:19Z',
+ 'vendor': 'openSUSE Build Service',
+ 'description': 'This is the Virgo dummy package used for testing SUSE Manager',
+ 'license': 'GPL-2.0', 'build_host': 'sheep05', 'url': 'http://www.suse.com',
+ 'build_date_time_t': 1436432119, 'relocations': '(not relocatable)',
+ 'source_rpm': 'virgo-dummy-1.0-1.1.src.rpm', 'install_date': '2016-02-23T16:31:57Z',
+ 'install_date_time_t': 14562415127, 'summary': 'Virgo dummy package', 'version': '1.0',
+ 'signature': 'DSA/SHA1, Thu Jul 9 08:55:33 2015, Key ID 27fa41bd8a7c64f9',
+ 'release': '1.1', 'group': 'Applications/System', 'arch': 'x86_64', 'size': '13124'}
+ ],
+ 'libopenssl1_0_0': [
+ {'build_date': '2015-11-04T23:20:34Z', 'vendor': 'SUSE LLC <https://www.suse.com/>',
+ 'description': 'The OpenSSL Project is a collaborative effort.',
+ 'license': 'OpenSSL', 'build_host': 'sheep11', 'url': 'https://www.openssl.org/',
+ 'build_date_time_t': 1446675634, 'relocations': '(not relocatable)',
+ 'source_rpm': 'openssl-1.0.1i-34.1.src.rpm', 'install_date': '2016-02-23T16:31:35Z',
+ 'install_date_time_t': 1456241495, 'summary': 'Secure Sockets and Transport Layer Security',
+ 'version': '1.0.1i', 'signature': 'RSA/SHA256, Wed Nov 4 22:21:34 2015, Key ID 70af9e8139db7c82',
+ 'release': '34.1', 'group': 'Productivity/Networking/Security', 'packager': 'https://www.suse.com/',
+ 'arch': 'x86_64', 'size': '2576912'}
+ ]
+ }
+ with patch.dict(yumpkg.__salt__, {'lowpkg.info': MagicMock(return_value=run_out)}):
+ installed = yumpkg.info_installed(all_versions=True)
+ # Test overall products length
+ self.assertEqual(len(installed), 2)
+
+ # Test multiple versions for the same package
+ for pkg_name, pkg_info_list in installed.items():
+ self.assertEqual(len(pkg_info_list), 2 if pkg_name == "virgo-dummy" else 1)
+ for info in pkg_info_list:
+ self.assertTrue(info['arch'] in ('x86_64', 'i686'))
diff --git a/tests/unit/modules/test_zypper.py b/tests/unit/modules/test_zypper.py
index 539a950252..6eccee568b 100644
--- a/tests/unit/modules/test_zypper.py
+++ b/tests/unit/modules/test_zypper.py
@@ -327,6 +327,56 @@ class ZypperTestCase(TestCase, LoaderModuleMockMixin):
installed = zypper.info_installed()
self.assertEqual(installed['vīrgô']['description'], 'vīrgô d€šçripţiǫñ')
+ def test_info_installed_with_all_versions(self):
+ '''
+ Test the return information of all versions for the named package(s), installed on the system.
+
+ :return:
+ '''
+ run_out = {
+ 'virgo-dummy': [
+ {'build_date': '2015-07-09T10:55:19Z',
+ 'vendor': 'openSUSE Build Service',
+ 'description': 'This is the Virgo dummy package used for testing SUSE Manager',
+ 'license': 'GPL-2.0', 'build_host': 'sheep05', 'url': 'http://www.suse.com',
+ 'build_date_time_t': 1436432119, 'relocations': '(not relocatable)',
+ 'source_rpm': 'virgo-dummy-1.0-1.1.src.rpm', 'install_date': '2016-02-23T16:31:57Z',
+ 'install_date_time_t': 1456241517, 'summary': 'Virgo dummy package', 'version': '1.0',
+ 'signature': 'DSA/SHA1, Thu Jul 9 08:55:33 2015, Key ID 27fa41bd8a7c64f9',
+ 'release': '1.1', 'group': 'Applications/System', 'arch': 'i686', 'size': '17992'},
+ {'build_date': '2015-07-09T10:15:19Z',
+ 'vendor': 'openSUSE Build Service',
+ 'description': 'This is the Virgo dummy package used for testing SUSE Manager',
+ 'license': 'GPL-2.0', 'build_host': 'sheep05', 'url': 'http://www.suse.com',
+ 'build_date_time_t': 1436432119, 'relocations': '(not relocatable)',
+ 'source_rpm': 'virgo-dummy-1.0-1.1.src.rpm', 'install_date': '2016-02-23T16:31:57Z',
+ 'install_date_time_t': 14562415127, 'summary': 'Virgo dummy package', 'version': '1.0',
+ 'signature': 'DSA/SHA1, Thu Jul 9 08:55:33 2015, Key ID 27fa41bd8a7c64f9',
+ 'release': '1.1', 'group': 'Applications/System', 'arch': 'x86_64', 'size': '13124'}
+ ],
+ 'libopenssl1_0_0': [
+ {'build_date': '2015-11-04T23:20:34Z', 'vendor': 'SUSE LLC <https://www.suse.com/>',
+ 'description': 'The OpenSSL Project is a collaborative effort.',
+ 'license': 'OpenSSL', 'build_host': 'sheep11', 'url': 'https://www.openssl.org/',
+ 'build_date_time_t': 1446675634, 'relocations': '(not relocatable)',
+ 'source_rpm': 'openssl-1.0.1i-34.1.src.rpm', 'install_date': '2016-02-23T16:31:35Z',
+ 'install_date_time_t': 1456241495, 'summary': 'Secure Sockets and Transport Layer Security',
+ 'version': '1.0.1i', 'signature': 'RSA/SHA256, Wed Nov 4 22:21:34 2015, Key ID 70af9e8139db7c82',
+ 'release': '34.1', 'group': 'Productivity/Networking/Security', 'packager': 'https://www.suse.com/',
+ 'arch': 'x86_64', 'size': '2576912'}
+ ]
+ }
+ with patch.dict(zypper.__salt__, {'lowpkg.info': MagicMock(return_value=run_out)}):
+ installed = zypper.info_installed(all_versions=True)
+ # Test overall products length
+ self.assertEqual(len(installed), 2)
+
+ # Test multiple versions for the same package
+ for pkg_name, pkg_info_list in installed.items():
+ self.assertEqual(len(pkg_info_list), 2 if pkg_name == "virgo-dummy" else 1)
+ for info in pkg_info_list:
+ self.assertTrue(info['arch'] in ('x86_64', 'i686'))
+
def test_info_available(self):
'''
Test return the information of the named package available for the system.
--
2.13.7
++++++ add-custom-suse-capabilities-as-grains.patch ++++++
>From b02aee33a3aa1676cbfdf3a0ed936eef8a40adfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Thu, 21 Jun 2018 11:57:57 +0100
Subject: [PATCH] Add custom SUSE capabilities as Grains
---
salt/grains/extra.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/salt/grains/extra.py b/salt/grains/extra.py
index fff70e9f5b..4fb58674bf 100644
--- a/salt/grains/extra.py
+++ b/salt/grains/extra.py
@@ -75,3 +75,10 @@ def config():
log.warning("Bad syntax in grains file! Skipping.")
return {}
return {}
+
+
+def suse_backported_capabilities():
+ return {
+ '__suse_reserved_pkg_all_versions_support': True,
+ '__suse_reserved_pkg_patches_support': True
+ }
--
2.13.7
++++++ add-engine-relaying-libvirt-events.patch ++++++
++++ 894 lines (skipped)
++++++ add-environment-variable-to-know-if-yum-is-invoked-f.patch ++++++
>From 39d9d9fb26f9aff83fce4ce67d5b2a6bd4f60b95 Mon Sep 17 00:00:00 2001
From: Marcelo Chiaradia <mchiaradia(a)suse.com>
Date: Thu, 7 Jun 2018 10:29:41 +0200
Subject: [PATCH] Add environment variable to know if yum is invoked from
Salt(bsc#1057635)
---
salt/modules/yumpkg.py | 59 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 39 insertions(+), 20 deletions(-)
diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py
index 9ce4926790..51832bf883 100644
--- a/salt/modules/yumpkg.py
+++ b/salt/modules/yumpkg.py
@@ -452,7 +452,8 @@ def latest_version(*names, **kwargs):
out = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
if out['retcode'] != 0:
if out['stderr']:
# Check first if this is just a matter of the packages being
@@ -850,7 +851,8 @@ def list_repo_pkgs(*args, **kwargs):
yum_version = None if _yum() != 'yum' else _LooseVersion(
__salt__['cmd.run'](
['yum', '--version'],
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
).splitlines()[0].strip()
)
# Really old version of yum; does not even have --showduplicates option
@@ -865,7 +867,8 @@ def list_repo_pkgs(*args, **kwargs):
cmd_prefix + [pkg_src],
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] == 0:
_parse_output(out['stdout'], strict=True)
@@ -882,7 +885,8 @@ def list_repo_pkgs(*args, **kwargs):
cmd_prefix + [pkg_src],
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] == 0:
_parse_output(out['stdout'], strict=True)
@@ -898,7 +902,8 @@ def list_repo_pkgs(*args, **kwargs):
out = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
if out['retcode'] != 0 and 'Error:' in out['stdout']:
continue
_parse_output(out['stdout'])
@@ -955,7 +960,8 @@ def list_upgrades(refresh=True, **kwargs):
out = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
if out['retcode'] != 0 and 'Error:' in out:
return {}
@@ -1090,12 +1096,13 @@ def refresh_db(**kwargs):
clean_cmd.extend(options)
update_cmd.extend(options)
- __salt__['cmd.run'](clean_cmd, python_shell=False)
+ __salt__['cmd.run'](clean_cmd, python_shell=False, env={"SALT_RUNNING": '1'})
if check_update_:
result = __salt__['cmd.retcode'](update_cmd,
output_loglevel='trace',
ignore_retcode=True,
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
return retcodes.get(result, False)
return True
@@ -1634,7 +1641,8 @@ def install(name=None,
cmd,
output_loglevel='trace',
python_shell=False,
- redirect_stderr=True
+ redirect_stderr=True,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] != 0:
errors.append(out['stdout'])
@@ -1654,7 +1662,8 @@ def install(name=None,
cmd,
output_loglevel='trace',
python_shell=False,
- redirect_stderr=True
+ redirect_stderr=True,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] != 0:
errors.append(out['stdout'])
@@ -1674,7 +1683,8 @@ def install(name=None,
cmd,
output_loglevel='trace',
python_shell=False,
- redirect_stderr=True
+ redirect_stderr=True,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] != 0:
errors.append(out['stdout'])
@@ -1866,7 +1876,8 @@ def upgrade(name=None,
result = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
__context__.pop('pkg.list_pkgs', None)
new = list_pkgs()
ret = salt.utils.data.compare_dicts(old, new)
@@ -1957,7 +1968,8 @@ def remove(name=None, pkgs=None, **kwargs): # pylint: disable=W0613
out = __salt__['cmd.run_all'](
[_yum(), '-y', 'remove'] + targets,
output_loglevel='trace',
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] != 0 and out['stderr']:
@@ -2094,7 +2106,8 @@ def hold(name=None, pkgs=None, sources=None, normalize=True, **kwargs): # pylin
else:
out = __salt__['cmd.run_all'](
[_yum(), 'versionlock', target],
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] == 0:
@@ -2203,7 +2216,8 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06
else:
out = __salt__['cmd.run_all'](
[_yum(), 'versionlock', 'delete'] + search_locks,
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
if out['retcode'] == 0:
@@ -2254,7 +2268,8 @@ def list_holds(pattern=__HOLD_PATTERN, full=True):
_check_versionlock()
out = __salt__['cmd.run']([_yum(), 'versionlock', 'list'],
- python_shell=False)
+ python_shell=False,
+ env={"SALT_RUNNING": '1'})
ret = []
for line in salt.utils.itertools.split(out, '\n'):
match = _get_hold(line, pattern=pattern, full=full)
@@ -2319,7 +2334,8 @@ def group_list():
out = __salt__['cmd.run_stdout'](
[_yum(), 'grouplist', 'hidden'],
output_loglevel='trace',
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
key = None
for line in salt.utils.itertools.split(out, '\n'):
@@ -2386,7 +2402,8 @@ def group_info(name, expand=False):
out = __salt__['cmd.run_stdout'](
cmd,
output_loglevel='trace',
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
g_info = {}
@@ -3055,7 +3072,8 @@ def download(*packages):
__salt__['cmd.run'](
cmd,
output_loglevel='trace',
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
ret = {}
for dld_result in os.listdir(CACHE_DIR):
@@ -3130,7 +3148,8 @@ def _get_patches(installed_only=False):
cmd = [_yum(), '--quiet', 'updateinfo', 'list', 'all']
ret = __salt__['cmd.run_stdout'](
cmd,
- python_shell=False
+ python_shell=False,
+ env={"SALT_RUNNING": '1'}
)
for line in salt.utils.itertools.split(ret, os.linesep):
inst, advisory_id, sev, pkg = re.match(r'([i|\s]) ([^\s]+) +([^\s]+) +([^\s]+)',
--
2.13.7
++++++ add-other-attribute-to-gecos-fields-to-avoid-inconsi.patch ++++++
>From cc8d6eaddf59973a94512779853558789b56ca3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Wed, 25 Apr 2018 12:55:36 +0100
Subject: [PATCH] Add 'other' attribute to GECOS fields to avoid
inconsistencies with chfn
Fix unsupported chars checking on GECOS fields
Add unit test for new method 'user.chother'
Do make comparisons in a single line
Add 'other' as valid kwargs for 'user.add' method
---
salt/modules/useradd.py | 41 ++++++++++++++++++++++++++++----------
salt/states/user.py | 28 ++++++++++++++++++--------
tests/unit/modules/test_useradd.py | 36 +++++++++++++++++++++++++++++++--
3 files changed, 84 insertions(+), 21 deletions(-)
diff --git a/salt/modules/useradd.py b/salt/modules/useradd.py
index a61ba0e960..fc3c82a8bc 100644
--- a/salt/modules/useradd.py
+++ b/salt/modules/useradd.py
@@ -60,17 +60,18 @@ def _get_gecos(name):
Retrieve GECOS field info and return it in dictionary form
'''
gecos_field = salt.utils.stringutils.to_unicode(
- pwd.getpwnam(_quote_username(name)).pw_gecos).split(',', 3)
+ pwd.getpwnam(_quote_username(name)).pw_gecos).split(',', 4)
if not gecos_field:
return {}
else:
# Assign empty strings for any unspecified trailing GECOS fields
- while len(gecos_field) < 4:
+ while len(gecos_field) < 5:
gecos_field.append('')
return {'fullname': salt.utils.locales.sdecode(gecos_field[0]),
'roomnumber': salt.utils.locales.sdecode(gecos_field[1]),
'workphone': salt.utils.locales.sdecode(gecos_field[2]),
- 'homephone': salt.utils.locales.sdecode(gecos_field[3])}
+ 'homephone': salt.utils.locales.sdecode(gecos_field[3]),
+ 'other': salt.utils.locales.sdecode(gecos_field[4])}
def _build_gecos(gecos_dict):
@@ -78,10 +79,11 @@ def _build_gecos(gecos_dict):
Accepts a dictionary entry containing GECOS field names and their values,
and returns a full GECOS comment string, to be used with usermod.
'''
- return '{0},{1},{2},{3}'.format(gecos_dict.get('fullname', ''),
- gecos_dict.get('roomnumber', ''),
- gecos_dict.get('workphone', ''),
- gecos_dict.get('homephone', '')).rstrip(',')
+ return '{0},{1},{2},{3},{4}'.format(gecos_dict.get('fullname', ''),
+ gecos_dict.get('roomnumber', ''),
+ gecos_dict.get('workphone', ''),
+ gecos_dict.get('homephone', ''),
+ gecos_dict.get('other', ''),).rstrip(',')
def _update_gecos(name, key, value, root=None):
@@ -124,6 +126,7 @@ def add(name,
roomnumber='',
workphone='',
homephone='',
+ other='',
createhome=True,
loginclass=None,
root=None,
@@ -237,6 +240,8 @@ def add(name,
chworkphone(name, workphone)
if homephone:
chhomephone(name, homephone)
+ if other:
+ chother(name, other)
return True
@@ -507,6 +512,19 @@ def chhomephone(name, homephone):
return _update_gecos(name, 'homephone', homephone)
+def chother(name, other):
+ '''
+ Change the user's other GECOS attribute
+
+ CLI Example:
+
+ .. code-block:: bash
+
+ salt '*' user.chother foobar
+ '''
+ return _update_gecos(name, 'other', other)
+
+
def chloginclass(name, loginclass, root=None):
'''
Change the default login class of the user
@@ -588,9 +606,9 @@ def _format_info(data):
Return user information in a pretty way
'''
# Put GECOS info into a list
- gecos_field = salt.utils.stringutils.to_unicode(data.pw_gecos).split(',', 3)
- # Make sure our list has at least four elements
- while len(gecos_field) < 4:
+ gecos_field = salt.utils.stringutils.to_unicode(data.pw_gecos).split(',', 4)
+ # Make sure our list has at least five elements
+ while len(gecos_field) < 5:
gecos_field.append('')
return {'gid': data.pw_gid,
@@ -603,7 +621,8 @@ def _format_info(data):
'fullname': gecos_field[0],
'roomnumber': gecos_field[1],
'workphone': gecos_field[2],
- 'homephone': gecos_field[3]}
+ 'homephone': gecos_field[3],
+ 'other': gecos_field[4]}
@salt.utils.decorators.path.which('id')
diff --git a/salt/states/user.py b/salt/states/user.py
index f4ae81dd31..34f5a9d541 100644
--- a/salt/states/user.py
+++ b/salt/states/user.py
@@ -68,6 +68,7 @@ def _changes(name,
roomnumber='',
workphone='',
homephone='',
+ other='',
loginclass=None,
date=None,
mindays=0,
@@ -170,24 +171,26 @@ def _changes(name,
# MacOS doesn't have full GECOS support, so check for the "ch" functions
# and ignore these parameters if these functions do not exist.
- if 'user.chroomnumber' in __salt__ \
- and roomnumber is not None:
+ if 'user.chroomnumber' in __salt__ and roomnumber is not None:
roomnumber = sdecode_if_string(roomnumber)
lusr['roomnumber'] = sdecode_if_string(lusr['roomnumber'])
if lusr['roomnumber'] != roomnumber:
change['roomnumber'] = roomnumber
- if 'user.chworkphone' in __salt__ \
- and workphone is not None:
+ if 'user.chworkphone' in __salt__ and workphone is not None:
workphone = sdecode_if_string(workphone)
lusr['workphone'] = sdecode_if_string(lusr['workphone'])
if lusr['workphone'] != workphone:
change['workphone'] = workphone
- if 'user.chhomephone' in __salt__ \
- and homephone is not None:
+ if 'user.chhomephone' in __salt__ and homephone is not None:
homephone = sdecode_if_string(homephone)
lusr['homephone'] = sdecode_if_string(lusr['homephone'])
if lusr['homephone'] != homephone:
change['homephone'] = homephone
+ if 'user.chother' in __salt__ and other is not None:
+ other = sdecode_if_string(other)
+ lusr['other'] = sdecode_if_string(lusr['other'])
+ if lusr['other'] != other:
+ change['other'] = other
# OpenBSD/FreeBSD login class
if __grains__['kernel'] in ('OpenBSD', 'FreeBSD'):
if loginclass:
@@ -236,6 +239,7 @@ def present(name,
roomnumber=None,
workphone=None,
homephone=None,
+ other=None,
loginclass=None,
date=None,
mindays=None,
@@ -377,7 +381,10 @@ def present(name,
homephone
The user's home phone number (not supported in MacOS)
- If GECOS field contains more than 3 commas, this field will have the rest of 'em
+
+ other
+ The user's other attribute (not supported in MacOS)
+ If GECOS field contains more than 4 commas, this field will have the rest of 'em
.. versionchanged:: 2014.7.0
Shadow attribute support added.
@@ -448,6 +455,8 @@ def present(name,
workphone = sdecode(workphone)
if homephone is not None:
homephone = sdecode(homephone)
+ if other is not None:
+ other = sdecode(other)
# createhome not supported on Windows or Mac
if __grains__['kernel'] in ('Darwin', 'Windows'):
@@ -460,7 +469,7 @@ def present(name,
# the comma is used to separate field in GECOS, thus resulting into
# salt adding the end of fullname each time this function is called
- for gecos_field in ['fullname', 'roomnumber', 'workphone']:
+ for gecos_field in [fullname, roomnumber, workphone]:
if isinstance(gecos_field, string_types) and ',' in gecos_field:
ret['comment'] = "Unsupported char ',' in {0}".format(gecos_field)
ret['result'] = False
@@ -519,6 +528,7 @@ def present(name,
roomnumber,
workphone,
homephone,
+ other,
loginclass,
date,
mindays,
@@ -654,6 +664,7 @@ def present(name,
roomnumber,
workphone,
homephone,
+ other,
loginclass,
date,
mindays,
@@ -705,6 +716,7 @@ def present(name,
'roomnumber': roomnumber,
'workphone': workphone,
'homephone': homephone,
+ 'other': other,
'createhome': createhome,
'nologinit': nologinit,
'loginclass': loginclass}
diff --git a/tests/unit/modules/test_useradd.py b/tests/unit/modules/test_useradd.py
index fa30a0df71..e79c78c663 100644
--- a/tests/unit/modules/test_useradd.py
+++ b/tests/unit/modules/test_useradd.py
@@ -46,7 +46,8 @@ class UserAddTestCase(TestCase, LoaderModuleMockMixin):
'fullname': 'root',
'roomnumber': '',
'workphone': '',
- 'homephone': ''}
+ 'homephone': '',
+ 'other': ''}
@classmethod
def tearDownClass(cls):
@@ -96,7 +97,8 @@ class UserAddTestCase(TestCase, LoaderModuleMockMixin):
'fullname': 'root',
'roomnumber': '',
'workphone': '',
- 'homephone': ''}]
+ 'homephone': '',
+ 'other': ''}]
with patch('salt.modules.useradd._format_info', MagicMock(return_value=self.mock_pwall)):
self.assertEqual(useradd.getent(), ret)
@@ -330,6 +332,36 @@ class UserAddTestCase(TestCase, LoaderModuleMockMixin):
with patch.object(useradd, 'info', mock):
self.assertFalse(useradd.chhomephone('salt', 1))
+ # 'chother' function tests: 1
+
+ def test_chother(self):
+ '''
+ Test if the user's other GECOS attribute is changed
+ '''
+ mock = MagicMock(return_value=False)
+ with patch.object(useradd, '_get_gecos', mock):
+ self.assertFalse(useradd.chother('salt', 1))
+
+ mock = MagicMock(return_value={'other': 'foobar'})
+ with patch.object(useradd, '_get_gecos', mock):
+ self.assertTrue(useradd.chother('salt', 'foobar'))
+
+ mock = MagicMock(return_value={'other': 'foobar2'})
+ with patch.object(useradd, '_get_gecos', mock):
+ mock = MagicMock(return_value=None)
+ with patch.dict(useradd.__salt__, {'cmd.run': mock}):
+ mock = MagicMock(return_value={'other': 'foobar3'})
+ with patch.object(useradd, 'info', mock):
+ self.assertFalse(useradd.chother('salt', 'foobar'))
+
+ mock = MagicMock(return_value={'other': 'foobar3'})
+ with patch.object(useradd, '_get_gecos', mock):
+ mock = MagicMock(return_value=None)
+ with patch.dict(useradd.__salt__, {'cmd.run': mock}):
+ mock = MagicMock(return_value={'other': 'foobar3'})
+ with patch.object(useradd, 'info', mock):
+ self.assertFalse(useradd.chother('salt', 'foobar'))
+
# 'info' function tests: 1
@skipIf(HAS_PWD is False, 'The pwd module is not available')
--
2.13.7
++++++ add-saltssh-multi-version-support-across-python-inte.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.248036939 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.252036946 +0200
@@ -1,4 +1,4 @@
-From 36bc22560e050b7afe3d872aed99c0cdb9fde282 Mon Sep 17 00:00:00 2001
+From 23aba97ccbdf9952f6a8107a8d90b40d0d2c41ee Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo(a)suse.de>
Date: Mon, 12 Mar 2018 12:01:39 +0100
Subject: [PATCH] Add SaltSSH multi-version support across Python
@@ -255,17 +255,15 @@
Set master_top_first to False by default
---
doc/topics/releases/fluorine.rst | 178 +++++++++++
- salt/client/ssh/__init__.py | 66 ++--
- salt/client/ssh/ssh_py_shim.py | 95 ++++--
+ salt/client/ssh/__init__.py | 60 ++--
+ salt/client/ssh/ssh_py_shim.py | 93 ++++--
salt/client/ssh/wrapper/__init__.py | 2 +-
salt/config/__init__.py | 1 +
- salt/modules/zfs.py | 4 +-
- salt/modules/zpool.py | 4 +-
salt/state.py | 2 +-
salt/utils/hashutils.py | 37 +++
salt/utils/thin.py | 450 +++++++++++++++++++-------
tests/unit/utils/test_thin.py | 612 ++++++++++++++++++++++++++++++++++++
- 11 files changed, 1265 insertions(+), 186 deletions(-)
+ 9 files changed, 1258 insertions(+), 177 deletions(-)
create mode 100644 doc/topics/releases/fluorine.rst
create mode 100644 tests/unit/utils/test_thin.py
@@ -454,10 +452,10 @@
+Salt version is also available on the Master machine, although does not need to be directly
+installed together with the older Python interpreter.
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py
-index f1c1ad9a22..399facf5c8 100644
+index 141e1c6850..f1300b5698 100644
--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
-@@ -150,14 +150,10 @@ EX_PYTHON_INVALID={EX_THIN_PYTHON_INVALID}
+@@ -150,9 +150,7 @@ EX_PYTHON_INVALID={EX_THIN_PYTHON_INVALID}
PYTHON_CMDS="python3 python27 python2.7 python26 python2.6 python2 python"
for py_cmd in $PYTHON_CMDS
do
@@ -466,16 +464,9 @@
- and sys.version_info[0] == {{HOST_PY_MAJOR}}));"
+ if command -v "$py_cmd" >/dev/null 2>&1 && "$py_cmd" -c "import sys; sys.exit(not (sys.version_info >= (2, 6)));"
then
-- py_cmd_path=`"$py_cmd" -c \
-- 'from __future__ import print_function;
-- import sys; print(sys.executable);'`
-- cmdpath=$(command -v $py_cmd 2>/dev/null || which $py_cmd 2>/dev/null)
-+ py_cmd_path=`"$py_cmd" -c 'from __future__ import print_function;import sys; print(sys.executable);'`
-+ cmdpath=`command -v $py_cmd 2>/dev/null || which $py_cmd 2>/dev/null`
- if file $cmdpath | grep "shell script" > /dev/null
- then
- ex_vars="'PATH', 'LD_LIBRARY_PATH', 'MANPATH', \
-@@ -323,7 +319,8 @@ class SSH(object):
+ py_cmd_path=`"$py_cmd" -c \
+ 'from __future__ import print_function;
+@@ -323,7 +321,8 @@ class SSH(object):
extra_mods=self.opts.get('thin_extra_mods'),
overwrite=self.opts['regen_thin'],
python2_bin=self.opts['python2_bin'],
@@ -485,7 +476,7 @@
self.mods = mod_data(self.fsclient)
def _get_roster(self):
-@@ -834,10 +831,10 @@ class Single(object):
+@@ -850,10 +849,10 @@ class Single(object):
self.opts = opts
self.tty = tty
@@ -499,7 +490,7 @@
if kwargs.get('thin_dir'):
self.thin_dir = kwargs['thin_dir']
elif self.winrm:
-@@ -1161,38 +1158,39 @@ class Single(object):
+@@ -1178,38 +1177,39 @@ class Single(object):
cachedir = self.opts['_caller_cachedir']
else:
cachedir = self.opts['cachedir']
@@ -563,7 +554,7 @@
if six.PY2:
py_code_enc = py_code.encode('base64')
diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py
-index e46220fc80..21d03343b9 100644
+index 5e5dbdc55e..92ede14930 100644
--- a/salt/client/ssh/ssh_py_shim.py
+++ b/salt/client/ssh/ssh_py_shim.py
@@ -16,11 +16,13 @@ import sys
@@ -597,7 +588,7 @@
ARGS = None
# The below line is where OPTIONS can be redefined with internal options
# (rather than cli arguments) when the shim is bundled by
-@@ -128,7 +129,7 @@ def need_deployment():
+@@ -130,7 +131,7 @@ def need_deployment():
os.chmod(OPTIONS.saltdir, stt.st_mode | stat.S_IWGRP | stat.S_IRGRP | stat.S_IXGRP)
except OSError:
sys.stdout.write('\n\nUnable to set permissions on thin directory.\nIf sudo_user is set '
@@ -606,15 +597,14 @@
sys.exit(1)
# Delimiter emitted on stdout *only* to indicate shim message to master.
-@@ -161,11 +162,15 @@ def unpack_thin(thin_path):
- old_umask = os.umask(0o077)
+@@ -163,11 +164,15 @@ def unpack_thin(thin_path):
+ old_umask = os.umask(0o077) # pylint: disable=blacklisted-function
tfile.extractall(path=OPTIONS.saltdir)
tfile.close()
-- os.umask(old_umask)
+ checksum_path = os.path.normpath(os.path.join(OPTIONS.saltdir, "thin_checksum"))
+ with open(checksum_path, 'w') as chk:
+ chk.write(OPTIONS.checksum + '\n')
-+ os.umask(old_umask) # pylint: disable=blacklisted-function
+ os.umask(old_umask) # pylint: disable=blacklisted-function
try:
os.unlink(thin_path)
except OSError:
@@ -623,7 +613,7 @@
def need_ext():
-@@ -199,6 +204,47 @@ def unpack_ext(ext_path):
+@@ -201,6 +206,47 @@ def unpack_ext(ext_path):
shutil.move(ver_path, ver_dst)
@@ -671,7 +661,7 @@
def main(argv): # pylint: disable=W0613
'''
Main program body
-@@ -215,32 +261,25 @@ def main(argv): # pylint: disable=W0613
+@@ -217,32 +263,25 @@ def main(argv): # pylint: disable=W0613
if scpstat != 0:
sys.exit(EX_SCP_NOT_FOUND)
@@ -716,7 +706,7 @@
need_deployment()
# Salt thin exists and is up-to-date - fall through and use it
-@@ -270,7 +309,7 @@ def main(argv): # pylint: disable=W0613
+@@ -272,7 +311,7 @@ def main(argv): # pylint: disable=W0613
argv_prepared = ARGS
salt_argv = [
@@ -725,7 +715,7 @@
salt_call_path,
'--retcode-passthrough',
'--local',
-@@ -303,7 +342,10 @@ def main(argv): # pylint: disable=W0613
+@@ -305,7 +344,10 @@ def main(argv): # pylint: disable=W0613
if OPTIONS.tty:
# Returns bytes instead of string on python 3
stdout, _ = subprocess.Popen(salt_argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
@@ -737,9 +727,9 @@
sys.stdout.flush()
if OPTIONS.wipe:
shutil.rmtree(OPTIONS.saltdir)
-@@ -315,5 +357,6 @@ def main(argv): # pylint: disable=W0613
+@@ -317,5 +359,6 @@ def main(argv): # pylint: disable=W0613
if OPTIONS.cmd_umask is not None:
- os.umask(old_umask)
+ os.umask(old_umask) # pylint: disable=blacklisted-function
+
if __name__ == '__main__':
@@ -758,10 +748,10 @@
minion_opts=self.minion_opts,
**self.kwargs
diff --git a/salt/config/__init__.py b/salt/config/__init__.py
-index df0e1388b7..b3de3820b0 100644
+index 289991771d..432364b201 100644
--- a/salt/config/__init__.py
+++ b/salt/config/__init__.py
-@@ -1652,6 +1652,7 @@ DEFAULT_MASTER_OPTS = {
+@@ -1663,6 +1663,7 @@ DEFAULT_MASTER_OPTS = {
'state_top': 'top.sls',
'state_top_saltenv': None,
'master_tops': {},
@@ -769,45 +759,11 @@
'order_masters': False,
'job_cache': True,
'ext_job_cache': '',
-diff --git a/salt/modules/zfs.py b/salt/modules/zfs.py
-index bc54044b5c..d8fbfc76be 100644
---- a/salt/modules/zfs.py
-+++ b/salt/modules/zfs.py
-@@ -37,10 +37,10 @@ def __virtual__():
- '''
- Only load when the platform has zfs support
- '''
-- if __grains__['zfs_support']:
-+ if __grains__.get('zfs_support'):
- return __virtualname__
- else:
-- return (False, "The zfs module cannot be loaded: zfs not supported")
-+ return False, "The zfs module cannot be loaded: zfs not supported"
-
-
- @decorators.memoize
-diff --git a/salt/modules/zpool.py b/salt/modules/zpool.py
-index f955175664..5e03418919 100644
---- a/salt/modules/zpool.py
-+++ b/salt/modules/zpool.py
-@@ -31,10 +31,10 @@ def __virtual__():
- '''
- Only load when the platform has zfs support
- '''
-- if __grains__['zfs_support']:
-+ if __grains__.get('zfs_support'):
- return __virtualname__
- else:
-- return (False, "The zpool module cannot be loaded: zfs not supported")
-+ return False, "The zpool module cannot be loaded: zfs not supported"
-
-
- @salt.utils.decorators.memoize
diff --git a/salt/state.py b/salt/state.py
-index 49d68d2edf..8c0b90545c 100644
+index 09709347b1..e7288bce2e 100644
--- a/salt/state.py
+++ b/salt/state.py
-@@ -3332,7 +3332,7 @@ class BaseHighState(object):
+@@ -3383,7 +3383,7 @@ class BaseHighState(object):
ext_matches = self._master_tops()
for saltenv in ext_matches:
top_file_matches = matches.get(saltenv, [])
@@ -817,7 +773,7 @@
second = top_file_matches
else:
diff --git a/salt/utils/hashutils.py b/salt/utils/hashutils.py
-index 4c9cb4a50c..18f7459d3c 100644
+index b42a60d222..ee01be7377 100644
--- a/salt/utils/hashutils.py
+++ b/salt/utils/hashutils.py
@@ -9,6 +9,7 @@ import base64
@@ -828,7 +784,7 @@
# Import Salt libs
from salt.ext import six
-@@ -163,3 +164,39 @@ def get_hash(path, form='sha256', chunk_size=65536):
+@@ -150,3 +151,39 @@ def get_hash(path, form='sha256', chunk_size=65536):
for chunk in iter(lambda: ifile.read(chunk_size), b''):
hash_obj.update(chunk)
return hash_obj.hexdigest()
@@ -2137,6 +2093,6 @@
+ for t_line in ['second-system-effect:2:7', 'solar-interference:2:6']:
+ assert t_line in out
--
-2.15.1
+2.13.7
++++++ align-suse-salt-master.service-limitnofiles-limit-wi.patch ++++++
>From 816c7ec3b72510346deef17deb2990a09ddab03a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Thu, 31 May 2018 10:58:16 +0100
Subject: [PATCH] Align SUSE salt-master.service 'LimitNOFILES' limit
with upstream Salt
---
pkg/suse/salt-master.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/suse/salt-master.service b/pkg/suse/salt-master.service
index c0ea4606d8..b31c1a1373 100644
--- a/pkg/suse/salt-master.service
+++ b/pkg/suse/salt-master.service
@@ -4,7 +4,7 @@ Documentation=man:salt-master(1) file:///usr/share/doc/salt/html/contents.html h
After=network.target
[Service]
-LimitNOFILE=16384
+LimitNOFILE=100000
Type=simple
ExecStart=/usr/bin/salt-master
TasksMax=infinity
--
2.13.7
++++++ avoid-excessive-syslogging-by-watchdog-cronjob-58.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.268036972 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.268036972 +0200
@@ -1,4 +1,4 @@
-From edb1c95fa06b8bb1d7e6d91beaaddec6d22c966b Mon Sep 17 00:00:00 2001
+From 310f8eb22db6010ba48ab371a7223c1345cfbcf0 Mon Sep 17 00:00:00 2001
From: Hubert Mantel <mantel(a)suse.de>
Date: Mon, 27 Nov 2017 13:55:13 +0100
Subject: [PATCH] avoid excessive syslogging by watchdog cronjob (#58)
@@ -21,6 +21,6 @@
/usr/bin/salt-daemon-watcher --with-init & disown
fi
--
-2.16.2
+2.13.7
++++++ avoid-incomprehensive-message-if-crashes.patch ++++++
>From c4d9227b6da4407348e181f092445f17e3c14b51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Thu, 26 Jul 2018 16:42:10 +0100
Subject: [PATCH] Avoid incomprehensive message if crashes
Check dmidecoder executable on each call to avoid crashing
Fix pylint issues
---
salt/modules/smbios.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/salt/modules/smbios.py b/salt/modules/smbios.py
index c8a0e54a5c..c0b94c2a65 100644
--- a/salt/modules/smbios.py
+++ b/salt/modules/smbios.py
@@ -19,6 +19,7 @@ import re
# Import salt libs
import salt.utils.path
+from salt.exceptions import CommandExecutionError
# Solve the Chicken and egg problem where grains need to run before any
# of the modules are loaded and are generally available for any usage.
@@ -32,10 +33,16 @@ log = logging.getLogger(__name__)
DMIDECODER = salt.utils.path.which_bin(['dmidecode', 'smbios'])
+def _refresh_dmidecoder():
+ global DMIDECODER
+ DMIDECODER = salt.utils.path.which_bin(['dmidecode', 'smbios'])
+
+
def __virtual__():
'''
Only work when dmidecode is installed.
'''
+ _refresh_dmidecoder()
if DMIDECODER is None:
log.debug('SMBIOS: neither dmidecode nor smbios found!')
return (False, 'The smbios execution module failed to load: neither dmidecode nor smbios in the path.')
@@ -327,6 +334,10 @@ def _dmidecoder(args=None):
'''
Call DMIdecode
'''
+ _refresh_dmidecoder()
+ if DMIDECODER is None:
+ raise CommandExecutionError('SMBIOS: neither dmidecode nor smbios found!')
+
if args is None:
return salt.modules.cmdmod._run_quiet(DMIDECODER)
else:
--
2.17.1
++++++ do-not-override-jid-on-returners-only-sending-back-t.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.284036999 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.284036999 +0200
@@ -1,4 +1,4 @@
-From c49a9aca3519d1baef2f9d82963a6e80eabb26d4 Mon Sep 17 00:00:00 2001
+From 911d61d1479d89ed31b23b038874505b731c6d86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Fri, 4 May 2018 09:34:13 +0100
@@ -10,10 +10,10 @@
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py
-index 6cb3ce0ef8..e81ae143bd 100644
+index 65c2e3fbda..32fdae9786 100644
--- a/salt/utils/schedule.py
+++ b/salt/utils/schedule.py
-@@ -753,11 +753,13 @@ class Schedule(object):
+@@ -755,11 +755,13 @@ class Schedule(object):
else:
# Send back to master so the job is included in the job list
mret = ret.copy()
@@ -33,6 +33,6 @@
for key, value in six.iteritems(mret):
load[key] = value
--
-2.15.1
+2.13.7
++++++ enable-passing-a-unix_socket-for-mysql-returners-bsc.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.292037013 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.292037013 +0200
@@ -1,4 +1,4 @@
-From cdfb19b6c2801a7d5a883492a0ccc57c803dcd7f Mon Sep 17 00:00:00 2001
+From d937d1edb837bc084c1eaa320e8433382135e2d9 Mon Sep 17 00:00:00 2001
From: Maximilian Meister <mmeister(a)suse.de>
Date: Thu, 3 May 2018 15:52:23 +0200
Subject: [PATCH] enable passing a unix_socket for mysql returners
@@ -69,6 +69,6 @@
try:
__context__['mysql_returner_conn'] = conn
--
-2.13.6
+2.13.7
++++++ fall-back-to-pymysql.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.304037033 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.304037033 +0200
@@ -1,4 +1,4 @@
-From f7ba683153e11be401a5971ba029d0a3964b1ecb Mon Sep 17 00:00:00 2001
+From 9e0c0bbc1b48fa7065a9d0f50bd7111789712e2d Mon Sep 17 00:00:00 2001
From: Maximilian Meister <mmeister(a)suse.de>
Date: Thu, 5 Apr 2018 13:23:23 +0200
Subject: [PATCH] fall back to PyMySQL
@@ -123,7 +123,7 @@
raise
# reconnect creating new client
diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py
-index 0625b02a96..8b17e461ea 100644
+index 833a766a97..a5965f3a25 100644
--- a/salt/modules/mysql.py
+++ b/salt/modules/mysql.py
@@ -51,13 +51,14 @@ import salt.utils.stringutils
@@ -299,7 +299,7 @@
cursor = conn.cursor()
diff --git a/tests/unit/pillar/test_mysql.py b/tests/unit/pillar/test_mysql.py
-index 8d49ac24e2..b72988673d 100644
+index a242eac1a1..f6a2d0a44b 100644
--- a/tests/unit/pillar/test_mysql.py
+++ b/tests/unit/pillar/test_mysql.py
@@ -12,7 +12,7 @@ import salt.pillar.mysql as mysql
@@ -312,6 +312,6 @@
maxDiff = None
--
-2.13.6
+2.13.7
++++++ feat-add-grain-for-all-fqdns.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.312037046 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.312037046 +0200
@@ -1,4 +1,4 @@
-From 0449bead92ff763d186f5e524556f82c618d652c Mon Sep 17 00:00:00 2001
+From 6e5f0fbbe3c232c7d5212d4fddfe52b5a5a71597 Mon Sep 17 00:00:00 2001
From: Michele Bologna <michele.bologna(a)suse.com>
Date: Thu, 14 Dec 2017 18:20:02 +0100
Subject: [PATCH] Feat: add grain for all FQDNs
@@ -21,10 +21,10 @@
3 files changed, 29 insertions(+)
diff --git a/salt/grains/core.py b/salt/grains/core.py
-index b7d446676e..96b7ce2cf2 100644
+index 8545d4368c..24de3cff6b 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
-@@ -1888,6 +1888,33 @@ def append_domain():
+@@ -1886,6 +1886,33 @@ def append_domain():
return grain
@@ -59,7 +59,7 @@
'''
Return ip address and FQDN grains
diff --git a/tests/integration/modules/test_grains.py b/tests/integration/modules/test_grains.py
-index 709f882b45..aa7bd44202 100644
+index 616e07d455..dfa70afa03 100644
--- a/tests/integration/modules/test_grains.py
+++ b/tests/integration/modules/test_grains.py
@@ -51,6 +51,7 @@ class TestModulesGrains(ModuleCase):
@@ -71,7 +71,7 @@
'groupname',
'host',
diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
-index 50babe3ed3..47c9cdd35b 100644
+index 54c8293dcf..616c62e658 100644
--- a/tests/unit/grains/test_core.py
+++ b/tests/unit/grains/test_core.py
@@ -7,6 +7,7 @@
@@ -83,6 +83,6 @@
# Import Salt Testing Libs
try:
--
-2.16.2
+2.13.7
++++++ fix-bsc-1065792.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.320037060 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.320037060 +0200
@@ -1,4 +1,4 @@
-From 27d0e8b7e7c1eae68ef6dc972ea0f091d18cd92e Mon Sep 17 00:00:00 2001
+From 30a4053231cf67f486ca1f430dce563f7247d963 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo(a)suse.de>
Date: Thu, 14 Dec 2017 16:21:40 +0100
Subject: [PATCH] Fix bsc#1065792
@@ -20,6 +20,6 @@
return __virtualname__
else:
--
-2.16.2
+2.13.7
++++++ fix-decrease-loglevel-when-unable-to-resolve-addr.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.324037066 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.328037073 +0200
@@ -1,4 +1,4 @@
-From 14128fc65bf007bbb5b27b3eedec30b7f729bfbd Mon Sep 17 00:00:00 2001
+From 5d12b612b1f7b05a13e7b8da02e50ec471a72187 Mon Sep 17 00:00:00 2001
From: Michele Bologna <michele.bologna(a)suse.com>
Date: Tue, 20 Mar 2018 19:27:36 +0100
Subject: [PATCH] Fix: decrease loglevel when unable to resolve addr
@@ -54,10 +54,10 @@
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/grains/core.py b/salt/grains/core.py
-index 96b7ce2cf2..17a7d9819a 100644
+index 24de3cff6b..c166a43d7c 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
-@@ -1909,7 +1909,7 @@ def fqdns():
+@@ -1907,7 +1907,7 @@ def fqdns():
fqdns.add(socket.gethostbyaddr(ip)[0])
except (socket.error, socket.herror,
socket.gaierror, socket.timeout) as e:
@@ -67,6 +67,6 @@
grains['fqdns'] = list(fqdns)
return grains
--
-2.16.2
+2.13.7
++++++ fix-deprecation-warning-bsc-1095507.patch ++++++
>From 9289e1607ebf6f397c027d4a6edcf35c59bd600c Mon Sep 17 00:00:00 2001
From: Mihai Dinca <mdinca(a)suse.de>
Date: Wed, 6 Jun 2018 15:47:45 +0200
Subject: [PATCH] Fix deprecation warning (bsc#1095507)
---
salt/utils/thin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/utils/thin.py b/salt/utils/thin.py
index e4b878eb19..b99e407583 100644
--- a/salt/utils/thin.py
+++ b/salt/utils/thin.py
@@ -546,7 +546,7 @@ def thin_sum(cachedir, form='sha1'):
thintar = gen_thin(cachedir)
code_checksum_path = os.path.join(cachedir, 'thin', 'code-checksum')
if os.path.isfile(code_checksum_path):
- with salt.utils.fopen(code_checksum_path, 'r') as fh:
+ with salt.utils.files.fopen(code_checksum_path, 'r') as fh:
code_checksum = "'{0}'".format(fh.read().strip())
else:
code_checksum = "'0'"
--
2.13.7
++++++ fix-diffing-binary-files-in-file.get_diff-bsc-109839.patch ++++++
>From 7bda1dcd4f14da55abe38b1739b1e46ad0f5213c Mon Sep 17 00:00:00 2001
From: Erik Johnson <palehose(a)gmail.com>
Date: Fri, 13 Apr 2018 11:25:24 -0500
Subject: [PATCH] Fix diffing binary files in file.get_diff (bsc#1098394)
---
salt/modules/file.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/salt/modules/file.py b/salt/modules/file.py
index 1b4b7e0e46..95bca7fb1b 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -5008,8 +5008,7 @@ def get_diff(file1,
*salt.utils.data.decode(args)
)
)
- return ret
- return ''
+ return ret
def manage_file(name,
--
2.13.7
++++++ fix-for-ec2-rate-limit-failures.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.348037106 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.348037106 +0200
@@ -1,4 +1,4 @@
-From b0273e150b29fb44d72246918792117b485441de Mon Sep 17 00:00:00 2001
+From 88a99b5beeaa51eaf646eb92d8f546f65f654008 Mon Sep 17 00:00:00 2001
From: Daniel Wallace <gtmanfred(a)users.noreply.github.com>
Date: Wed, 25 Apr 2018 11:13:15 -0500
Subject: [PATCH] Fix for EC2 Rate Limit Failures
@@ -61,6 +61,6 @@
log.error(
--
-2.13.6
+2.13.7
++++++ fix-for-errno-0-resolver-error-0-no-error-bsc-108758.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.356037120 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.356037120 +0200
@@ -1,4 +1,4 @@
-From b9cc71639d4e918ef14635124f6991917150de46 Mon Sep 17 00:00:00 2001
+From 826194be2a036fee80d3ca546822023416ac3a7d Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo(a)suse.de>
Date: Wed, 21 Mar 2018 11:10:23 +0100
Subject: [PATCH] Fix for [Errno 0] Resolver Error 0 (no error)
@@ -9,14 +9,14 @@
* Fix unit test for reversed fqdns return data
---
salt/grains/core.py | 19 ++++++++++++-------
- tests/unit/grains/test_core.py | 32 ++++++++++++++++++++++++++++++++
- 2 files changed, 44 insertions(+), 7 deletions(-)
+ tests/unit/grains/test_core.py | 22 ++++++++++++++++++++++
+ 2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/salt/grains/core.py b/salt/grains/core.py
-index 17a7d9819a..cd9ba1f29c 100644
+index c166a43d7c..dc472a6c0a 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
-@@ -1900,16 +1900,21 @@ def fqdns():
+@@ -1898,16 +1898,21 @@ def fqdns():
fqdns = set()
addresses = salt.utils.network.ip_addrs(include_loopback=False,
@@ -46,22 +46,13 @@
grains['fqdns'] = list(fqdns)
return grains
diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
-index 47c9cdd35b..c604df6c57 100644
+index 616c62e658..dd7d5b06f8 100644
--- a/tests/unit/grains/test_core.py
+++ b/tests/unit/grains/test_core.py
-@@ -784,3 +784,35 @@ SwapTotal: 4789244 kB'''
- []}}
- with patch.object(salt.utils.dns, 'parse_resolv', MagicMock(return_value=resolv_mock)):
- assert core.dns() == ret
-+
-+ def _run_dns_test(self, resolv_mock, ret):
-+ with patch.object(salt.utils, 'is_windows',
-+ MagicMock(return_value=False)):
-+ with patch.dict(core.__opts__, {'ipv6': False}):
-+ with patch.object(salt.utils.dns, 'parse_resolv',
-+ MagicMock(return_value=resolv_mock)):
-+ get_dns = core.dns()
-+ self.assertEqual(get_dns, ret)
+@@ -877,3 +877,25 @@ SwapTotal: 4789244 kB'''
+ osdata = {'kernel': 'test', }
+ ret = core._virtual(osdata)
+ self.assertEqual(ret['virtual'], virt)
+
+ @skipIf(not salt.utils.platform.is_linux(), 'System is not Linux')
+ @patch.object(salt.utils, 'is_windows', MagicMock(return_value=False))
@@ -84,8 +75,7 @@
+ self.assertIn('fqdns', fqdns)
+ self.assertEqual(len(fqdns['fqdns']), len(ret['fqdns']))
+ self.assertEqual(set(fqdns['fqdns']), set(ret['fqdns']))
-+
--
-2.13.6
+2.13.7
++++++ fix-unboundlocalerror-in-file.get_diff.patch ++++++
>From 854ffed98894b8aa8b51973c0ba13fb75093e715 Mon Sep 17 00:00:00 2001
From: Erik Johnson <palehose(a)gmail.com>
Date: Mon, 30 Apr 2018 10:25:40 -0500
Subject: [PATCH] Fix UnboundLocalError in file.get_diff
This was only in 2018.3 head and not part of a release
Add unit test for file.get_diff
Use a lambda instead of defining a one-line function
---
salt/modules/file.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/salt/modules/file.py b/salt/modules/file.py
index 95bca7fb1b..1b4b7e0e46 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -5008,7 +5008,8 @@ def get_diff(file1,
*salt.utils.data.decode(args)
)
)
- return ret
+ return ret
+ return ''
def manage_file(name,
--
2.13.7
++++++ fix-zypper.list_pkgs-to-be-aligned-with-pkg-state.patch ++++++
>From 997edb18b81d73933324b299da36474c24630b42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Mon, 25 Jun 2018 13:06:40 +0100
Subject: [PATCH] Fix zypper.list_pkgs to be aligned with pkg state
Handle packages with multiple version properly with zypper
Add unit test coverage for multiple version packages on Zypper
Fix '_find_remove_targets' after aligning Zypper with pkg state
---
salt/modules/zypper.py | 57 +++++++++++++---------
salt/states/pkg.py | 21 --------
tests/unit/modules/test_zypper.py | 100 +++++++++++++++++++++++++-------------
3 files changed, 102 insertions(+), 76 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 05ba3d86c9..4689f84926 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -38,6 +38,7 @@ import salt.utils.files
import salt.utils.functools
import salt.utils.path
import salt.utils.pkg
+import salt.utils.pkg.rpm
import salt.utils.stringutils
import salt.utils.systemd
from salt.utils.versions import LooseVersion
@@ -714,24 +715,44 @@ def list_pkgs(versions_as_list=False, **kwargs):
contextkey = 'pkg.list_pkgs'
if contextkey not in __context__:
-
- cmd = ['rpm', '-qa', '--queryformat', (
- "%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-"
- "%|EPOCH?{%{EPOCH}}:{}|_|-%{INSTALLTIME}\\n")]
ret = {}
- for line in __salt__['cmd.run'](cmd, output_loglevel='trace', python_shell=False).splitlines():
- name, pkgver, rel, arch, epoch, install_time = line.split('_|-')
- install_date = datetime.datetime.utcfromtimestamp(int(install_time)).isoformat() + "Z"
- install_date_time_t = int(install_time)
-
- all_attr = {'epoch': epoch, 'version': pkgver, 'release': rel, 'arch': arch,
- 'install_date': install_date, 'install_date_time_t': install_date_time_t}
- __salt__['pkg_resource.add_pkg'](ret, name, all_attr)
+ cmd = ['rpm', '-qa', '--queryformat',
+ salt.utils.pkg.rpm.QUERYFORMAT.replace('%{REPOID}', '(none)') + '\n']
+ output = __salt__['cmd.run'](cmd,
+ python_shell=False,
+ output_loglevel='trace')
+ for line in output.splitlines():
+ pkginfo = salt.utils.pkg.rpm.parse_pkginfo(
+ line,
+ osarch=__grains__['osarch']
+ )
+ if pkginfo is not None:
+ # see rpm version string rules available at https://goo.gl/UGKPNd
+ pkgver = pkginfo.version
+ epoch = ''
+ release = ''
+ if ':' in pkgver:
+ epoch, pkgver = pkgver.split(":", 1)
+ if '-' in pkgver:
+ pkgver, release = pkgver.split("-", 1)
+ all_attr = {
+ 'epoch': epoch,
+ 'version': pkgver,
+ 'release': release,
+ 'arch': pkginfo.arch,
+ 'install_date': pkginfo.install_date,
+ 'install_date_time_t': pkginfo.install_date_time_t
+ }
+ __salt__['pkg_resource.add_pkg'](ret, pkginfo.name, all_attr)
+ _ret = {}
for pkgname in ret:
- ret[pkgname] = sorted(ret[pkgname], key=lambda d: d['version'])
+ # Filter out GPG public keys packages
+ if pkgname.startswith('gpg-pubkey'):
+ continue
+ _ret[pkgname] = sorted(ret[pkgname], key=lambda d: d['version'])
- __context__[contextkey] = ret
+ __context__[contextkey] = _ret
return __salt__['pkg_resource.format_pkg_list'](
__context__[contextkey],
@@ -1350,14 +1371,6 @@ def install(name=None,
_clean_cache()
new = list_pkgs(attr=diff_attr) if not downloadonly else list_downloaded()
-
- # Handle packages which report multiple new versions
- # (affects only kernel packages at this point)
- for pkg_name in new:
- pkg_data = new[pkg_name]
- if isinstance(pkg_data, six.string_types):
- new[pkg_name] = pkg_data.split(',')[-1]
-
ret = salt.utils.data.compare_dicts(old, new)
if errors:
diff --git a/salt/states/pkg.py b/salt/states/pkg.py
index ed405cb6b5..aad87e3278 100644
--- a/salt/states/pkg.py
+++ b/salt/states/pkg.py
@@ -415,16 +415,6 @@ def _find_remove_targets(name=None,
if __grains__['os'] == 'FreeBSD' and origin:
cver = [k for k, v in six.iteritems(cur_pkgs) if v['origin'] == pkgname]
- elif __grains__['os_family'] == 'Suse':
- # On SUSE systems. Zypper returns packages without "arch" in name
- try:
- namepart, archpart = pkgname.rsplit('.', 1)
- except ValueError:
- cver = cur_pkgs.get(pkgname, [])
- else:
- if archpart in salt.utils.pkg.rpm.ARCHES + ("noarch",):
- pkgname = namepart
- cver = cur_pkgs.get(pkgname, [])
else:
cver = cur_pkgs.get(pkgname, [])
@@ -854,17 +844,6 @@ def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
cver = new_pkgs.get(pkgname.split('%')[0])
elif __grains__['os_family'] == 'Debian':
cver = new_pkgs.get(pkgname.split('=')[0])
- elif __grains__['os_family'] == 'Suse':
- # On SUSE systems. Zypper returns packages without "arch" in name
- try:
- namepart, archpart = pkgname.rsplit('.', 1)
- except ValueError:
- cver = new_pkgs.get(pkgname)
- else:
- if archpart in salt.utils.pkg.rpm.ARCHES + ("noarch",):
- cver = new_pkgs.get(namepart)
- else:
- cver = new_pkgs.get(pkgname)
else:
cver = new_pkgs.get(pkgname)
if not cver and pkgname in new_caps:
diff --git a/tests/unit/modules/test_zypper.py b/tests/unit/modules/test_zypper.py
index 6eccee568b..bb15aca11a 100644
--- a/tests/unit/modules/test_zypper.py
+++ b/tests/unit/modules/test_zypper.py
@@ -475,7 +475,7 @@ class ZypperTestCase(TestCase, LoaderModuleMockMixin):
with patch('salt.modules.zypper.list_pkgs', MagicMock(side_effect=[
{"kernel-default": "3.12.49-11.1"}, {"kernel-default": "3.12.49-11.1,3.12.51-60.20.2"}])):
ret = zypper.install('kernel-default', '--auto-agree-with-licenses')
- self.assertDictEqual(ret, {"kernel-default": {"old": "3.12.49-11.1", "new": "3.12.51-60.20.2"}})
+ self.assertDictEqual(ret, {"kernel-default": {"old": "3.12.49-11.1", "new": "3.12.49-11.1,3.12.51-60.20.2"}})
def test_upgrade_failure(self):
'''
@@ -540,27 +540,36 @@ Repository 'DUMMY' not found by its alias, number, or URI.
data.setdefault(key, []).append(value)
rpm_out = [
- 'protobuf-java_|-2.6.1_|-3.1.develHead_|-noarch_|-_|-1499257756',
- 'yast2-ftp-server_|-3.1.8_|-8.1_|-x86_64_|-_|-1499257798',
- 'jose4j_|-0.4.4_|-2.1.develHead_|-noarch_|-_|-1499257756',
- 'apache-commons-cli_|-1.2_|-1.233_|-noarch_|-_|-1498636510',
- 'jakarta-commons-discovery_|-0.4_|-129.686_|-noarch_|-_|-1498636511',
- 'susemanager-build-keys-web_|-12.0_|-5.1.develHead_|-noarch_|-_|-1498636510',
+ 'protobuf-java_|-(none)_|-2.6.1_|-3.1.develHead_|-noarch_|-(none)_|-1499257756',
+ 'yast2-ftp-server_|-(none)_|-3.1.8_|-8.1_|-x86_64_|-(none)_|-1499257798',
+ 'jose4j_|-(none)_|-0.4.4_|-2.1.develHead_|-noarch_|-(none)_|-1499257756',
+ 'apache-commons-cli_|-(none)_|-1.2_|-1.233_|-noarch_|-(none)_|-1498636510',
+ 'jakarta-commons-discovery_|-(none)_|-0.4_|-129.686_|-noarch_|-(none)_|-1498636511',
+ 'susemanager-build-keys-web_|-(none)_|-12.0_|-5.1.develHead_|-noarch_|-(none)_|-1498636510',
+ 'gpg-pubkey_|-(none)_|-39db7c82_|-5847eb1f_|-(none)_|-(none)_|-1519203802',
+ 'gpg-pubkey_|-(none)_|-8a7c64f9_|-5aaa93ca_|-(none)_|-(none)_|-1529925595',
+ 'kernel-default_|-(none)_|-4.4.138_|-94.39.1_|-x86_64_|-(none)_|-1529936067',
+ 'kernel-default_|-(none)_|-4.4.73_|-5.1_|-x86_64_|-(none)_|-1503572639',
+ 'perseus-dummy_|-(none)_|-1.1_|-1.1_|-i586_|-(none)_|-1529936062',
]
- with patch.dict(zypper.__salt__, {'cmd.run': MagicMock(return_value=os.linesep.join(rpm_out))}), \
+ with patch.dict(zypper.__grains__, {'osarch': 'x86_64'}), \
+ patch.dict(zypper.__salt__, {'cmd.run': MagicMock(return_value=os.linesep.join(rpm_out))}), \
patch.dict(zypper.__salt__, {'pkg_resource.add_pkg': _add_data}), \
patch.dict(zypper.__salt__, {'pkg_resource.format_pkg_list': pkg_resource.format_pkg_list}), \
patch.dict(zypper.__salt__, {'pkg_resource.stringify': MagicMock()}):
pkgs = zypper.list_pkgs(versions_as_list=True)
+ self.assertFalse(pkgs.get('gpg-pubkey', False))
for pkg_name, pkg_version in {
- 'jakarta-commons-discovery': '0.4-129.686',
- 'yast2-ftp-server': '3.1.8-8.1',
- 'protobuf-java': '2.6.1-3.1.develHead',
- 'susemanager-build-keys-web': '12.0-5.1.develHead',
- 'apache-commons-cli': '1.2-1.233',
- 'jose4j': '0.4.4-2.1.develHead'}.items():
+ 'jakarta-commons-discovery': ['0.4-129.686'],
+ 'yast2-ftp-server': ['3.1.8-8.1'],
+ 'protobuf-java': ['2.6.1-3.1.develHead'],
+ 'susemanager-build-keys-web': ['12.0-5.1.develHead'],
+ 'apache-commons-cli': ['1.2-1.233'],
+ 'kernel-default': ['4.4.138-94.39.1', '4.4.73-5.1'],
+ 'perseus-dummy.i586': ['1.1-1.1'],
+ 'jose4j': ['0.4.4-2.1.develHead']}.items():
self.assertTrue(pkgs.get(pkg_name))
- self.assertEqual(pkgs[pkg_name], [pkg_version])
+ self.assertEqual(pkgs[pkg_name], pkg_version)
def test_list_pkgs_with_attr(self):
'''
@@ -572,57 +581,82 @@ Repository 'DUMMY' not found by its alias, number, or URI.
data.setdefault(key, []).append(value)
rpm_out = [
- 'protobuf-java_|-2.6.1_|-3.1.develHead_|-noarch_|-_|-1499257756',
- 'yast2-ftp-server_|-3.1.8_|-8.1_|-x86_64_|-_|-1499257798',
- 'jose4j_|-0.4.4_|-2.1.develHead_|-noarch_|-_|-1499257756',
- 'apache-commons-cli_|-1.2_|-1.233_|-noarch_|-_|-1498636510',
- 'jakarta-commons-discovery_|-0.4_|-129.686_|-noarch_|-_|-1498636511',
- 'susemanager-build-keys-web_|-12.0_|-5.1.develHead_|-noarch_|-_|-1498636510',
+ 'protobuf-java_|-(none)_|-2.6.1_|-3.1.develHead_|-noarch_|-(none)_|-1499257756',
+ 'yast2-ftp-server_|-(none)_|-3.1.8_|-8.1_|-x86_64_|-(none)_|-1499257798',
+ 'jose4j_|-(none)_|-0.4.4_|-2.1.develHead_|-noarch_|-(none)_|-1499257756',
+ 'apache-commons-cli_|-(none)_|-1.2_|-1.233_|-noarch_|-(none)_|-1498636510',
+ 'jakarta-commons-discovery_|-(none)_|-0.4_|-129.686_|-noarch_|-(none)_|-1498636511',
+ 'susemanager-build-keys-web_|-(none)_|-12.0_|-5.1.develHead_|-noarch_|-(none)_|-1498636510',
+ 'gpg-pubkey_|-(none)_|-39db7c82_|-5847eb1f_|-(none)_|-(none)_|-1519203802',
+ 'gpg-pubkey_|-(none)_|-8a7c64f9_|-5aaa93ca_|-(none)_|-(none)_|-1529925595',
+ 'kernel-default_|-(none)_|-4.4.138_|-94.39.1_|-x86_64_|-(none)_|-1529936067',
+ 'kernel-default_|-(none)_|-4.4.73_|-5.1_|-x86_64_|-(none)_|-1503572639',
+ 'perseus-dummy_|-(none)_|-1.1_|-1.1_|-i586_|-(none)_|-1529936062',
]
with patch.dict(zypper.__salt__, {'cmd.run': MagicMock(return_value=os.linesep.join(rpm_out))}), \
+ patch.dict(zypper.__grains__, {'osarch': 'x86_64'}), \
patch.dict(zypper.__salt__, {'pkg_resource.add_pkg': _add_data}), \
patch.dict(zypper.__salt__, {'pkg_resource.format_pkg_list': pkg_resource.format_pkg_list}), \
patch.dict(zypper.__salt__, {'pkg_resource.stringify': MagicMock()}):
pkgs = zypper.list_pkgs(attr=['epoch', 'release', 'arch', 'install_date_time_t'])
+ self.assertFalse(pkgs.get('gpg-pubkey', False))
for pkg_name, pkg_attr in {
- 'jakarta-commons-discovery': {
+ 'jakarta-commons-discovery': [{
'version': '0.4',
'release': '129.686',
'arch': 'noarch',
'install_date_time_t': 1498636511,
- },
- 'yast2-ftp-server': {
+ }],
+ 'yast2-ftp-server': [{
'version': '3.1.8',
'release': '8.1',
'arch': 'x86_64',
'install_date_time_t': 1499257798,
- },
- 'protobuf-java': {
+ }],
+ 'protobuf-java': [{
'version': '2.6.1',
'release': '3.1.develHead',
'install_date_time_t': 1499257756,
'arch': 'noarch',
- },
- 'susemanager-build-keys-web': {
+ }],
+ 'susemanager-build-keys-web': [{
'version': '12.0',
'release': '5.1.develHead',
'arch': 'noarch',
'install_date_time_t': 1498636510,
- },
- 'apache-commons-cli': {
+ }],
+ 'apache-commons-cli': [{
'version': '1.2',
'release': '1.233',
'arch': 'noarch',
'install_date_time_t': 1498636510,
+ }],
+ 'kernel-default': [{
+ 'version': '4.4.138',
+ 'release': '94.39.1',
+ 'arch': 'x86_64',
+ 'install_date_time_t': 1529936067
},
- 'jose4j': {
+ {
+ 'version': '4.4.73',
+ 'release': '5.1',
+ 'arch': 'x86_64',
+ 'install_date_time_t': 1503572639,
+ }],
+ 'perseus-dummy.i586': [{
+ 'version': '1.1',
+ 'release': '1.1',
+ 'arch': 'i586',
+ 'install_date_time_t': 1529936062,
+ }],
+ 'jose4j': [{
'arch': 'noarch',
'version': '0.4.4',
'release': '2.1.develHead',
'install_date_time_t': 1499257756,
- }}.items():
+ }]}.items():
self.assertTrue(pkgs.get(pkg_name))
- self.assertEqual(pkgs[pkg_name], [pkg_attr])
+ self.assertEqual(pkgs[pkg_name], pkg_attr)
def test_list_patches(self):
'''
--
2.13.7
++++++ fixed-usage-of-ipaddress.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.380037160 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.380037160 +0200
@@ -1,4 +1,4 @@
-From 205e031f6e5552ac860120f7ac852e24c5da73e5 Mon Sep 17 00:00:00 2001
+From 8ae052fbb07d7506492b430579308e4611e51754 Mon Sep 17 00:00:00 2001
From: Jochen Breuer <jbreuer(a)suse.de>
Date: Sun, 22 Apr 2018 23:11:11 +0200
Subject: [PATCH] Fixed usage of ipaddress
@@ -23,6 +23,6 @@
ret['netmask'] = six.text_type(network_info.netmask)
return ret
--
-2.13.6
+2.13.7
++++++ option-to-merge-current-pillar-with-opts-pillar-duri.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.424037234 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.424037234 +0200
@@ -1,4 +1,4 @@
-From 0cfa4f2a1cf559f87286069691a2766cb24f6076 Mon Sep 17 00:00:00 2001
+From e8c1b2c5a8af5cc6f4551918f695d1463a6eb584 Mon Sep 17 00:00:00 2001
From: Matei Albu <malbu(a)suse.de>
Date: Sun, 6 May 2018 21:15:58 +0200
Subject: [PATCH] Option to merge current pillar with opts['pillar']
@@ -13,7 +13,7 @@
3 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst
-index 9683a0a20a..75ad26c723 100644
+index c9010a702b..d9823b78d8 100644
--- a/doc/ref/configuration/minion.rst
+++ b/doc/ref/configuration/minion.rst
@@ -3219,3 +3219,31 @@ URL of the repository:
@@ -49,10 +49,10 @@
+If set to ``False`` only the overriding pillar data will be available
+to the ``showpillar`` state.
diff --git a/salt/config/__init__.py b/salt/config/__init__.py
-index b3de3820b0..82d3dfa07f 100644
+index 432364b201..feda0abac1 100644
--- a/salt/config/__init__.py
+++ b/salt/config/__init__.py
-@@ -983,6 +983,7 @@ VALID_OPTS = {
+@@ -989,6 +989,7 @@ VALID_OPTS = {
'ssh_identities_only': bool,
'ssh_log_file': six.string_types,
'ssh_config_file': six.string_types,
@@ -60,7 +60,7 @@
# Enable ioflo verbose logging. Warning! Very verbose!
'ioflo_verbose': int,
-@@ -1476,6 +1477,7 @@ DEFAULT_MINION_OPTS = {
+@@ -1485,6 +1486,7 @@ DEFAULT_MINION_OPTS = {
},
'discovery': False,
'schedule': {},
@@ -68,7 +68,7 @@
}
DEFAULT_MASTER_OPTS = {
-@@ -2078,7 +2080,7 @@ def _validate_ssh_minion_opts(opts):
+@@ -2089,7 +2091,7 @@ def _validate_ssh_minion_opts(opts):
for opt_name in list(ssh_minion_opts):
if re.match('^[a-z0-9]+fs_', opt_name, flags=re.IGNORECASE) \
@@ -78,10 +78,10 @@
log.warning(
'\'%s\' is not a valid ssh_minion_opts parameter, ignoring',
diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py
-index 388b774434..5940b7c105 100644
+index fc1e34f75d..fc3ce0a5c0 100644
--- a/salt/pillar/__init__.py
+++ b/salt/pillar/__init__.py
-@@ -993,6 +993,13 @@ class Pillar(object):
+@@ -1014,6 +1014,13 @@ class Pillar(object):
mopts['file_roots'] = self.actual_file_roots
mopts['saltversion'] = __version__
pillar['master'] = mopts
@@ -96,6 +96,6 @@
for error in errors:
log.critical('Pillar render error: %s', error)
--
-2.13.6
+2.13.7
++++++ prevent-zypper-from-parsing-repo-configuration-from-.patch ++++++
>From d282de5c59e27c17bd5afb207c4eeaa754993368 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Tue, 22 May 2018 12:04:48 +0100
Subject: [PATCH] Prevent zypper from parsing repo configuration from not
.repo files
---
salt/modules/zypper.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 06f8335c18..05ba3d86c9 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -862,7 +862,7 @@ def _get_configured_repos():
'''
repos_cfg = configparser.ConfigParser()
- repos_cfg.read([REPOS + '/' + fname for fname in os.listdir(REPOS)])
+ repos_cfg.read([REPOS + '/' + fname for fname in os.listdir(REPOS) if fname.endswith(".repo")])
return repos_cfg
--
2.13.7
++++++ remove-old-hack-when-reporting-multiversion-packages.patch ++++++
>From 11186ce52ae42967c49a6e238659a566e488a6b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Mon, 23 Jul 2018 16:32:26 +0100
Subject: [PATCH] Remove old hack when reporting multiversion packages
Fix unit tests for zypper pkg.upgrade
---
salt/modules/zypper.py | 5 -----
tests/unit/modules/test_zypper.py | 8 +++++++-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 4689f84926..695bce4f4e 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -1480,11 +1480,6 @@ def upgrade(refresh=True,
__zypper__(systemd_scope=_systemd_scope()).noraise.call(*cmd_update)
_clean_cache()
new = list_pkgs()
-
- # Handle packages which report multiple new versions
- # (affects only kernel packages at this point)
- for pkg in new:
- new[pkg] = new[pkg].split(',')[-1]
ret = salt.utils.data.compare_dicts(old, new)
if __zypper__.exit_code not in __zypper__.SUCCESS_EXIT_CODES:
diff --git a/tests/unit/modules/test_zypper.py b/tests/unit/modules/test_zypper.py
index bb15aca11a..424438c8bf 100644
--- a/tests/unit/modules/test_zypper.py
+++ b/tests/unit/modules/test_zypper.py
@@ -429,7 +429,13 @@ class ZypperTestCase(TestCase, LoaderModuleMockMixin):
zypper_mock.assert_any_call('update', '--auto-agree-with-licenses')
with patch('salt.modules.zypper.list_pkgs',
- MagicMock(side_effect=[{"vim": "1.1"}, {"vim": "1.1,1.2"}])):
+ MagicMock(side_effect=[{"kernel-default": "1.1"}, {"kernel-default": "1.1,1.2"}])):
+ ret = zypper.upgrade()
+ self.assertDictEqual(ret, {"kernel-default": {"old": "1.1", "new": "1.1,1.2"}})
+ zypper_mock.assert_any_call('update', '--auto-agree-with-licenses')
+
+ with patch('salt.modules.zypper.list_pkgs',
+ MagicMock(side_effect=[{"vim": "1.1"}, {"vim": "1.2"}])):
ret = zypper.upgrade()
self.assertDictEqual(ret, {"vim": {"old": "1.1", "new": "1.2"}})
zypper_mock.assert_any_call('update', '--auto-agree-with-licenses')
--
2.17.1
++++++ run-salt-api-as-user-salt-bsc-1064520.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.460037294 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.460037294 +0200
@@ -1,4 +1,4 @@
-From 92f41027bc08be3e14a47bbf7f43205a60606643 Mon Sep 17 00:00:00 2001
+From e9b5c0ae02552eb9a76488da32217a0e339d86a2 Mon Sep 17 00:00:00 2001
From: Christian Lanig <clanig(a)suse.com>
Date: Mon, 27 Nov 2017 13:10:26 +0100
Subject: [PATCH] Run salt-api as user salt (bsc#1064520)
@@ -20,6 +20,6 @@
ExecStart=/usr/bin/salt-api
TimeoutStopSec=3
--
-2.16.2
+2.13.7
++++++ run-salt-master-as-dedicated-salt-user.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.472037314 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.472037314 +0200
@@ -1,4 +1,4 @@
-From 04906c9a9c1b9fdbc6854a017e92525acd167bc7 Mon Sep 17 00:00:00 2001
+From 3d4be53c265dffdbfaf1d7d4764c361a640fd5ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf(a)suse.de>
Date: Wed, 20 Jan 2016 11:01:06 +0100
Subject: [PATCH] Run salt master as dedicated salt user
@@ -10,7 +10,7 @@
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/conf/master b/conf/master
-index 986898436a..8461101210 100644
+index 149fe8812f..d492aef6df 100644
--- a/conf/master
+++ b/conf/master
@@ -25,7 +25,8 @@
@@ -42,6 +42,6 @@
missingok
rotate 7
--
-2.16.2
+2.13.7
++++++ show-recommendations-for-salt-ssh-cross-version-pyth.patch ++++++
>From 15e97fd2916176fe850850fe90983ac95a1f8e7b Mon Sep 17 00:00:00 2001
From: Erik Johnson <palehose(a)gmail.com>
Date: Mon, 11 Jun 2018 14:46:58 -0500
Subject: [PATCH] Show recommendations for salt-ssh cross-version python
errors
This shows more accurate information on how to resolve version issues
(e.g. master only has Salt deps installed for Python 3 but remote host
has no Python 3 installed).
Use parenthesis for line continuation
---
salt/client/ssh/__init__.py | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py
index f1300b5698..8a85cc2480 100644
--- a/salt/client/ssh/__init__.py
+++ b/salt/client/ssh/__init__.py
@@ -1387,6 +1387,30 @@ ARGS = {arguments}\n'''.format(config=self.minion_config,
perm_error_fmt = 'Permissions problem, target user may need '\
'to be root or use sudo:\n {0}'
+ def _version_mismatch_error():
+ messages = {
+ 2: {
+ 6: 'Install Python 2.7 / Python 3 Salt dependencies on the Salt SSH master \n'
+ 'to interact with Python 2.7 / Python 3 targets',
+ 7: 'Install Python 2.6 / Python 3 Salt dependencies on the Salt SSH master \n'
+ 'to interact with Python 2.6 / Python 3 targets',
+ },
+ 3: {
+ 'default': '- Install Python 2.6/2.7 Salt dependencies on the Salt SSH \n'
+ ' master to interact with Python 2.6/2.7 targets\n'
+ '- Install Python 3 on the target machine(s)',
+ },
+ 'default': 'Matching major/minor Python release (>=2.6) needed both on the Salt SSH \n'
+ 'master and target machine',
+ }
+ major, minor = sys.version_info[:2]
+ help_msg = (
+ messages.get(major, {}).get(minor)
+ or messages.get(major, {}).get('default')
+ or messages['default']
+ )
+ return 'Python version error. Recommendation(s) follow:\n' + help_msg
+
errors = [
(
(),
@@ -1396,7 +1420,7 @@ ARGS = {arguments}\n'''.format(config=self.minion_config,
(
(salt.defaults.exitcodes.EX_THIN_PYTHON_INVALID,),
'Python interpreter is too old',
- 'salt requires python 2.6 or newer on target hosts, must have same major version as origin host'
+ _version_mismatch_error()
),
(
(salt.defaults.exitcodes.EX_THIN_CHECKSUM,),
--
2.13.7
++++++ strip-trailing-commas-on-linux-user-gecos-fields.patch ++++++
--- /var/tmp/diff_new_pack.Vk4x2R/_old 2018-08-02 14:55:45.516037388 +0200
+++ /var/tmp/diff_new_pack.Vk4x2R/_new 2018-08-02 14:55:45.516037388 +0200
@@ -1,4 +1,4 @@
-From f9fb3639bb3c44babd92d9499bdde83a0a81d6ab Mon Sep 17 00:00:00 2001
+From f515f99ee42ffaba30cee2e1941a7e9af9db7453 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez(a)suse.com>
Date: Wed, 18 Apr 2018 12:05:35 +0100
@@ -50,6 +50,6 @@
+ expected_gecos_fields = 'Testing'
+ self.assertEqual(useradd._build_gecos(test_gecos), expected_gecos_fields)
--
-2.15.1
+2.13.7
++++++ v2018.3.0.tar.gz -> v2018.3.2.tar.gz ++++++
/work/SRC/openSUSE:Factory/salt/v2018.3.0.tar.gz /work/SRC/openSUSE:Factory/.salt.new/v2018.3.2.tar.gz differ: char 13, line 1
1
0
Hello community,
here is the log from the commit of package libyui-ncurses for openSUSE:Factory checked in at 2018-08-02 14:55:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-ncurses (Old)
and /work/SRC/openSUSE:Factory/.libyui-ncurses.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-ncurses"
Thu Aug 2 14:55:31 2018 rev:39 rq:626444 version:2.50.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-ncurses/libyui-ncurses.changes 2018-03-04 11:49:47.948218425 +0100
+++ /work/SRC/openSUSE:Factory/.libyui-ncurses.new/libyui-ncurses.changes 2018-08-02 14:55:33.640017522 +0200
@@ -1,0 +2,7 @@
+Thu Jul 26 13:48:14 UTC 2018 - lslezak(a)suse.cz
+
+- Update the version to match the other packages (improvement
+ for handling big disks, bsc#991090)
+- 2.50.2
+
+-------------------------------------------------------------------
Old:
----
libyui-ncurses-2.50.1.tar.bz2
New:
----
libyui-ncurses-2.50.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-ncurses-doc.spec ++++++
--- /var/tmp/diff_new_pack.dUHzu2/_old 2018-08-02 14:55:34.588019108 +0200
+++ /var/tmp/diff_new_pack.dUHzu2/_new 2018-08-02 14:55:34.588019108 +0200
@@ -17,10 +17,10 @@
%define parent libyui-ncurses
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.50.1
+Version: 2.50.2
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui-ncurses.spec ++++++
--- /var/tmp/diff_new_pack.dUHzu2/_old 2018-08-02 14:55:34.608019141 +0200
+++ /var/tmp/diff_new_pack.dUHzu2/_new 2018-08-02 14:55:34.608019141 +0200
@@ -17,11 +17,11 @@
Name: libyui-ncurses
-Version: 2.50.1
+Version: 2.50.2
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
++++++ libyui-ncurses-2.50.1.tar.bz2 -> libyui-ncurses-2.50.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.50.1/VERSION.cmake new/libyui-ncurses-2.50.2/VERSION.cmake
--- old/libyui-ncurses-2.50.1/VERSION.cmake 2018-02-28 12:37:38.000000000 +0100
+++ new/libyui-ncurses-2.50.2/VERSION.cmake 2018-07-30 11:38:11.000000000 +0200
@@ -1,6 +1,6 @@
SET( VERSION_MAJOR "2" )
SET( VERSION_MINOR "50" )
-SET( VERSION_PATCH "1" )
+SET( VERSION_PATCH "2" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )
##### This is need for the libyui core, ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.50.1/package/libyui-ncurses-doc.spec new/libyui-ncurses-2.50.2/package/libyui-ncurses-doc.spec
--- old/libyui-ncurses-2.50.1/package/libyui-ncurses-doc.spec 2018-02-28 12:37:38.000000000 +0100
+++ new/libyui-ncurses-2.50.2/package/libyui-ncurses-doc.spec 2018-07-30 11:38:11.000000000 +0200
@@ -16,10 +16,10 @@
#
%define parent libyui-ncurses
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.50.1
+Version: 2.50.2
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.50.1/package/libyui-ncurses.changes new/libyui-ncurses-2.50.2/package/libyui-ncurses.changes
--- old/libyui-ncurses-2.50.1/package/libyui-ncurses.changes 2018-02-28 12:37:38.000000000 +0100
+++ new/libyui-ncurses-2.50.2/package/libyui-ncurses.changes 2018-07-30 11:38:11.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jul 26 13:48:14 UTC 2018 - lslezak(a)suse.cz
+
+- Update the version to match the other packages (improvement
+ for handling big disks, bsc#991090)
+- 2.50.2
+
+-------------------------------------------------------------------
Tue Feb 27 13:13:04 UTC 2018 - jreidinger(a)suse.com
- fix translations for advanced help text (bsc#1083015)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.50.1/package/libyui-ncurses.spec new/libyui-ncurses-2.50.2/package/libyui-ncurses.spec
--- old/libyui-ncurses-2.50.1/package/libyui-ncurses.spec 2018-02-28 12:37:38.000000000 +0100
+++ new/libyui-ncurses-2.50.2/package/libyui-ncurses.spec 2018-07-30 11:38:11.000000000 +0200
@@ -17,11 +17,11 @@
Name: libyui-ncurses
-Version: 2.50.1
+Version: 2.50.2
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.50.1/src/NCi18n.h new/libyui-ncurses-2.50.2/src/NCi18n.h
--- old/libyui-ncurses-2.50.1/src/NCi18n.h 2018-02-28 12:37:38.000000000 +0100
+++ new/libyui-ncurses-2.50.2/src/NCi18n.h 2018-07-30 11:38:11.000000000 +0200
@@ -59,12 +59,13 @@
bindtextdomain( domain, YSettings::localeDir().c_str() );
bind_textdomain_codeset( domain, "UTF-8" );
textdomain( domain );
-
+#if defined(__GLIBC__)
// Make change known
{
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
}
+#endif
}
1
0
Hello community,
here is the log from the commit of package libyui-qt for openSUSE:Factory checked in at 2018-08-02 14:55:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-qt (Old)
and /work/SRC/openSUSE:Factory/.libyui-qt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt"
Thu Aug 2 14:55:24 2018 rev:50 rq:626443 version:2.49.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-qt/libyui-qt.changes 2018-05-17 19:31:53.926375732 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-qt.new/libyui-qt.changes 2018-08-02 14:55:28.668009208 +0200
@@ -1,0 +2,7 @@
+Thu Jul 26 11:45:43 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.49.5
+
+-------------------------------------------------------------------
Old:
----
libyui-qt-2.49.4.tar.bz2
New:
----
libyui-qt-2.49.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-qt-doc.spec ++++++
--- /var/tmp/diff_new_pack.z1l1Zc/_old 2018-08-02 14:55:29.204010105 +0200
+++ /var/tmp/diff_new_pack.z1l1Zc/_new 2018-08-02 14:55:29.204010105 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.49.4
+Version: 2.49.5
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui-qt.spec ++++++
--- /var/tmp/diff_new_pack.z1l1Zc/_old 2018-08-02 14:55:29.220010131 +0200
+++ /var/tmp/diff_new_pack.z1l1Zc/_new 2018-08-02 14:55:29.224010138 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt
-Version: 2.49.4
+Version: 2.49.5
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
BuildRequires: boost-devel
++++++ libyui-qt-2.49.4.tar.bz2 -> libyui-qt-2.49.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.49.4/VERSION.cmake new/libyui-qt-2.49.5/VERSION.cmake
--- old/libyui-qt-2.49.4/VERSION.cmake 2018-05-14 17:21:06.000000000 +0200
+++ new/libyui-qt-2.49.5/VERSION.cmake 2018-07-30 11:37:53.000000000 +0200
@@ -1,6 +1,6 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "49")
-SET(VERSION_PATCH "4")
+SET(VERSION_PATCH "5")
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )
##### This is needed for the libyui-qt core ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.49.4/package/libyui-qt-doc.spec new/libyui-qt-2.49.5/package/libyui-qt-doc.spec
--- old/libyui-qt-2.49.4/package/libyui-qt-doc.spec 2018-05-14 17:21:06.000000000 +0200
+++ new/libyui-qt-2.49.5/package/libyui-qt-doc.spec 2018-07-30 11:37:53.000000000 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.49.4
+Version: 2.49.5
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.49.4/package/libyui-qt.changes new/libyui-qt-2.49.5/package/libyui-qt.changes
--- old/libyui-qt-2.49.4/package/libyui-qt.changes 2018-05-14 17:21:06.000000000 +0200
+++ new/libyui-qt-2.49.5/package/libyui-qt.changes 2018-07-30 11:37:53.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jul 26 11:45:43 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.49.5
+
+-------------------------------------------------------------------
Mon May 11 00:05:14 UTC 2018 - hellcp(a)opensuse.org
- Fix Gnome's display of titles/icons (boo#1092845)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.49.4/package/libyui-qt.spec new/libyui-qt-2.49.5/package/libyui-qt.spec
--- old/libyui-qt-2.49.4/package/libyui-qt.spec 2018-05-14 17:21:06.000000000 +0200
+++ new/libyui-qt-2.49.5/package/libyui-qt.spec 2018-07-30 11:37:53.000000000 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt
-Version: 2.49.4
+Version: 2.49.5
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
BuildRequires: boost-devel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.49.4/src/QY2DiskUsageList.cc new/libyui-qt-2.49.5/src/QY2DiskUsageList.cc
--- old/libyui-qt-2.49.4/src/QY2DiskUsageList.cc 2018-05-14 17:21:06.000000000 +0200
+++ new/libyui-qt-2.49.5/src/QY2DiskUsageList.cc 2018-07-30 11:37:53.000000000 +0200
@@ -278,7 +278,7 @@
int percent = 0;
if ( totalSize() != 0 )
- percent = ( 100 * usedSize() ) / totalSize();
+ percent = int(( 100 * usedSize() ) / totalSize());
return percent;
}
1
0
Hello community,
here is the log from the commit of package libyui-qt-pkg for openSUSE:Factory checked in at 2018-08-02 14:55:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-qt-pkg (Old)
and /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt-pkg"
Thu Aug 2 14:55:17 2018 rev:37 rq:626440 version:2.45.20
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-qt-pkg/libyui-qt-pkg.changes 2018-07-28 12:36:58.692031167 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new/libyui-qt-pkg.changes 2018-08-02 14:55:21.171996677 +0200
@@ -1,0 +2,7 @@
+Thu Jul 26 12:11:44 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.45.20
+
+-------------------------------------------------------------------
Old:
----
libyui-qt-pkg-2.45.19.tar.bz2
New:
----
libyui-qt-pkg-2.45.20.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-qt-pkg-doc.spec ++++++
--- /var/tmp/diff_new_pack.0vBC14/_old 2018-08-02 14:55:22.139998295 +0200
+++ /var/tmp/diff_new_pack.0vBC14/_new 2018-08-02 14:55:22.139998295 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt-pkg
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.45.19
+Version: 2.45.20
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui-qt-pkg.spec ++++++
--- /var/tmp/diff_new_pack.0vBC14/_old 2018-08-02 14:55:22.159998328 +0200
+++ /var/tmp/diff_new_pack.0vBC14/_new 2018-08-02 14:55:22.159998328 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt-pkg
-Version: 2.45.19
+Version: 2.45.20
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
++++++ libyui-qt-pkg-2.45.19.tar.bz2 -> libyui-qt-pkg-2.45.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/VERSION.cmake new/libyui-qt-pkg-2.45.20/VERSION.cmake
--- old/libyui-qt-pkg-2.45.19/VERSION.cmake 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/VERSION.cmake 2018-07-30 11:37:37.000000000 +0200
@@ -1,6 +1,6 @@
SET( VERSION_MAJOR "2" )
SET( VERSION_MINOR "45" )
-SET( VERSION_PATCH "19" )
+SET( VERSION_PATCH "20" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
##### This is need for the libyui core, ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg-doc.spec new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg-doc.spec
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg-doc.spec 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg-doc.spec 2018-07-30 11:37:37.000000000 +0200
@@ -17,10 +17,10 @@
%define parent libyui-qt-pkg
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.45.19
+Version: 2.45.20
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.changes new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.changes
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.changes 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.changes 2018-07-30 11:37:37.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jul 26 12:11:44 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.45.20
+
+-------------------------------------------------------------------
Tue Jul 3 17:10:19 UTC 2018 - lslezak(a)suse.cz
- Fixes for file systems >8EiB (bsc#991090):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.spec new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.spec
--- old/libyui-qt-pkg-2.45.19/package/libyui-qt-pkg.spec 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/package/libyui-qt-pkg.spec 2018-07-30 11:37:37.000000000 +0200
@@ -17,11 +17,11 @@
Name: libyui-qt-pkg
-Version: 2.45.19
+Version: 2.45.20
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.cc new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.cc
--- old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.cc 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.cc 2018-07-30 11:37:37.000000000 +0200
@@ -53,6 +53,8 @@
#include "YQPkgDiskUsageWarningDialog.h"
#include "YQi18n.h"
+// arbitrary precision integer
+#include <boost/multiprecision/cpp_int.hpp>
using std::set;
using std::endl;
@@ -253,7 +255,7 @@
if ( percent != item->usedPercent() )
{
- partitionDu.pkg_size = double(partitionDu.total_size) * percent / 100;
+ partitionDu.pkg_size = partitionDu.total_size / 100 * percent;
runningOutWarning.clear();
overflowWarning.clear();
@@ -283,78 +285,20 @@
yuiDebug() << "disk usage list entry for " << partitionDu.dir << endl;
}
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large disks
-void
-YQPkgDiskUsageListItem::updateStatus()
-{
- init( false );
-}
-
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large disks
-void
-YQPkgDiskUsageListItem::updateData()
-{
- init( true );
-}
-namespace {
- // FIXME: workaround for a broken formatting in the FSize class for sizes >8EiB
- QString formatSize(double size, int width = 0)
- {
- // FSize::bestUnit does not work for huge numbers so only use it for small ones
- FSize::Unit unit = (size >= FSize::TB) ? FSize::T : FSize(size).bestUnit();
- // FIXME: the precision is different than in the ncurses UI (it uses 1), unify it!
- int prec = unit == FSize::B ? 0 : 2;
-
- return QString("%1 %2").arg(size / FSize::factor(unit), 0, 'f', prec).arg(FSize::unit(unit));
- }
-}
-
-// FIXME: workaround to override the QY2DiskUsageListItem issue with large disks,
-// copied from QY2DiskUsageList.cc from libyui-qt to have minimal changes,
-// modified to use "double" data type to avoid overflow
-void
-YQPkgDiskUsageListItem::init( bool allFields )
-{
- setSizeHint( percentageBarCol(), QSize( 20, 10 ) );
-
- setTextAlignment( usedSizeCol(), Qt::AlignRight );
- setTextAlignment( freeSizeCol(), Qt::AlignRight );
- setTextAlignment( totalSizeCol(), Qt::AlignRight );
-
- if ( usedSizeCol() >= 0 ) setText( usedSizeCol(), double(_partitionDu.pkg_size) * FSize::KB );
- if ( freeSizeCol() >= 0 ) setText( freeSizeCol(), double(_partitionDu.total_size - _partitionDu.pkg_size) * FSize::KB );
-
- if ( allFields )
- {
- if ( totalSizeCol() >= 0 ) setText( totalSizeCol(), double(_partitionDu.total_size) * FSize::KB );
- if ( nameCol() >= 0 ) setText( nameCol(), name() );
- if ( deviceNameCol() >= 0 ) setText( deviceNameCol(), deviceName() );
- }
-
- if ( usedSizeCol() < 0 )
- setToolTip( freeSizeCol(), _( "Used %1" ).arg( formatSize(double(_partitionDu.pkg_size) * FSize::KB)));
-}
-
-void
-YQPkgDiskUsageListItem::setText( int column, double size )
-{
- QString sizeText = formatSize(size);
- setText( column, sizeText );
-}
-
-// FIXME: not used, does not support large disks
FSize
YQPkgDiskUsageListItem::usedSize() const
{
- return FSize( _partitionDu.pkg_size, FSize::K );
+ // the libzypp size is in KiB
+ return FSize( _partitionDu.pkg_size, FSize::Unit::K );
}
-// FIXME: not used, does not support large disks
+
FSize
YQPkgDiskUsageListItem::totalSize() const
{
- return FSize( _partitionDu.total_size, FSize::K );
+ // the libzypp size is in KiB
+ return FSize( _partitionDu.total_size, FSize::Unit::K );
}
@@ -378,9 +322,11 @@
YQPkgDiskUsageListItem::checkRemainingDiskSpace()
{
int percent = usedPercent();
+ // free size in MiB
+ boost::multiprecision::cpp_int free = freeSize().in_unit(FSize::Unit::M);
- // free size (MiB) - the libzypp sizes are in KiB so just divide by 1024 to get MiB
- long long free = (_partitionDu.total_size - _partitionDu.pkg_size) / 1024;
+ yuiDebug() << "Partition " << _partitionDu.dir << " free percent: " <<
+ percent << "%, " << " free: " << freeSize() << " (" << free << "MiB)" << endl;
if ( percent > MIN_PERCENT_WARN )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.h new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.h
--- old/libyui-qt-pkg-2.45.19/src/YQPkgDiskUsageList.h 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgDiskUsageList.h 2018-07-30 11:37:37.000000000 +0200
@@ -277,41 +277,6 @@
**/
void checkRemainingDiskSpace();
- // FIXME: the following methods were copied from QY2DiskUsageList class
- // from libyui-qt to have minimal changes,
- // this is a workaround to fix the QY2DiskUsageListItem issue with large disks
-
- /**
- * Update this item's status ( here: the numeric fields ).
- * Triggered by QY2ListView::updateAllItemStates().
- *
- * Reimplemented from QY2ListViewItem.
- **/
- virtual void updateStatus();
-
- /**
- * Update this item's data completely.
- * Triggered by QY2ListView::updateAllItemData().
- *
- * Reimplemented from QY2ListViewItem.
- **/
- virtual void updateData();
-
- void init( bool allFields );
-
- /**
- * Re-declare ordinary setText() method so the compiler doesn't get
- * confused which one to use.
- **/
- void setText( int column, const QString & text )
- { QTreeWidgetItem::setText( column, text ); }
-
- /**
- * set the text label with the size
- * @param column column to set
- * @param size the size value
- */
- void setText( int column, double size );
protected:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.19/src/YQPkgPatchFilterView.cc new/libyui-qt-pkg-2.45.20/src/YQPkgPatchFilterView.cc
--- old/libyui-qt-pkg-2.45.19/src/YQPkgPatchFilterView.cc 2018-07-18 16:48:24.000000000 +0200
+++ new/libyui-qt-pkg-2.45.20/src/YQPkgPatchFilterView.cc 2018-07-30 11:37:37.000000000 +0200
@@ -196,7 +196,7 @@
++it )
{
if ( (*it)->candidateObj() )
- totalSize += (*it)->candidateObj()->installSize();
+ totalSize += zypp::ByteCount::SizeType((*it)->candidateObj()->installSize());
}
#if ENABLE_TOTAL_DOWNLOAD_SIZE
1
0
Hello community,
here is the log from the commit of package libyui-ncurses-pkg for openSUSE:Factory checked in at 2018-08-02 14:55:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-ncurses-pkg (Old)
and /work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-ncurses-pkg"
Thu Aug 2 14:55:10 2018 rev:31 rq:626439 version:2.48.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-ncurses-pkg/libyui-ncurses-pkg.changes 2018-07-28 12:37:01.824037178 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new/libyui-ncurses-pkg.changes 2018-08-02 14:55:14.779985994 +0200
@@ -1,0 +2,7 @@
+Fri Jul 27 07:16:41 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.48.8
+
+-------------------------------------------------------------------
Old:
----
libyui-ncurses-pkg-2.48.7.tar.bz2
New:
----
libyui-ncurses-pkg-2.48.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libyui-ncurses-pkg-doc.spec ++++++
--- /var/tmp/diff_new_pack.Xw5wZR/_old 2018-08-02 14:55:15.303986870 +0200
+++ /var/tmp/diff_new_pack.Xw5wZR/_new 2018-08-02 14:55:15.307986876 +0200
@@ -17,10 +17,10 @@
%define parent libyui-ncurses-pkg
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.48.7
+Version: 2.48.8
Release: 0
Source: %{parent}-%{version}.tar.bz2
++++++ libyui-ncurses-pkg.spec ++++++
--- /var/tmp/diff_new_pack.Xw5wZR/_old 2018-08-02 14:55:15.319986896 +0200
+++ /var/tmp/diff_new_pack.Xw5wZR/_new 2018-08-02 14:55:15.319986896 +0200
@@ -17,11 +17,11 @@
Name: libyui-ncurses-pkg
-Version: 2.48.7
+Version: 2.48.8
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
++++++ libyui-ncurses-pkg-2.48.7.tar.bz2 -> libyui-ncurses-pkg-2.48.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/VERSION.cmake new/libyui-ncurses-pkg-2.48.8/VERSION.cmake
--- old/libyui-ncurses-pkg-2.48.7/VERSION.cmake 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/VERSION.cmake 2018-07-30 11:38:20.000000000 +0200
@@ -1,6 +1,6 @@
SET( VERSION_MAJOR "2" )
SET( VERSION_MINOR "48" )
-SET( VERSION_PATCH "7" )
+SET( VERSION_PATCH "8" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
##### This is need for the libyui core, ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg-doc.spec new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg-doc.spec
--- old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg-doc.spec 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg-doc.spec 2018-07-30 11:38:20.000000000 +0200
@@ -16,10 +16,10 @@
#
%define parent libyui-ncurses-pkg
-%define so_version 8
+%define so_version 9
Name: %{parent}-doc
-Version: 2.48.7
+Version: 2.48.8
Release: 0
Source: %{parent}-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg.changes new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg.changes
--- old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg.changes 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg.changes 2018-07-30 11:38:20.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Jul 27 07:16:41 UTC 2018 - lslezak(a)suse.cz
+
+- Fix for the new FSize class (avoid the 8EiB limit, bsc#991090)
+- Update the package version
+- 2.48.8
+
+-------------------------------------------------------------------
Tue Jul 3 12:07:43 UTC 2018 - lslezak(a)suse.cz
- Fixes for file systems >8EiB (bsc#991090):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg.spec new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg.spec
--- old/libyui-ncurses-pkg-2.48.7/package/libyui-ncurses-pkg.spec 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/package/libyui-ncurses-pkg.spec 2018-07-30 11:38:20.000000000 +0200
@@ -17,11 +17,11 @@
Name: libyui-ncurses-pkg
-Version: 2.48.7
+Version: 2.48.8
Release: 0
Source: %{name}-%{version}.tar.bz2
-%define so_version 8
+%define so_version 9
%define bin_name %{name}%{so_version}
%if 0%{?suse_version} > 1325
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/src/NCPackageSelector.cc new/libyui-ncurses-pkg-2.48.8/src/NCPackageSelector.cc
--- old/libyui-ncurses-pkg-2.48.7/src/NCPackageSelector.cc 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/src/NCPackageSelector.cc 2018-07-30 11:38:20.000000000 +0200
@@ -1633,7 +1633,7 @@
++it )
{
if ( (*it)->candidateObj() )
- totalSize += (*it)->candidateObj()->installSize();
+ totalSize += zypp::ByteCount::SizeType((*it)->candidateObj()->installSize());
}
// show the download size
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/src/NCPkgPopupDiskspace.cc new/libyui-ncurses-pkg-2.48.8/src/NCPkgPopupDiskspace.cc
--- old/libyui-ncurses-pkg-2.48.7/src/NCPkgPopupDiskspace.cc 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/src/NCPkgPopupDiskspace.cc 2018-07-30 11:38:20.000000000 +0200
@@ -62,6 +62,9 @@
// zypp::str::form()
#include <zypp/base/String.h>
+// arbitrary precision integer
+#include <boost/multiprecision/cpp_int.hpp>
+
// set values as set in YQPkgDiskUsageList.cc
#define MIN_FREE_MB_WARN 400
#define MIN_FREE_MB_PROXIMITY 700
@@ -78,6 +81,81 @@
Textdomain "ncurses-pkg"
*/
+namespace
+{
+ /**
+ * Local helper method, obtain the current disk usage. Initializes the libzypp
+ * disk usage with the current values from the system if needed.
+ * @return Libzypp disk usage
+ */
+ ZyppDuSet get_du()
+ {
+ ZyppDuSet diskUsage = zypp::getZYpp()->diskUsage();
+
+ if ( diskUsage.empty() )
+ {
+ zypp::getZYpp()->setPartitions( zypp::DiskUsageCounter::detectMountPoints() );
+ diskUsage = zypp::getZYpp()->diskUsage();
+ }
+
+ return diskUsage;
+ }
+
+ /**
+ * Compute used percent for the used and the total size.
+ * @param used the used size
+ * @param total the total size
+ * @return used percent (returns zero when 'total' is zero to avoid
+ * division by zero)
+ */
+ int usedPercentInt(const FSize &used, const FSize &total)
+ {
+ int percent = 0;
+
+ if ( total != 0 )
+ percent = int(( 100 * used ) / total);
+
+ return percent;
+ }
+
+ /**
+ * Compute the dialog width, try to make all fields visible. Make it
+ * dependant on the longest mount point path.
+ * @return width
+ */
+ int dialogWidth()
+ {
+ int width = 0;
+ for (const ZyppPartitionDu &du: get_du())
+ {
+ if( int(du.dir.length()) > width )
+ width = du.dir.length();
+ }
+ yuiDebug() << "The longest mount point path: " << width << " characters" << endl;
+
+ // add the width of the other columns + small extra space
+ // (e.g. buffer for longer translations)
+ width += 50;
+
+ // cannot be wider than the screen, keep some minimal space around the popup
+ if (width > NCurses::cols() - 6)
+ width = NCurses::cols() - 6;
+
+ yuiDebug() << "Dialog width: " << width << endl;
+
+ return width;
+ }
+
+ /**
+ * Compute the dialog X position on the screen.
+ * @return X position
+ */
+ int dialogXpos()
+ {
+ return (NCurses::cols() - dialogWidth()) / 2;
+ }
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -111,42 +189,6 @@
{
}
-namespace {
- std::string formatSize(double size, int width = 0)
- {
- // FSize::bestUnit does not work for huge numbers so only use it for small ones
- FSize::Unit unit = (size >= FSize::TB) ? FSize::T : FSize(size).bestUnit();
- int prec = unit == FSize::B ? 0 : 2;
-
- return zypp::str::form( "%*.*f %s", width, prec, size / FSize::factor(unit), FSize::unit(unit));
- }
-
- /**
- * Compute percent usage
- * @param used used size (any unit, but the same as the "total")
- * @param total total size (any unit, but the same as the "used")
- * @return percent, might be more than 100 if the size of the selected
- * packages is bigger than the available free size
- */
- int usedPercentInt(long long used, long long total)
- {
- int percent = 0;
-
- if ( total != 0 )
- // temporarily use double to avoid overflow
- percent = ( 100.0 * used ) / total;
-
- return percent;
- }
-
- // see usedPercentInt()
- std::string usedPercentStr(long long used, long long total)
- {
- int percent = usedPercentInt(used, total);
- return zypp::str::form( "%2d%%", percent );
- }
-}
-
///////////////////////////////////////////////////////////////////
//
//
@@ -160,30 +202,21 @@
NCTable * partitions = popupWin->Partitions();
partitions->deleteAllItems(); // clear table
- zypp::ZYpp::Ptr z = zypp::getZYpp();
- ZyppDuSet du = z->diskUsage ();
-
- if (du.empty())
- {
- // retry after detecting from the target
- z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
- du = z->diskUsage();
- }
-
+ ZyppDuSet du = get_du();
for (const ZyppPartitionDu &item: du)
{
- if (item.readonly)
- continue;
+ if (item.readonly)
+ continue;
- double pkg_used = double(item.pkg_size) * FSize::KB;
- double pkg_available = double(item.total_size - item.pkg_size) * FSize::KB;
- double total = double(item.total_size) * FSize::KB;
-
- YTableItem * newItem = new YTableItem( item.dir,
- formatSize(pkg_used, 8),
- formatSize(pkg_available, 8),
- formatSize(total, 8),
- usedPercentStr( item.pkg_size, item.total_size ) );
+ FSize pkg_used (item.pkg_size, FSize::Unit::K);
+ FSize pkg_available ((item.total_size - item.pkg_size), FSize::Unit::K);
+ FSize total (item.total_size, FSize::Unit::K);
+
+ YTableItem *newItem = new YTableItem( item.dir,
+ pkg_used.form(8),
+ pkg_available.form(8),
+ total.form(8),
+ usedPercent( pkg_used, total ) );
partitions->addItem( newItem );
}
@@ -200,39 +233,30 @@
//
std::string NCPkgDiskspace::checkDiskSpace()
{
- std::string text;
-
- zypp::ZYpp::Ptr z = zypp::getZYpp();
- ZyppDuSet du = z->diskUsage ();
+ ZyppDuSet diskUsage = get_du();
- if (du.empty())
+ std::string text = "";
+ for (const ZyppPartitionDu &du: diskUsage)
{
- // retry after detecting from the target
- z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
- du = z->diskUsage();
- }
+ if (du.readonly)
+ continue;
- for (const ZyppPartitionDu &item: du)
- {
- if (item.readonly)
- continue;
-
- // available size (in KiB!)
- long long pkg_available = item.total_size - item.pkg_size;
- if ( pkg_available < 0 )
- {
- text += "\"";
- text += item.dir;
- text += "\"";
- text += " ";
- text += NCPkgStrings::MoreText();
- text += " ";
- // make positive, use double to avoid overflow
- text += formatSize(-1.0 * double(pkg_available) * FSize::KB);
- text += " ";
- text += NCPkgStrings::MoreSpaceText();
- text += "<br>";
- }
+ FSize pkg_available(du.total_size - du.pkg_size, FSize::Unit::K);
+ if ( pkg_available < 0 )
+ {
+ // make it positive
+ pkg_available *= -1;
+ text += "\"";
+ text += du.dir;
+ text += "\"";
+ text += " ";
+ text += NCPkgStrings::MoreText();
+ text += " ";
+ text += pkg_available.asString();
+ text += " ";
+ text += NCPkgStrings::MoreSpaceText();
+ text += "<br>";
+ }
}
return text;
}
@@ -251,14 +275,16 @@
if ( partition.readonly )
return;
- int percent = usedPercentInt(partition.pkg_size, partition.total_size);
+ FSize usedSize ( partition.pkg_size, FSize::Unit::K );
+ FSize totalSize ( partition.total_size, FSize::Unit::K );
+
+ int percent = usedPercentInt(usedSize, totalSize);
- // free in MiB - libzyp sizes are already in KiB, divide by 1024 to get MiB
- long long free = (partition.total_size - partition.pkg_size) / 1024;
+ // free size in MiB
+ boost::multiprecision::cpp_int free = ( totalSize - usedSize ).in_unit(FSize::Unit::M);
- yuiMilestone() << "Partition: " << partition.dir << " Total (MiB): "
- << partition.total_size / 1024 << " Used (MiB): " << partition.pkg_size / 1024
- << " Used percent: " << percent << "% Free (MiB): " << free << endl;
+ yuiMilestone() << "Partition: " << partition.dir << " Used percent: "
+ << percent << " Free: " << free << endl;
if ( percent > MIN_PERCENT_WARN )
{
@@ -308,7 +334,9 @@
// set diskspace values in ZyppDuSet testDiskSpace
for ( const ZyppPartitionDu &partitionDu: testDiskUsage )
{
- int percent = usedPercentInt(partitionDu.pkg_size, partitionDu.total_size);
+ FSize usedSize ( partitionDu.pkg_size, FSize::Unit::K );
+ FSize totalSize ( partitionDu.total_size, FSize::Unit::K );
+ int percent = usedPercentInt(usedSize, totalSize);
if ( ch == '+' )
percent += 3;
@@ -318,11 +346,12 @@
if ( percent < 0 )
percent = 0;
- partitionDu.pkg_size = partitionDu.total_size / 100 * percent;
+ partitionDu.pkg_size = partitionDu.total_size / 100 * percent;
- // libzyp sizes are already in KiB, divide by 1024 to get MiB
- yuiMilestone() << "Used size (MiB): " << partitionDu.pkg_size / 1024 << endl;
- yuiMilestone() << "Total size (MiB): " << partitionDu.total_size / 1024 << endl;
+ FSize newSize ( partitionDu.pkg_size, FSize::Unit::K );
+
+ yuiMilestone() << "Used size (MiB): " << newSize.in_unit(FSize::Unit::M) << endl;
+ yuiMilestone() << "Total size (MiB): " << totalSize.in_unit(FSize::Unit::M) << endl;
}
}
@@ -346,14 +375,12 @@
else
diskUsage = zypp::getZYpp()->diskUsage();
- for ( ZyppDuSetIterator it = diskUsage.begin();
- it != diskUsage.end();
- ++it )
+ for (const ZyppPartitionDu &du: diskUsage)
{
//Exclude readonly dirs from the check (#384368)
- if( it->readonly )
+ if( du.readonly )
continue;
- checkRemainingDiskSpace( *it );
+ checkRemainingDiskSpace( du );
}
// see YQPkgDiskUsageList::postPendingWarnings()
@@ -388,20 +415,13 @@
}
}
-// FIXME: do not use this, contains overflow bug, use usedPercentStr() instead!
-std::string NCPkgDiskspace::usedPercent( FSize used, FSize total )
+std::string NCPkgDiskspace::usedPercent( const FSize &used, const FSize &total )
{
- int percent = 0;
- char percentStr[10];
-
- if ( total != 0 )
- percent = ( 100 * used ) / total;
-
- sprintf( percentStr, "%d%%", percent );
-
- return percentStr;
+ int percent = usedPercentInt(used, total);
+ return zypp::str::form( "%2d%%", percent );
}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -413,30 +433,21 @@
void NCPkgDiskspace::showInfoPopup( std::string headline )
{
- popupWin = new NCPkgPopupDiskspace (wpos( (NCurses::lines() - 15)/2, NCurses::cols()/6 ), headline );
+ popupWin = new NCPkgPopupDiskspace (wpos( (NCurses::lines() - 15)/2, dialogXpos() ), headline );
// update values in partition table
fillPartitionTable();
popupWin->doit();
YDialog::deleteTopmostDialog();
}
-zypp::ByteCount NCPkgDiskspace::calculateDiff()
+FSize NCPkgDiskspace::calculateDiff()
{
- zypp::ZYpp::Ptr z = zypp::getZYpp();
- ZyppDuSet du = z->diskUsage ();
+ ZyppDuSet diskUsage = get_du();
- if (du.empty())
- {
- // retry after detecting from the target
- z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
- du = z->diskUsage();
- }
-
- zypp::ByteCount diff = 0;
- for (const ZyppPartitionDu &item: du)
+ FSize diff = 0;
+ for (const ZyppPartitionDu &du: diskUsage)
{
- // the diff should be normally very small, the "long long" limit should be never reached (TM)
- diff += (item.pkg_size - item.used_size) * 1024;
+ diff += FSize(du.pkg_size - du.used_size, FSize::Unit::K);
}
return diff;
@@ -508,7 +519,7 @@
//
int NCPkgPopupDiskspace::preferredWidth()
{
- return NCurses::cols()*2/3;
+ return dialogWidth();
}
///////////////////////////////////////////////////////////////////
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/src/NCPkgPopupDiskspace.h new/libyui-ncurses-pkg-2.48.8/src/NCPkgPopupDiskspace.h
--- old/libyui-ncurses-pkg-2.48.7/src/NCPkgPopupDiskspace.h 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/src/NCPkgPopupDiskspace.h 2018-07-30 11:38:20.000000000 +0200
@@ -204,8 +204,7 @@
NCPkgPopupDiskspace *popupWin;
ZyppDuSet testDiskUsage;
- // FIXME: not used anymore, might overflow
- std::string usedPercent( FSize used, FSize total );
+ std::string usedPercent( const FSize &used, const FSize &total );
/**
* Warning range notifier about running out of disk space warning.
@@ -237,7 +236,7 @@
void checkRemainingDiskSpace( const ZyppPartitionDu & partition );
- zypp::ByteCount calculateDiff();
+ FSize calculateDiff();
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-pkg-2.48.7/src/NCPkgTable.cc new/libyui-ncurses-pkg-2.48.8/src/NCPkgTable.cc
--- old/libyui-ncurses-pkg-2.48.7/src/NCPkgTable.cc 2018-07-18 16:48:33.000000000 +0200
+++ new/libyui-ncurses-pkg-2.48.8/src/NCPkgTable.cc 2018-07-30 11:38:20.000000000 +0200
@@ -592,8 +592,8 @@
status = slbPtr->status(); // the package status
yuiMilestone() << "Status of " << slbPtr->name() << ": " << status << endl;
- zypp::ByteCount size = pkgPtr->installSize(); // installed size
- pkgLine.push_back( size.asString( 8 ) ); // format size
+ FSize size(zypp::ByteCount::SizeType(pkgPtr->installSize())); // installed size
+ pkgLine.push_back( size.form( 8 ) ); // format size
break;
}
@@ -623,8 +623,8 @@
++it;
}
- zypp::ByteCount size = pkgPtr->installSize(); // installed size
- pkgLine.push_back( size.asString( 8 ) ); // format size
+ FSize size(zypp::ByteCount::SizeType(pkgPtr->installSize())); // installed size
+ pkgLine.push_back( size.form( 8 ) ); // format size
pkgLine.push_back( pkgPtr->arch().asString()); // architecture
break;
@@ -639,8 +639,8 @@
status = slbPtr->pickStatus( itemPtr );
yuiMilestone() << "Multi version: status of " << version << ": " << status << endl;
- zypp::ByteCount size = pkgPtr->installSize(); // installed size
- pkgLine.push_back( size.asString( 8 ) ); // format size
+ FSize size(zypp::ByteCount::SizeType(pkgPtr->installSize())); // installed size
+ pkgLine.push_back( size.form( 8 ) ); // format size
pkgLine.push_back( pkgPtr->arch().asString()); // architecture
break;
}
@@ -670,8 +670,8 @@
status = slbPtr->status(); // the package status
- zypp::ByteCount size = pkgPtr->installSize(); // installed size
- pkgLine.push_back( size.asString( 8 ) ); // format size
+ FSize size(zypp::ByteCount::SizeType(pkgPtr->installSize())); // installed size
+ pkgLine.push_back( size.form( 8 ) ); // format size
// Selectable does not have source_install
#ifdef FIXME
1
0
Hello community,
here is the log from the commit of package upower for openSUSE:Factory checked in at 2018-08-02 14:55:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/upower (Old)
and /work/SRC/openSUSE:Factory/.upower.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "upower"
Thu Aug 2 14:55:04 2018 rev:62 rq:626421 version:0.99.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/upower/upower.changes 2018-06-08 23:10:22.607089538 +0200
+++ /work/SRC/openSUSE:Factory/.upower.new/upower.changes 2018-08-02 14:55:08.279975134 +0200
@@ -1,0 +2,24 @@
+Sat Jul 28 22:32:14 UTC 2018 - bjorn.lie(a)gmail.com
+
+- Update to version 0.99.8:
+ + New Features:
+ - Lock down systemd service file.
+ - Add support for "Unknown" capacity level, and clarify
+ handling of devices with coarse battery levels.
+ - Add a new version of up_client_get_devices() which unrefs
+ contents.
+ + Bugfixes:
+ - Fix warnings when D-Bus related properties change.
+ - Prevent crash after attaching an Apple TV, and support newer
+ versions of iOS.
+ - Lower severity of "unhandled action" messages.
+ - Fix battery status on MacBooks after a plug or unplug event.
+ - Fix double-close on exit.
+- Drop patches fixed upstream:
+ + upower-fix-ios-crash.patch.
+ + upower-fix-crash-logind-doesnt-return-error.patch.
+ + upower-fix-memory-leak.patch.
+- Refresh upower-hibernate-insteadof-hybridsleep.patch with quilt.
+- Use autosetup and make_build macros.
+
+-------------------------------------------------------------------
Old:
----
upower-0.99.7.tar.xz
upower-fix-crash-logind-doesnt-return-error.patch
upower-fix-ios-crash.patch
upower-fix-memory-leak.patch
New:
----
upower-0.99.8.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ upower.spec ++++++
--- /var/tmp/diff_new_pack.bLMpS0/_old 2018-08-02 14:55:08.895976163 +0200
+++ /var/tmp/diff_new_pack.bLMpS0/_new 2018-08-02 14:55:08.899976169 +0200
@@ -23,21 +23,16 @@
BuildRequires: pkgconfig(udev)
%endif
Name: upower
-Version: 0.99.7
+Version: 0.99.8
Release: 0
Summary: Power Device Enumeration Framework
License: GPL-2.0-or-later
Group: System/Daemons
-Url: http://upower.freedesktop.org/
-Source: http://upower.freedesktop.org/releases/%{name}-%{version}.tar.xz
+URL: https://upower.freedesktop.org/
+Source0: https://gitlab.freedesktop.org/upower/upower/uploads/9125ab7ee96fdc4ecc68cf…
# PATCH-FEATURE-OPENSUSE upower-hibernate-insteadof-hybridsleep.patch boo#985741 dimstar(a)opensuse.org -- Set the system per default to hibernate, not hybridsleep
Patch0: upower-hibernate-insteadof-hybridsleep.patch
-# PATCH-FIX-UPSTREAM upower-fix-ios-crash.patch fdo#105625 novell(a)mirell.de -- Fix endless crash loop freezing the system with AppleTV attached
-Patch1: upower-fix-ios-crash.patch
-# PATCH-FIX-UPSTREAM upower-fix-crash-logind-doesnt-return-error.patch -- Fix crash if logind doesn't return an error
-Patch2: upower-fix-crash-logind-doesnt-return-error.patch
-# PATCH-FIX-UPSTREAM upower-fix-memory-leak.patch -- Fix memory leak if logind returns an error
-Patch3: upower-fix-memory-leak.patch
+
BuildRequires: gobject-introspection-devel >= 0.9.9
BuildRequires: gtk-doc >= 1.11
BuildRequires: intltool
@@ -106,19 +101,16 @@
%lang_package
%prep
-%setup -q
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+%autosetup -p1
%build
-%configure\
+%configure \
--disable-static \
--libexecdir=%{_libexecdir}/upower \
--enable-gtk-doc \
- --with-udevrulesdir=%{_udevrulesdir}
-make %{?_smp_mflags}
+ --with-udevrulesdir=%{_udevrulesdir} \
+ %{nil}
+%make_build
%install
%make_install
++++++ upower-0.99.7.tar.xz -> upower-0.99.8.tar.xz ++++++
++++ 2544 lines of diff (skipped)
++++++ upower-hibernate-insteadof-hybridsleep.patch ++++++
--- /var/tmp/diff_new_pack.bLMpS0/_old 2018-08-02 14:55:09.139976570 +0200
+++ /var/tmp/diff_new_pack.bLMpS0/_new 2018-08-02 14:55:09.143976577 +0200
@@ -1,7 +1,7 @@
-Index: upower-0.99.7/etc/UPower.conf
+Index: upower-0.99.8/etc/UPower.conf
===================================================================
---- upower-0.99.7.orig/etc/UPower.conf
-+++ upower-0.99.7/etc/UPower.conf
+--- upower-0.99.8.orig/etc/UPower.conf 2017-09-08 15:29:32.000000000 +0200
++++ upower-0.99.8/etc/UPower.conf 2018-07-29 00:45:16.176796927 +0200
@@ -91,4 +91,4 @@ TimeAction=120
#
# If HybridSleep isn't available, Hibernate will be used
1
0
Hello community,
here is the log from the commit of package skopeo for openSUSE:Factory checked in at 2018-08-02 14:54:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/skopeo (Old)
and /work/SRC/openSUSE:Factory/.skopeo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "skopeo"
Thu Aug 2 14:54:58 2018 rev:9 rq:626419 version:0.1.31
Changes:
--------
--- /work/SRC/openSUSE:Factory/skopeo/skopeo.changes 2018-04-05 15:28:25.671123794 +0200
+++ /work/SRC/openSUSE:Factory/.skopeo.new/skopeo.changes 2018-08-02 14:55:02.451965399 +0200
@@ -1,0 +2,18 @@
+Mon Jul 30 05:39:38 UTC 2018 - vrothberg(a)suse.com
+
+- Update to skopeo v0.1.31:
+ * Fix compilation on i586
+
+-------------------------------------------------------------------
+Wed Jun 13 13:02:47 UTC 2018 - dcassany(a)suse.com
+
+- Make use of %license macro
+
+-------------------------------------------------------------------
+Tue May 22 06:54:22 UTC 2018 - vrothberg(a)suse.com
+
+- Update to skopeo v0.1.30:
+ * skopeo-copy: docker-archive: multitag support
+ * Updates to vendored libraries
+
+-------------------------------------------------------------------
Old:
----
skopeo-0.1.28.tar.xz
New:
----
skopeo-0.1.31.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ skopeo.spec ++++++
--- /var/tmp/diff_new_pack.zPWYWc/_old 2018-08-02 14:55:02.959966247 +0200
+++ /var/tmp/diff_new_pack.zPWYWc/_new 2018-08-02 14:55:02.963966254 +0200
@@ -22,7 +22,7 @@
%define with_libostree 1
%endif
Name: skopeo
-Version: 0.1.28
+Version: 0.1.31
Release: 0
Summary: Container image repository tool
License: Apache-2.0
@@ -77,7 +77,8 @@
make MANINSTALLDIR="%{buildroot}/%{_mandir}" install-docs
%files
-%doc LICENSE README.md
+%doc README.md
+%license LICENSE
%{_bindir}/%{name}
%{_mandir}/man1/skopeo.1*
++++++ _service ++++++
--- /var/tmp/diff_new_pack.zPWYWc/_old 2018-08-02 14:55:02.995966307 +0200
+++ /var/tmp/diff_new_pack.zPWYWc/_new 2018-08-02 14:55:02.999966314 +0200
@@ -3,8 +3,8 @@
<param name="url">https://github.com/projectatomic/skopeo</param>
<param name="scm">git</param>
<param name="filename">skopeo</param>
- <param name="versionformat">0.1.28</param>
- <param name="revision">v0.1.28</param>
+ <param name="versionformat">0.1.31</param>
+ <param name="revision">v0.1.31</param>
<param name="exclude">.git</param>
</service>
<service name="recompress" mode="disabled">
++++++ skopeo-0.1.28.tar.xz -> skopeo-0.1.31.tar.xz ++++++
++++ 145437 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package patterns-devel-base for openSUSE:Factory checked in at 2018-08-02 14:54:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/patterns-devel-base (Old)
and /work/SRC/openSUSE:Factory/.patterns-devel-base.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "patterns-devel-base"
Thu Aug 2 14:54:46 2018 rev:6 rq:626416 version:20170319
Changes:
--------
--- /work/SRC/openSUSE:Factory/patterns-devel-base/patterns-devel-base.changes 2018-07-27 10:52:33.841224090 +0200
+++ /work/SRC/openSUSE:Factory/.patterns-devel-base.new/patterns-devel-base.changes 2018-08-02 14:54:54.163951558 +0200
@@ -2 +2,7 @@
-Mon Dec 11 11:25:36 UTC 2017 - simonf.lees(a)suse.com
+Thu Jul 19 12:07:25 UTC 2018 - sflees(a)suse.de
+
+- Merge with the version from SLE/Leap 15 full changes now below
+ in the changelog.
+
+-------------------------------------------------------------------
+Mon Dec 11 11:25:36 UTC 2017 - sflees(a)suse.de
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ patterns-devel-base.spec ++++++
--- /var/tmp/diff_new_pack.ferBZl/_old 2018-08-02 14:54:56.307955138 +0200
+++ /var/tmp/diff_new_pack.ferBZl/_new 2018-08-02 14:54:56.311955145 +0200
@@ -285,6 +285,7 @@
echo "This file marks the pattern $i to be installed." \
>"%{buildroot}/usr/share/doc/packages/patterns/$i.txt"
done
+
%endif
for i in devel_basis devel_kernel; do
++++++ create_32bit-patterns_file.pl ++++++
--- /var/tmp/diff_new_pack.ferBZl/_old 2018-08-02 14:54:56.331955179 +0200
+++ /var/tmp/diff_new_pack.ferBZl/_new 2018-08-02 14:54:56.331955179 +0200
@@ -73,7 +73,7 @@
chomp($line);
next if ($line =~ m/^#/);
if ($line =~ m/\%package/) {
- if(($line =~ m/32bit/) or
+ if(($line =~ m/32bit/) or
($line =~ m/64bit/)
) {
$skip_it = 1;
@@ -81,9 +81,9 @@
%skip_pat_hash = map { $_ => 1 } @skip_pat;
if($skip_it==0&&!exists($skip_pat_hash{$cur_pattern})) {
$spec_file .= ""
- ."Provides: pattern() = ${cur_pattern}-32bit\n"
+ ."Provides: pattern() = ${cur_pattern}%2d32bit\n"
."Group: Metapackages\n"
- ."Supplements: packageand(patterns-${pat_ext}:patterns-${cur_pattern})\n"
+ ."Supplements: packageand(patterns-${product}-${pat_ext}:patterns-${product}-${cur_pattern})\n"
."\n"
."%files ${cur_pattern}-32bit\n"
."%defattr(-,root,root)\n"
@@ -123,14 +123,14 @@
$spec_file .= parse_line($line);
}
}
-
- %skip_pat_hash = map { $_ => 1 } @skip_pat;
+
+ %skip_pat_hash = map { $_ => 1 } @skip_pat;
if (!exists($skip_pat_hash{$cur_pattern})) {
# I hate this, but need a fast workaround
$spec_file .= "Provides: pattern-invisible()\n"
- ."Provides: pattern() = ${cur_pattern}-${pat_ext}\n"
+ ."Provides: pattern() = ${cur_pattern}%2d${pat_ext}\n"
."Group: Metapackages\n"
- ."Supplements: packageand(patterns-${pat_ext}:patterns-${cur_pattern})\n"
+ ."Supplements: packageand(patterns-${product}-${pat_ext}:patterns-${product}-${cur_pattern})\n"
."\n"
."%files ${cur_pattern}-32bit\n"
."%defattr(-,root,root)\n"
@@ -163,11 +163,10 @@
} elsif($arg =~ /-s/) {
push @skip_pat, shift;
}
-
+
}
print_debug("product = ${product}\n pat_ext=${pat_ext}\n", 1);
my $result = parse_main_file("patterns-${product}.spec");
print "${result}\n";
exit 0;
-
++++++ pattern-definition-32bit.txt ++++++
--- /var/tmp/diff_new_pack.ferBZl/_old 2018-08-02 14:54:56.355955219 +0200
+++ /var/tmp/diff_new_pack.ferBZl/_new 2018-08-02 14:54:56.355955219 +0200
@@ -38,9 +38,9 @@
Recommends: e2fsprogs-devel-32bit
Recommends: libapparmor-devel-32bit
Recommends: libosip2-devel-32bit
-Provides: pattern() = devel_basis-32bit
+Provides: pattern() = devel_basis%2d32bit
Group: Metapackages
-Supplements: packageand(patterns-32bit:patterns-devel_basis)
+Supplements: packageand(patterns-devel-base-32bit:patterns-devel-base-devel_basis)
%files devel_basis-32bit
%defattr(-,root,root)
@@ -64,9 +64,9 @@
Recommends: gitk-32bit
Recommends: git-email-32bit
Recommends: kernel-syms-32bit
-Provides: pattern() = devel_kernel-32bit
+Provides: pattern() = devel_kernel%2d32bit
Group: Metapackages
-Supplements: packageand(patterns-32bit:patterns-devel_kernel)
+Supplements: packageand(patterns-devel-base-32bit:patterns-devel-base-devel_kernel)
%files devel_kernel-32bit
%defattr(-,root,root)
++++++ pre_checkin.sh ++++++
--- /var/tmp/diff_new_pack.ferBZl/_old 2018-08-02 14:54:56.383955265 +0200
+++ /var/tmp/diff_new_pack.ferBZl/_new 2018-08-02 14:54:56.383955265 +0200
@@ -1,4 +1,3 @@
#!/bin/sh
./create_32bit-patterns_file.pl -p devel-base -s devel_rpm_build -s devel_web > pattern-definition-32bit.txt
-
1
0