17#include <zypp-core/base/DefaultIntegral>
33#include <zypp-core/base/InputStream>
62 if (
PathInfo(path_r/
"/repodata/repomd.xml").isFile() )
64 else if (
PathInfo(path_r/
"/content").isFile() )
66 else if (
PathInfo(path_r/
"/cookie").isFile() )
69 DBG <<
"Probed cached type " << ret <<
" at " << path_r << endl;
82 const char * envp = getenv(
"XDG_CACHE_HOME" );
87 ret = getenv(
"HOME" );
145 std::string licenseStem(
"license" );
146 if ( !name_r.empty() )
149 licenseStem += name_r;
207 bool isAutoMirrorList =
false;
215 if ( !
path.emptyOrRoot () )
220 MIL <<
"Detected opensuse.org baseUrl with no mirrors, requesting them from : " << mlurl.
asString() << std::endl;
221 isAutoMirrorList =
true;
237 MIL <<
"Mirrorlist failed, repo either returns invalid data or has no mirrors at all!" << std::endl;
238 if ( !isAutoMirrorList ) {
240 data.
set(
"error", e );
257 origins.
addEndpoints( mirrs.transformedBegin(), mirrs.transformedEnd() );
280 return (*
baseUrls().transformedBegin()).asString();
281 return std::string();
314 [
this](
int num_r,
const std::string& line_r )->
bool
318 std::vector<std::string> words;
319 if (
str::split( line_r, std::back_inserter(words) ) > 1
320 && words[0].length() == 12 )
322 this->
_keywords.second.insert( ++words.begin(), words.end() );
361 if (
PathInfo(gpgcheckFile).isExist() )
386 static const Pathname truePath(
"true" );
387 static const Pathname falsePath(
"false" );
388 static const Pathname indeterminatePath(
"indeterminate" );
391 static const ssize_t bufsiz = 63;
392 static char buf[bufsiz+1];
393 ssize_t ret = ::readlink( path_r.
c_str(), buf, bufsiz );
394 buf[ret == -1 ? 0 : ret] =
'\0';
399 if ( linkval == truePath )
401 else if ( linkval == falsePath )
403 else if ( linkval == indeterminatePath )
521 mutable std::pair<FalseBool, std::set<std::string> >
_keywords;
528 {
return new Impl( *
this ); }
535 return str <<
"RepoInfo::Impl";
554 {
return _pimpl->priority; }
567 {
return _pimpl->cfgGpgCheck(); }
570 {
_pimpl->rawGpgCheck( value_r ); }
582 if ( ret &&
_pimpl->internalUnsignedConfirmed() )
588 {
_pimpl->rawRepoGpgCheck( value_r ); }
598 {
_pimpl->rawPkgGpgCheck( value_r ); }
603 g_r =
_pimpl->rawGpgCheck();
604 r_r =
_pimpl->rawRepoGpgCheck();
605 p_r =
_pimpl->rawPkgGpgCheck();
617 {
_pimpl->internalSetValidRepoSignature( value_r ); }
623 {
if ( ! sameTriboolState( lhs, rhs ) ) { lhs = rhs;
return true; }
return false; }
627 bool changed =
false;
628 if ( changeGpgCheckTo( ogpg[0], g ) ) changed =
true;
629 if ( changeGpgCheckTo( ogpg[1], r ) ) changed =
true;
630 if ( changeGpgCheckTo( ogpg[2], p ) ) changed =
true;
640 bool changed =
false;
647 changed = changeGpgCheckTo( ogpg,
true,
true,
true );
650 changed = changeGpgCheckTo( ogpg,
true,
false,
false );
653 changed = changeGpgCheckTo( ogpg,
true,
false,
indeterminate );
656 changed = changeGpgCheckTo( ogpg,
true,
indeterminate,
false );
678 {
_pimpl->setMirrorlistUrl( url_r ); }
681 {
_pimpl->setMetalinkUrl( url_r ); }
684 {
return _pimpl->cfgMirrorlistUrl().raw(); }
687 {
return _pimpl->cfgMetalinkUrl().raw(); }
690 void RepoInfo::setMirrorListUrl(
const Url & url_r )
692 void RepoInfo::setMirrorListUrls( url_set urls )
694 void RepoInfo::setMetalinkUrls( url_set urls )
695 {
_pimpl->setMetalinkUrl( urls.empty() ?
Url() : urls.front() ); }
699 {
_pimpl->gpgKeyUrls().raw().swap( urls ); }
703 _pimpl->gpgKeyUrls().raw().clear();
704 _pimpl->gpgKeyUrls().raw().push_back( url_r );
708 {
return _pimpl->repoStatusString(); }
712 for (
const auto &
url :
_pimpl->baseUrls().raw() )
716 _pimpl->baseUrls().raw().push_back( url_r );
717 _pimpl->resetMirrorUrls ();
722 _pimpl->baseUrls().raw().clear();
723 _pimpl->resetMirrorUrls ();
724 _pimpl->baseUrls().raw().push_back( std::move(url_r) );
729 _pimpl->resetMirrorUrls ();
730 _pimpl->baseUrls().raw().swap( urls );
735 return _pimpl->repoOrigins();
740 return (
_pimpl->baseUrls().empty () &&
_pimpl->mirrorUrls().empty() );
750 {
_pimpl->setProbedType( t ); }
760 {
return _pimpl->predownloadPath(); }
763 {
_pimpl->keeppackages = keep; }
778 {
return _pimpl->metadataPath(); }
781 {
return _pimpl->systemPackagesPath(); }
784 {
return _pimpl->packagesPath(); }
787 {
return _pimpl->usesAutoMetadataPaths(); }
790 {
return _pimpl->type(); }
793 {
return _pimpl->mirrorListUrl().transformed(); }
796 {
return _pimpl->mirrorListUrl().raw(); }
799 {
return _pimpl->gpgKeyUrls().empty(); }
802 {
return _pimpl->gpgKeyUrls().size(); }
805 {
return _pimpl->gpgKeyUrls().transformed(); }
808 {
return _pimpl->gpgKeyUrls().raw(); }
811 {
return(
_pimpl->gpgKeyUrls().empty() ?
Url() : *
_pimpl->gpgKeyUrls().transformedBegin() ); }
814 {
return(
_pimpl->gpgKeyUrls().empty() ?
Url() : *
_pimpl->gpgKeyUrls().rawBegin() ) ; }
817 {
return _pimpl->baseUrls().transformed(); }
820 {
return _pimpl->baseUrls().raw(); }
826 {
return _pimpl->service; }
829 {
return _pimpl->targetDistro; }
832 {
return _pimpl->baseUrl().raw(); }
835 {
return _pimpl->location (); }
838 {
return _pimpl->baseUrls().transformedBegin(); }
841 {
return _pimpl->baseUrls().transformedEnd(); }
844 {
return _pimpl->baseUrls().size(); }
847 {
return _pimpl->baseUrls().empty(); }
850 {
return _pimpl->baseurl2dump(); }
854 return _pimpl->baseUrl().transformed();
858 {
return _pimpl->contentKeywords(); }
861 {
_pimpl->addContent( keyword_r ); }
864 {
return _pimpl->hasContent(); }
867 {
return _pimpl->hasContent( keyword_r ); }
875 {
return !
_pimpl->licenseTgz( name_r ).empty(); }
884 if ( licenseTgz.
empty() )
888 cmd.push_back(
"tar" );
889 cmd.push_back(
"-t" );
890 cmd.push_back(
"-z" );
891 cmd.push_back(
"-f" );
892 cmd.push_back( licenseTgz.
asString() );
896 static const std::string noAcceptanceFile =
"no-acceptance-needed\n";
899 if ( output == noAcceptanceFile )
905 MIL <<
"License(" << name_r <<
") in " <<
name() <<
" has to be accepted: " << (accept?
"true":
"false" ) << endl;
914 {
return getLicense( std::string(), lang_r ); }
919 if ( avlocales.empty() )
920 return std::string();
923 if ( !getLang && avlocales.find(
Locale::noCode ) == avlocales.end() )
925 WAR <<
"License(" << name_r <<
") in " <<
name() <<
" contains no fallback text!" << endl;
929 getLang = *avlocales.begin();
933 static const std::string licenseFileFallback(
"license.txt" );
934 std::string licenseFile( !getLang ? licenseFileFallback
938 cmd.push_back(
"tar" );
939 cmd.push_back(
"-x" );
940 cmd.push_back(
"-z" );
941 cmd.push_back(
"-O" );
942 cmd.push_back(
"-f" );
943 cmd.push_back(
_pimpl->licenseTgz( name_r ).asString() );
944 cmd.push_back( licenseFile );
963 if ( licenseTgz.
empty() )
967 cmd.push_back(
"tar" );
968 cmd.push_back(
"-t" );
969 cmd.push_back(
"-z" );
970 cmd.push_back(
"-f" );
971 cmd.push_back( licenseTgz.
asString() );
977 static const C_Str license(
"license." );
978 static const C_Str dotTxt(
".txt\n" );
981 if ( output.size() <= license.
size() + dotTxt.
size() )
984 ret.insert(
Locale( std::string( output.c_str()+license.
size(), output.size()- license.
size() - dotTxt.
size() ) ) );
995 RepoInfoBase::dumpOn(
str);
996 if (
_pimpl->baseurl2dump() )
998 for (
const auto &
url :
_pimpl->baseUrls().raw() )
1000 str <<
"- url : " <<
url << std::endl;
1005 auto strif( [&] (
const std::string & tag_r,
const std::string & value_r ) {
1006 if ( ! value_r.empty() )
1007 str << tag_r << value_r << std::endl;
1010 strif(
"- mirrorlist : ",
_pimpl->cfgMirrorlistUrl().raw().asString() );
1011 strif(
"- metalink : ",
_pimpl->cfgMetalinkUrl().raw().asString() );
1013 str <<
"- type : " <<
type() << std::endl;
1014 str <<
"- priority : " <<
priority() << std::endl;
1017#define OUTS(T,B) ( indeterminate(T) ? (std::string("D(")+(B?"Y":"N")+")") : ((bool)T?"Y":"N") )
1025 for (
const auto &
url :
_pimpl->gpgKeyUrls().raw() )
1027 str <<
"- gpgkey : " <<
url << std::endl;
1033 strif(
"- service : ",
service() );
1046 str <<
"# Repository '"<<
alias()<<
"' is maintained by the '"<<
service()<<
"' service." << endl;
1047 str <<
"# Manual changes may be overwritten by a service refresh." << endl;
1048 str <<
"# See also 'man zypper', section 'Services'." << endl;
1050 RepoInfoBase::dumpAsIniOn(
str);
1052 if (
_pimpl->baseurl2dump() )
1056 for (
const auto &
url :
_pimpl->baseUrls().raw() )
1059 if ( indent.empty() ) indent =
" ";
1063 if ( !
_pimpl->path.empty() )
1064 str <<
"path="<<
path() << endl;
1066 if ( !
_pimpl->cfgMirrorlistUrl().raw().asString().empty() )
1069 if ( !
_pimpl->cfgMetalinkUrl().raw().asString().empty() )
1079 str <<
"gpgcheck=" << (
_pimpl->rawGpgCheck() ?
"1" :
"0") << endl;
1082 str <<
"repo_gpgcheck=" << (
_pimpl->rawRepoGpgCheck() ?
"1" :
"0") << endl;
1085 str <<
"pkg_gpgcheck=" << (
_pimpl->rawPkgGpgCheck() ?
"1" :
"0") << endl;
1088 std::string indent(
"gpgkey=");
1089 for (
const auto &
url :
_pimpl->gpgKeyUrls().raw() )
1091 str << indent <<
url << endl;
1092 if ( indent[0] !=
' ' )
1116 <<
" priority=\"" <<
priority() <<
"\""
1117 <<
" enabled=\"" <<
enabled() <<
"\""
1119 <<
" gpgcheck=\"" <<
gpgCheck() <<
"\""
1123 str <<
" raw_gpgcheck=\"" << (
_pimpl->rawGpgCheck() ?
"1" :
"0") <<
"\"";
1125 str <<
" raw_repo_gpgcheck=\"" << (
_pimpl->rawRepoGpgCheck() ?
"1" :
"0") <<
"\"";
1127 str <<
" raw_pkg_gpgcheck=\"" << (
_pimpl->rawPkgGpgCheck() ?
"1" :
"0") <<
"\"";
1129 str <<
" gpgkey=\"" <<
escape(tmpstr) <<
"\"";
1130 if ( ! (tmpstr =
_pimpl->cfgMirrorlistUrl().transformed().asString()).empty() )
1131 str <<
" mirrorlist=\"" <<
escape(tmpstr) <<
"\"";
1132 if ( ! (tmpstr =
_pimpl->cfgMetalinkUrl().transformed().asString()).empty() )
1133 str <<
" metalink=\"" <<
escape(tmpstr) <<
"\"";
1136 if (
_pimpl->baseurl2dump() )
1139 str <<
"<url>" <<
escape((*it).asString()) <<
"</url>" << endl;
1142 str <<
"</repo>" << endl;
1156#define OUTS( V ) case RepoInfo::V: return str << #V; break
1157 OUTS( GpgCheck::On );
1158 OUTS( GpgCheck::Strict );
1159 OUTS( GpgCheck::AllowUnsigned );
1160 OUTS( GpgCheck::AllowUnsignedRepo );
1161 OUTS( GpgCheck::AllowUnsignedPackage );
1162 OUTS( GpgCheck::Default );
1163 OUTS( GpgCheck::Off );
1164 OUTS( GpgCheck::indeterminate );
1167 return str <<
"GpgCheck::UNKNOWN";
1174 const auto &origins =
_pimpl->repoOrigins ();
1175 bool canSkipMediaCheck = std::all_of( origins.begin(), origins.end(), [](
const MirroredOrigin &origin ) { return origin.authority().url().schemeIsDownloading(); });
1176 if ( canSkipMediaCheck ) {
1178 if ( not mDataPath.empty() ) {
1179 PathInfo mediafile { mDataPath/
"media.1/media" };
1182 if ( lverifier && lverifier.
totalMedia() > 1 ) {
1183 canSkipMediaCheck =
false;
1188 if ( canSkipMediaCheck )
1189 DBG <<
"Can SKIP media.1/media check for status calc of repo " <<
alias() << endl;
1190 return not canSkipMediaCheck;
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
Helper managing repo variables replaced urls.
base::ContainerTransform< std::list< Url >, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrlList
Helper managing repo variables replaced url lists.
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Integral type with defined initial value when default constructed.
Base class for Exception.
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
int close() override
Wait for the progamm to complete.
std::vector< std::string > Arguments
const char * c_str() const
'Language[_Country]' codes.
static const Locale noCode
Empty code.
static Locale bestMatch(const LocaleSet &avLocales_r, Locale requested_r=Locale())
Return the best match for Locale requested_r within the available avLocales_r.
A smart container that manages a collection of MirroredOrigin objects, automatically grouping endpoin...
void addEndpoints(InputIterator first, InputIterator last)
A convenience method to add multiple endpoints from a range.
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
void setPkgGpgCheck(TriBool value_r)
Set the value for pkgGpgCheck (or indeterminate to use the default).
std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const override
Write an XML representation of this RepoInfo object.
void setGpgKeyUrls(url_set urls)
Set a list of gpgkey URLs defined for this repo.
void setMetalinkUrl(const Url &url)
Set the raw metalink url.
std::ostream & dumpOn(std::ostream &str) const override
Write a human-readable representation of this RepoInfo object into the str stream.
Pathname metadataPath() const
Path where this repo metadata was read from.
void setMirrorlistUrl(const Url &url)
Set the raw mirrorlist url.
url_set::size_type urls_size_type
void setGpgKeyUrl(const Url &gpgkey)
(leagcy API) Set the gpgkey URL defined for this repo
bool usesAutoMetadataPaths() const
Whether metadataPath uses AUTO% setup.
GpgCheck
Some predefined settings.
bool baseUrlsEmpty() const
whether repository urls are available
Pathname predownloadPath() const
Path where this repo packages are predownloaded.
bool hasContent() const
Check for content keywords.
MirroredOriginSet repoOrigins() const
The repodata origins.
void setKeepPackages(bool keep)
Set if packaqes downloaded from this repository will be kept in local cache.
url_set gpgKeyUrls() const
The list of gpgkey URLs defined for this repo.
Url rawGpgKeyUrl() const
(leagcy API) The 1st raw gpgkey URL defined for this repo (no variables replaced)
transform_iterator< repo::RepoVariablesUrlReplacer, url_set::const_iterator > urls_const_iterator
Url rawUrl() const
Pars pro toto: The first repository raw url (no variables replaced) this is either rawBaseUrls()....
repo::RepoType type() const
Type of repository,.
url_set rawGpgKeyUrls() const
The list of raw gpgkey URLs defined for this repo (no variables replaced).
static unsigned noPriority()
The least priority (unsigned(-1)).
urls_size_type baseUrlsSize() const
number of repository urls
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Url url() const
Pars pro toto: The first repository url, this is either baseUrls().front() or if no baseUrl is define...
static const RepoInfo noRepo
Represents no Repository (one with an empty alias).
void setBaseUrl(Url url)
Clears current base URL list and adds url.
const std::set< std::string > & contentKeywords() const
Content keywords defined.
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
Url location() const
Returns the location URL for the repository, this is either the first configured baseUrl or a configu...
void setPackagesPath(const Pathname &path)
set the path where the local packages are stored
Url rawCfgMetalinkUrl() const
The configured raw metalink url.
std::string getLicense(const Locale &lang_r=Locale()) const
Return the best license for the current (or a specified) locale.
bool baseUrlSet() const
Whether there are manualy configured repository urls.
void setService(const std::string &name)
sets service which added this repository
void setGpgCheck(TriBool value_r)
Set the value for gpgCheck (or indeterminate to use the default).
bool effectiveKeepPackages() const
keepPackages unless the package cache itself enforces keeping the packages.
Pathname path() const
Repository path.
urls_size_type gpgKeyUrlsSize() const
Number of gpgkey URLs defined.
LocaleSet getLicenseLocales() const
Return the locales the license is available for.
url_set baseUrls() const
The complete set of repository urls as configured.
bool requireStatusWithMediaFile() const
Returns true if this repository requires the media.1/media file to be included in the metadata status...
void addBaseUrl(Url url)
Add a base url.
bool pkgGpgCheckIsMandatory() const
Mandatory check (pkgGpgCheck is not off) must ask to confirm using unsigned packages.
url_set rawBaseUrls() const
The complete set of raw repository urls (no variables replaced).
Url mirrorListUrl() const
Url of a file which contains a list of repository urls.
void setProbedType(const repo::RepoType &t) const
This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects.
void setBaseUrls(url_set urls)
Clears current base URL list and adds an url_set.
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
void setTargetDistribution(const std::string &targetDistribution)
Sets the distribution for which is this repository meant.
std::ostream & dumpAsIniOn(std::ostream &str) const override
Write this RepoInfo object into str in a .repo file format.
unsigned priority() const
Repository priority for solver.
bool gpgCheck() const
Whether default signature checking should be performed.
void setPath(const Pathname &path)
set the product path.
Url gpgKeyUrl() const
(leagcy API) The 1st gpgkey URL defined for this repo
void setValidRepoSignature(TriBool value_r)
Set the value for validRepoSignature (or indeterminate if unsigned).
static unsigned defaultPriority()
The default priority (99).
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
void setPriority(unsigned newval_r)
Set repository priority for solver.
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
bool hasLicense() const
Whether there is a license associated with the repo.
bool repoGpgCheckIsMandatory() const
Mandatory check (repoGpgCheck is on) must ask to confirm using unsigned repos.
void setMetadataPath(const Pathname &path)
Set the path where the local metadata is stored.
TriBool validRepoSignature() const
Whether the repo metadata are signed and successfully validated or indeterminate if unsigned.
void setRepoGpgCheck(TriBool value_r)
Set the value for repoGpgCheck (or indeterminate to use the default).
Pathname packagesPath() const
packagesPath Checks if the effective user is allowed to write into the system package cache.
void addContent(const std::string &keyword_r)
Add content keywords.
bool repoGpgCheck() const
Whether the signature of repo metadata should be checked for this repo.
std::string targetDistribution() const
Distribution for which is this repository meant.
void getRawGpgChecks(TriBool &g_r, TriBool &r_r, TriBool &p_r) const
Raw values for RepoManager.
void setType(const repo::RepoType &t)
set the repository type
bool pkgGpgCheck() const
Whether the signature of rpm packages should be checked for this repo.
std::string repoStatusString() const
A string value to track changes requiring a refresh.
Url rawMirrorListUrl() const
The raw mirrorListUrl (no variables replaced).
bool gpgKeyUrlsEmpty() const
Whether gpgkey URLs are defined.
Pathname systemPackagesPath() const
Returns a path to the system-defined package cache.
Url rawCfgMirrorlistUrl() const
The configured raw mirrorlist url.
bool repoOriginsEmpty() const
whether repo origins are available
std::string asString() const
Returns a default string representation of the Url object.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
void setQueryParam(const std::string ¶m, const std::string &value)
Set or add value for the specified query parameter.
void pathNameSetTrailingSlash(bool apply_r=true)
Apply or remove a trailing '/' from pathName.
bool gpgCheck() const
Turn signature checking on/off (on).
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck).
static ZConfig & instance()
Singleton ctor.
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck).
Typesafe passing of user data via callbacks.
bool set(const std::string &key_r, AnyType val_r)
Set the value for key (nonconst version always returns true).
std::string receiveLine()
Read one line from the input stream.
Find pathnames matching a pattern.
bool empty() const
Whether matches were found.
const_iterator begin() const
Iterator pointing to the first result.
int add(const Pathname &pattern_r, Flags flags_r=Flags())
Add pathnames matching pattern_r to the current result.
Wrapper class for stat/lstat.
const Pathname & path() const
Return current Pathname.
bool isExist() const
Return whether valid stat info exists.
const char * c_str() const
String representation.
const std::string & asString() const
String representation.
bool empty() const
Test for an empty path.
Pathname filepath() const
File where this repo was read from.
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
std::string name() const
Repository name.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
std::string alias() const
unique identifier for this source.
static bool urlSupportsMirrorLink(const zypp::Url &url)
const std::vector< Url > & getUrls() const
xmlTextReader based interface to iterate xml streams.
bool seekToEndNode(int depth_r, const std::string &name_r)
XmlString nodeText()
If the current node is not empty, advances the reader to the next node, and returns the value.
bool seekToNode(int depth_r, const std::string &name_r)
std::string asString() const
Explicit conversion to std::string.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
zypp::Url propagateQueryParams(zypp::Url url_r, const zypp::Url &template_r)
String related utilities and Regular expression matching.
int symlink(const Pathname &oldpath, const Pathname &newpath)
Like 'symlink'.
int unlink(const Pathname &path)
Like 'unlink'.
std::string asString(const Url &url_r)
int forEachLine(std::istream &str_r, const function< bool(int, std::string)> &consume_r)
Simple lineparser: Call functor consume_r for each line.
filesystem::Pathname XDG_CACHE_HOME()
XDG_CACHE_HOME: base directory relative to which user specific non-essential data files should be sto...
bool hasSuffix(const C_Str &str_r, const C_Str &suffix_r)
Return whether str_r has suffix suffix_r.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::string asString(const Patch::Category &obj)
static bool warning(const std::string &msg_r, const UserData &userData_r=UserData())
send warning text
static const ContentType repoRefreshMirrorlist
TriBool rawPkgGpgCheck() const
TriBool _rawRepoGpgCheck
need to check repo sign.: Y/N/(ZConf(Y/N/gpgCheck))
TriBool internalValidRepoSignature() const
Signature check result needs to be stored/retrieved from _metadataPath.
std::string repoStatusString() const
bool triBoolFromPath(const Pathname &path_r, TriBool &ret_r) const
bool internalUnsignedConfirmed() const
We definitely have a symlink pointing to "indeterminate" (for repoGpgCheckIsMandatory)?
TriBool triBoolFromPath(const Pathname &path_r) const
Impl(const Impl &)=default
void packagesPath(Pathname new_r)
void rawRepoGpgCheck(TriBool val_r)
RepoVariablesReplacedUrlList & mirrorUrls() const
Fetch the repo mirrors from the server.
void rawPkgGpgCheck(TriBool val_r)
Pathname predownloadPath() const
Pathname licenseTgz(const std::string &name_r) const
Path to a license tarball in case it exists in the repo.
Impl * clone() const
clone for RWCOW_pointer
Pathname metadataPath() const
DefaultIntegral< unsigned, defaultPriority > priority
RepoVariablesReplacedUrl _cfgMetalinkUrl
void setMetalinkUrl(const Url &url_r)
const RepoVariablesReplacedUrl & cfgMirrorlistUrl() const
Config file writing needs to tell them appart.
std::optional< Pathname > _alternatePackagesPath
in case _packagesPath is not writable
void setMirrorlistUrl(const Url &url_r)
std::ostream & operator<<(std::ostream &str, const RepoInfo::Impl &obj)
Stream output.
RepoVariablesReplacedUrlList _mirrorUrls
possible mirrors as fetched via mirrorlist or metalink
void setType(const repo::RepoType &t)
friend Impl * rwcowClone(const Impl *rhs)
RepoVariablesReplacedUrl baseUrl() const
std::chrono::steady_clock::time_point _lastMirrorUrlsUpdate
bool hasContent(const std::string &keyword_r) const
const std::set< std::string > & contentKeywords() const
TriBool cfgPkgGpgCheck() const
bool baseurl2dump() const
const RepoVariablesReplacedUrl & cfgMetalinkUrl() const
Config file writing needs to tell them appart.
const RepoVariablesReplacedUrlList & baseUrls() const
RepoVariablesReplacedUrlList _gpgKeyUrls
RepoVariablesReplacedUrlList _baseUrls
baseUrls as configured
Impl & operator=(Impl &&)=delete
std::vector< MirroredOrigin > _repoOrigins
void rawGpgCheck(TriBool val_r)
void addContent(const std::string &keyword_r)
TriBool _rawGpgCheck
default gpgcheck behavior: Y/N/ZConf
Pathname packagesPath() const
const RepoVariablesReplacedUrl & mirrorListUrl() const
THE mirrorListUrl to work with (either_cfgMirrorlistUrl or _cfgMetalinkUrl).
void metadataPath(Pathname new_r)
TriBool rawGpgCheck() const
TriBool rawRepoGpgCheck() const
void internalSetValidRepoSignature(TriBool value_r)
void resetMirrorUrls() const
const RepoVariablesReplacedUrlList & gpgKeyUrls() const
TriBool cfgRepoGpgCheck() const
static const unsigned defaultPriority
TriBool _rawPkgGpgCheck
need to check pkg sign.: Y/N/(ZConf(Y/N/gpgCheck))
void setProbedType(const repo::RepoType &t) const
MirroredOriginSet repoOrigins() const
RepoVariablesReplacedUrlList & baseUrls()
TriBool _validRepoSignature
have signed and valid repo metadata
repo::RepoType type() const
Pathname systemPackagesPath() const
Impl & operator=(const Impl &)=delete
RepoVariablesReplacedUrl _cfgMirrorlistUrl
std::pair< FalseBool, std::set< std::string > > _keywords
RepoVariablesReplacedUrlList & gpgKeyUrls()
bool usesAutoMetadataPaths() const
static const unsigned noPriority
Repository type enumeration.
static const RepoType YAST2
const std::string & asString() const
static const RepoType RPMMD
static const RepoType NONE
static const RepoType RPMPLAINDIR