[packages/zbackup] - C++17 compatibility fixes; release 15
qboosh
qboosh at pld-linux.org
Sat Oct 4 07:16:49 CEST 2025
commit cee9471fecf6c0c86a8eb54163584a72a7db99ba
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Oct 4 07:19:59 2025 +0200
- C++17 compatibility fixes; release 15
zbackup-const.patch | 11 ++
zbackup-throw.patch | 462 ++++++++++++++++++++++++++++++++++++++++++++++++++++
zbackup.spec | 7 +-
3 files changed, 478 insertions(+), 2 deletions(-)
---
diff --git a/zbackup.spec b/zbackup.spec
index 67abe08..9004610 100644
--- a/zbackup.spec
+++ b/zbackup.spec
@@ -2,7 +2,7 @@ Summary: A versatile deduplicating backup tool
Summary(pl.UTF-8): Uniwersalne narzędzie do deduplikacji kopii zapasowych
Name: zbackup
Version: 1.4.4
-Release: 14
+Release: 15
License: GPL v2+ with OpenSSL Exception
Group: Applications/Archiving
#Source0Download: https://github.com/zbackup/zbackup/releases
@@ -10,6 +10,8 @@ Group: Applications/Archiving
Source0: https://github.com/zbackup/zbackup/archive/%{version}.tar.gz
# Source0-md5: 0753ca5d61533f951d6ebb6f087efa0b
Patch0: %{name}-protobuf.patch
+Patch1: %{name}-throw.patch
+Patch2: %{name}-const.patch
URL: http://zbackup.org/
BuildRequires: cmake >= 2.8.2
BuildRequires: libstdc++-devel >= 6:4.7
@@ -42,11 +44,12 @@ dopóki pliki nie różnią się bardzo - nie wymaga to dużo miejsca.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
%build
install -d build
cd build
-export CXXFLAGS="%{rpmcxxflags} -std=c++11"
%cmake ..
%{__make}
diff --git a/zbackup-const.patch b/zbackup-const.patch
new file mode 100644
index 0000000..097cf38
--- /dev/null
+++ b/zbackup-const.patch
@@ -0,0 +1,11 @@
+--- zbackup-1.4.4/objectcache.hh.orig 2015-09-16 09:28:04.000000000 +0200
++++ zbackup-1.4.4/objectcache.hh 2025-10-04 07:12:50.679746113 +0200
+@@ -66,7 +66,7 @@ private:
+
+ struct ObjectsIteratorComp
+ {
+- bool operator () ( Objects::iterator const & x, Objects::iterator const & y )
++ bool operator () ( Objects::iterator const & x, Objects::iterator const & y ) const
+ { return x->id < y->id; }
+ };
+
diff --git a/zbackup-throw.patch b/zbackup-throw.patch
new file mode 100644
index 0000000..34c7b75
--- /dev/null
+++ b/zbackup-throw.patch
@@ -0,0 +1,462 @@
+--- zbackup-1.4.4/file.hh.orig 2015-09-16 09:28:04.000000000 +0200
++++ zbackup-1.4.4/file.hh 2025-10-03 21:46:06.456488896 +0200
+@@ -40,26 +40,26 @@ public:
+ typedef long Offset;
+
+ File( char const * filename, OpenMode )
+- throw( exCantOpen );
++ ;
+
+ File( std::string const & filename, OpenMode )
+- throw( exCantOpen );
++ ;
+
+ /// Reads the number of bytes to the buffer, throws an error if it
+ /// failed to fill the whole buffer (short read, i/o error etc)
+- void read( void * buf, size_t size ) throw( exReadError, exWriteError );
++ void read( void * buf, size_t size ) ;
+
+ template< typename T >
+- void read( T & value ) throw( exReadError, exWriteError )
++ void read( T & value )
+ { read( &value, sizeof( value ) ); }
+
+ template< typename T >
+- T read() throw( exReadError, exWriteError )
++ T read()
+ { T value; read( value ); return value; }
+
+ /// Attempts reading at most 'count' records sized 'size'. Returns
+ /// the number of records it managed to read, up to 'count'
+- size_t readRecords( void * buf, size_t size, size_t count ) throw( exWriteError );
++ size_t readRecords( void * buf, size_t size, size_t count );
+
+ /// Writes the number of bytes from the buffer, throws an error if it
+ /// failed to write the whole buffer (short write, i/o error etc).
+@@ -67,10 +67,10 @@ public:
+ /// end up on disk immediately, or a short write may occur later
+ /// than it really did. If you don't want write buffering, use
+ /// writeRecords() function instead
+- void write( void const * buf, size_t size ) throw( exWriteError );
++ void write( void const * buf, size_t size );
+
+ template< typename T >
+- void write( T const & value ) throw( exWriteError )
++ void write( T const & value )
+ { write( &value, sizeof( value ) ); }
+
+ /// Attempts writing at most 'count' records sized 'size'. Returns
+@@ -78,61 +78,61 @@ public:
+ /// This function does not employ buffering, but flushes the buffer if it
+ /// was used before
+ size_t writeRecords( void const * buf, size_t size, size_t count )
+- throw( exWriteError );
++ ;
+
+ /// Reads a string from the file. Unlike the normal fgets(), this one
+ /// can strip the trailing newline character, if this was requested.
+ /// Returns either s or 0 if no characters were read
+- char * gets( char * s, int size, bool stripNl = false ) throw( exWriteError );
++ char * gets( char * s, int size, bool stripNl = false );
+
+ /// Like the above, but uses its own local internal buffer (1024 bytes
+ /// currently), and strips newlines by default
+- std::string gets( bool stripNl = true ) throw( exReadError, exWriteError );
++ std::string gets( bool stripNl = true );
+
+ /// Seeks in the file, relative to its beginning
+- void seek( long offset ) throw( exSeekError, exWriteError );
++ void seek( long offset );
+ /// Seeks in the file, relative to the current position
+- void seekCur( long offset ) throw( exSeekError, exWriteError );
++ void seekCur( long offset );
+ /// Seeks in the file, relative to the end of file
+- void seekEnd( long offset = 0 ) throw( exSeekError, exWriteError );
++ void seekEnd( long offset = 0 );
+
+ /// Seeks to the beginning of file
+- void rewind() throw( exSeekError, exWriteError );
++ void rewind();
+
+ /// Tells the current position within the file, relative to its beginning
+- size_t tell() throw( exSeekError );
++ size_t tell();
+
+ /// Returns file size
+- size_t size() throw( exSeekError, exWriteError );
++ size_t size();
+
+ /// Returns true if end-of-file condition is set
+- bool eof() throw( exWriteError );
++ bool eof();
+
+ /// Returns the underlying FILE * record, so other operations can be
+ /// performed on it
+- FILE * file() throw( exWriteError );
++ FILE * file();
+
+ /// Releases the file handle out of the control of the class. No further
+ /// operations are valid. The file will not be closed on destruction
+- FILE * release() throw( exWriteError );
++ FILE * release();
+
+ /// Closes the file. No further operations are valid
+- void close() throw( exWriteError );
++ void close();
+
+ /// Checks if the file exists or not
+- static bool exists( char const * filename ) throw();
++ static bool exists( char const * filename ) noexcept;
+
+- static bool exists( std::string const & filename ) throw()
++ static bool exists( std::string const & filename ) noexcept
+ { return exists( filename.c_str() ); }
+
+- ~File() throw();
++ ~File();
+
+ /// Erases the given file
+- static void erase( std::string const & ) throw( exCantErase );
++ static void erase( std::string const & );
+
+ /// Renames the given file
+ static void rename( std::string const & from,
+- std::string const & to ) throw( exCantRename );
++ std::string const & to );
+
+ /// Throwing this class instead of exReadError will make the description
+ /// include the file name
+@@ -143,8 +143,8 @@ public:
+ public:
+ exReadErrorDetailed( int fd );
+ exReadErrorDetailed( FILE * f );
+- virtual const char * what() const throw();
+- virtual ~exReadErrorDetailed() throw ();
++ virtual const char * what() const noexcept;
++ virtual ~exReadErrorDetailed() noexcept;
+
+ private:
+ void buildDescription( int fd );
+@@ -152,9 +152,9 @@ public:
+
+ private:
+
+- void open( char const * filename, OpenMode ) throw( exCantOpen );
+- void flushWriteBuffer() throw( exWriteError );
+- void releaseWriteBuffer() throw( exWriteError );
++ void open( char const * filename, OpenMode );
++ void flushWriteBuffer();
++ void releaseWriteBuffer();
+ };
+
+ #endif
+--- zbackup-1.4.4/file.cc.orig 2015-09-16 09:28:04.000000000 +0200
++++ zbackup-1.4.4/file.cc 2025-10-03 21:49:56.657789023 +0200
+@@ -23,7 +23,7 @@ enum
+ WriteBufferSize = 65536
+ };
+
+-bool File::exists( char const * filename ) throw()
++bool File::exists( char const * filename ) noexcept
+ {
+ #ifdef __WIN32
+ struct _stat buf;
+@@ -36,14 +36,14 @@ bool File::exists( char const * filename
+ #endif
+ }
+
+-void File::erase( std::string const & filename ) throw( exCantErase )
++void File::erase( std::string const & filename )
+ {
+ if ( remove( filename.c_str() ) != 0 )
+ throw exCantErase( filename );
+ }
+
+ void File::rename( std::string const & from,
+- std::string const & to ) throw( exCantRename )
++ std::string const & to )
+ {
+ int res = 0;
+ res = ::rename( from.c_str(), to.c_str() );
+@@ -82,7 +82,7 @@ void File::rename( std::string const & f
+ }
+ }
+
+-void File::open( char const * filename, OpenMode mode ) throw( exCantOpen )
++void File::open( char const * filename, OpenMode mode )
+ {
+ char const * m;
+
+@@ -104,19 +104,19 @@ void File::open( char const * filename,
+ throw exCantOpen( std::string( filename ) + ": " + strerror( errno ) );
+ }
+
+-File::File( char const * filename, OpenMode mode ) throw( exCantOpen ):
++File::File( char const * filename, OpenMode mode ):
+ writeBuffer( 0 )
+ {
+ open( filename, mode );
+ }
+
+ File::File( std::string const & filename, OpenMode mode )
+- throw( exCantOpen ): writeBuffer( 0 )
++ : writeBuffer( 0 )
+ {
+ open( filename.c_str(), mode );
+ }
+
+-void File::read( void * buf, size_t size ) throw( exReadError, exWriteError )
++void File::read( void * buf, size_t size )
+ {
+ if ( !size )
+ return;
+@@ -135,7 +135,7 @@ void File::read( void * buf, size_t size
+ }
+ }
+
+-size_t File::readRecords( void * buf, size_t size, size_t count ) throw( exWriteError )
++size_t File::readRecords( void * buf, size_t size, size_t count )
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -143,7 +143,7 @@ size_t File::readRecords( void * buf, si
+ return fread( buf, size, count, f );
+ }
+
+-void File::write( void const * buf, size_t size ) throw( exWriteError )
++void File::write( void const * buf, size_t size )
+ {
+ if ( !size )
+ return;
+@@ -189,7 +189,6 @@ void File::write( void const * buf, size
+ }
+
+ size_t File::writeRecords( void const * buf, size_t size, size_t count )
+- throw( exWriteError )
+ {
+ flushWriteBuffer();
+
+@@ -197,7 +196,6 @@ size_t File::writeRecords( void const *
+ }
+
+ char * File::gets( char * s, int size, bool stripNl )
+- throw( exWriteError )
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -224,7 +222,7 @@ char * File::gets( char * s, int size, b
+ return result;
+ }
+
+-std::string File::gets( bool stripNl ) throw( exReadError, exWriteError )
++std::string File::gets( bool stripNl )
+ {
+ char buf[ 1024 ];
+
+@@ -239,7 +237,7 @@ std::string File::gets( bool stripNl ) t
+ return std::string( buf );
+ }
+
+-void File::seek( long offset ) throw( exSeekError, exWriteError )
++void File::seek( long offset )
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -248,7 +246,7 @@ void File::seek( long offset ) throw( ex
+ throw exSeekError();
+ }
+
+-void File::seekCur( long offset ) throw( exSeekError, exWriteError )
++void File::seekCur( long offset )
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -257,7 +255,7 @@ void File::seekCur( long offset ) throw(
+ throw exSeekError();
+ }
+
+-void File::seekEnd( long offset ) throw( exSeekError, exWriteError )
++void File::seekEnd( long offset )
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -266,12 +264,12 @@ void File::seekEnd( long offset ) throw(
+ throw exSeekError();
+ }
+
+-void File::rewind() throw( exSeekError, exWriteError )
++void File::rewind()
+ {
+ seek( 0 );
+ }
+
+-size_t File::tell() throw( exSeekError )
++size_t File::tell()
+ {
+ long result = ftell( f );
+
+@@ -284,7 +282,7 @@ size_t File::tell() throw( exSeekError )
+ return ( size_t ) result;
+ }
+
+-size_t File::size() throw( exSeekError, exWriteError )
++size_t File::size()
+ {
+ size_t cur = tell();
+ seekEnd( 0 );
+@@ -294,7 +292,7 @@ size_t File::size() throw( exSeekError,
+ return result;
+ }
+
+-bool File::eof() throw( exWriteError )
++bool File::eof()
+ {
+ if ( writeBuffer )
+ flushWriteBuffer();
+@@ -302,14 +300,14 @@ bool File::eof() throw( exWriteError )
+ return feof( f );
+ }
+
+-FILE * File::file() throw( exWriteError )
++FILE * File::file()
+ {
+ flushWriteBuffer();
+
+ return f;
+ }
+
+-FILE * File::release() throw( exWriteError )
++FILE * File::release()
+ {
+ releaseWriteBuffer();
+
+@@ -320,12 +318,12 @@ FILE * File::release() throw( exWriteErr
+ return c;
+ }
+
+-void File::close() throw( exWriteError )
++void File::close()
+ {
+ fclose( release() );
+ }
+
+-File::~File() throw()
++File::~File() noexcept
+ {
+ if ( f )
+ {
+@@ -340,7 +338,7 @@ File::~File() throw()
+ }
+ }
+
+-void File::flushWriteBuffer() throw( exWriteError )
++void File::flushWriteBuffer()
+ {
+ if ( writeBuffer && writeBufferLeft != WriteBufferSize )
+ {
+@@ -353,7 +351,7 @@ void File::flushWriteBuffer() throw( exW
+ }
+ }
+
+-void File::releaseWriteBuffer() throw( exWriteError )
++void File::releaseWriteBuffer()
+ {
+ flushWriteBuffer();
+
+@@ -391,11 +389,11 @@ void File::exReadErrorDetailed::buildDes
+ description.append( path, pathChars );
+ }
+
+-const char * File::exReadErrorDetailed::what() const throw()
++const char * File::exReadErrorDetailed::what() const noexcept
+ {
+ return description.c_str();
+ }
+
+-File::exReadErrorDetailed::~exReadErrorDetailed() throw ()
++File::exReadErrorDetailed::~exReadErrorDetailed() noexcept
+ {
+ }
+--- zbackup-1.4.4/unbuffered_file.hh.orig 2015-09-16 09:28:04.000000000 +0200
++++ zbackup-1.4.4/unbuffered_file.hh 2025-10-04 07:13:22.719925645 +0200
+@@ -37,23 +37,23 @@ public:
+ typedef int64_t Offset;
+
+ /// Opens the given file
+- UnbufferedFile( char const * fileName, Mode ) throw( exCantOpen );
++ UnbufferedFile( char const * fileName, Mode );
+
+ /// Reads up to 'size' bytes into the buffer. Returns the number of bytes
+ /// read. If the value returned is less than the 'size' provided, the end of
+ /// file was reached
+- size_t read( void * buf, size_t size ) throw( exReadError );
++ size_t read( void * buf, size_t size );
+
+ /// Writes 'size' bytes
+- void write( void const * buf, size_t size ) throw( exWriteError );
++ void write( void const * buf, size_t size );
+
+ /// Returns file size
+- Offset size() throw( exSeekError );
++ Offset size();
+
+ /// Seeks to the given offset, relative to the current file offset
+- void seekCur( Offset ) throw( exSeekError );
++ void seekCur( Offset );
+
+- ~UnbufferedFile() throw();
++ ~UnbufferedFile() noexcept;
+
+ private:
+ int fd;
+--- zbackup-1.4.4/unbuffered_file.cc.orig 2015-09-16 09:28:04.000000000 +0200
++++ zbackup-1.4.4/unbuffered_file.cc 2025-10-04 07:13:58.146790821 +0200
+@@ -19,7 +19,6 @@
+
+
+ UnbufferedFile::UnbufferedFile( char const * fileName, Mode mode )
+- throw( exCantOpen )
+ {
+
+ int flags = ( mode == WriteOnly ? ( O_WRONLY | O_CREAT | O_TRUNC ) :
+@@ -33,7 +32,6 @@ UnbufferedFile::UnbufferedFile( char con
+ }
+
+ size_t UnbufferedFile::read( void * buf, size_t size )
+- throw( exReadError )
+ {
+ char * next = ( char * ) buf;
+ size_t left = size;
+@@ -61,7 +59,6 @@ size_t UnbufferedFile::read( void * buf,
+ }
+
+ void UnbufferedFile::write( void const * buf, size_t size )
+- throw( exWriteError )
+ {
+ char const * next = ( char const * ) buf;
+ size_t left = size;
+@@ -83,7 +80,7 @@ void UnbufferedFile::write( void const *
+ }
+ }
+
+-UnbufferedFile::Offset UnbufferedFile::size() throw( exSeekError )
++UnbufferedFile::Offset UnbufferedFile::size()
+ {
+ Offset cur = lseek64( fd, 0, SEEK_CUR );
+ if ( cur < 0 )
+@@ -94,13 +91,13 @@ UnbufferedFile::Offset UnbufferedFile::s
+ return result;
+ }
+
+-void UnbufferedFile::seekCur( Offset offset ) throw( exSeekError )
++void UnbufferedFile::seekCur( Offset offset )
+ {
+ if ( lseek64( fd, offset, SEEK_CUR ) < 0 )
+ throw exSeekError();
+ }
+
+-UnbufferedFile::~UnbufferedFile() throw()
++UnbufferedFile::~UnbufferedFile() noexcept
+ {
+ close( fd );
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/zbackup.git/commitdiff/cee9471fecf6c0c86a8eb54163584a72a7db99ba
More information about the pld-cvs-commit
mailing list