14#include <zypp/base/Logger.h>
15#include <zypp/base/String.h>
16#include <zypp/base/Regex.h>
18#include <zypp/ExternalProgram.h>
19#include <zypp/AutoDispose.h>
20#include <zypp/PathInfo.h>
21#include <zypp/TriBool.h>
29 namespace applydeltarpm
35 const Pathname applydeltarpm_prog(
"/usr/bin/applydeltarpm" );
36 const str::regex applydeltarpm_tick (
"([0-9]+) percent finished" );
43 bool applydeltarpm(
const char *
const argv_r[],
52 report_r( str::strtonum<unsigned>( what[1] ) );
55 DBG <<
"Applydeltarpm : " << line;
57 return( prog.
close() == 0 );
72 static TriBool _last = indeterminate;
74 bool have = prog.
isX();
81 MIL <<
"Found executable " << prog << endl;
83 WAR <<
"No executable " << prog << endl;
85 return (
bool ) _last;
93 bool check(
const std::string & sequenceinfo_r,
bool quick_r )
98 const char *
const argv[] = {
99 "/usr/bin/applydeltarpm",
100 ( quick_r ?
"-C" :
"-c" ),
101 "-s", sequenceinfo_r.c_str(),
105 return( applydeltarpm( argv ) );
118 const char *
const argv[] = {
119 "/usr/bin/applydeltarpm",
120 ( quick_r ?
"-C" :
"-c" ),
125 return( applydeltarpm( argv ) );
142 const char *
const argv[] = {
143 "/usr/bin/applydeltarpm",
150 if ( ! applydeltarpm( argv, report_r ) )
172 const char *
const argv[] = {
173 "/usr/bin/applydeltarpm",
181 if ( ! applydeltarpm( argv, report_r ) )
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void resetDispose()
Set no dispose function.
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
int close()
Wait for the progamm to complete.
std::string receiveLine()
Read one line from the input stream.
Wrapper class for stat/lstat.
const std::string & asString() const
String representation.
Regular expression match result.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
bool haveApplydeltarpm()
Test whether an execuatble applydeltarpm program is available.
bool provide(const Pathname &delta_r, const Pathname &new_r, const Progress &report_r)
Apply a binary delta to on-disk data to re-create a new rpm.
bool check(const std::string &sequenceinfo_r, bool quick_r)
Check via sequence info.
function< void(unsigned)> Progress
progress reporting
int unlink(const Pathname &path)
Like 'unlink'.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Easy-to use interface to the ZYPP dependency resolver.