--- /dev/null
+---
+Language: Cpp
+AccessModifierOffset: -2
+AlignAfterOpenBracket: DontAlign
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Right
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: Yes
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterClass: true
+ AfterControlStatement: true
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterObjCDeclaration: true
+ AfterStruct: true
+ AfterUnion: true
+ AfterExternBlock: false
+ BeforeCatch: true
+ BeforeElse: true
+ IndentBraces: false
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+ SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 2
+ContinuationIndentWidth: 2
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+ - foreach
+ - Q_FOREACH
+ - BOOST_FOREACH
+IncludeBlocks: Preserve
+IncludeCategories:
+ - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
+ Priority: 2
+ - Regex: '^(<|"(gtest|isl|json)/)'
+ Priority: 3
+ - Regex: '.*'
+ Priority: 1
+IncludeIsMainRegex: '(Test)?$'
+IndentCaseLabels: true
+IndentPPDirectives: None
+IndentWidth: 2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepLineBreaksForNonEmptyLines: false
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000000
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 1000000
+PointerAlignment: Right
+ReflowComments: false
+SortIncludes: false
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: true
+SpacesInSquareBrackets: true
+Standard: Cpp11
+TabWidth: 8
+UseTab: Never
+...
SET(LIBZYPP_MAJOR "17")
SET(LIBZYPP_COMPATMINOR "9")
SET(LIBZYPP_MINOR "11")
-SET(LIBZYPP_PATCH "3")
+SET(LIBZYPP_PATCH "4")
#
-# LAST RELEASED: 17.11.3 (9)
+# LAST RELEASED: 17.11.4 (9)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
%endif
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DENABLE_BUILD_DOCS=TRUE \
+ -DENABLE_BUILD_TRANS=TRUE \
+ -DENABLE_BUILD_TESTS=TRUE \
-DDOC_INSTALL_DIR=%{_docdir} \
-DLIB=%{_lib} \
-DCMAKE_BUILD_TYPE=Release \
${EXTRA_CMAKE_OPTIONS} \
..
make %{?_smp_mflags} VERBOSE=1
-make -C doc/autodoc %{?_smp_mflags}
-make -C po %{?_smp_mflags} translations
-make -C tests %{?_smp_mflags}
%install
cd build
%make_install
-%make_install -C doc/autodoc
%if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
%else
sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
%endif
-%make_install -C po
-# Create filelist with translations
cd ..
+
+# Create filelist with translations
%{find_lang} zypp
%check
-------------------------------------------------------------------
+Thu Apr 4 13:24:40 CEST 2019 - ma@suse.de
+
+- Enhance scanning /sys for modaliases (bsc#1130161)
+- version 17.11.4 (9)
+
+-------------------------------------------------------------------
+Tue Apr 2 18:15:12 CEST 2019 - ma@suse.de
+
+- Prevent SEGV if the application sets an empty TextLocale (bsc#1127026)
+
+-------------------------------------------------------------------
+Mon Apr 1 08:49:45 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>
+
+- Fix build with CMake >= 3.14.0:
+ Starting with CMake 3.14, EXCLUDE_FROM_ALL now spreads from
+ directories to targets. 'make -C someSubdir' when 'someSubdir'
+ uses the 'EXCLUDE_FROM_ALL' keyword does nothing. (gh/libzypp#libzypp#165)
+
+-------------------------------------------------------------------
Thu Mar 21 12:35:39 CET 2019 - ma@suse.de
- KeyManager: Work around bsc#1127220 [libgpgme] no error upon
"Project-Id-Version: YaST (@memory@)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-09-10 20:46+0000\n"
-"Last-Translator: Mahmoud Khalil <kkhalil2535@gmail.com>\n"
-"Language-Team: Arabic <https://l10n.opensuse.org/projects/libzypp/master/ar/"
-">\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Iman Abd Elaziz <Iman.AbdelAziz@arabize.com>\n"
+"Language-Team: Arabic <https://l10n.opensuse.org/projects/libzypp/master/ar/>"
+"\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
"X-Language-English: Arabic\n"
"X-Language-Local: Arabic*\n"
#: zypp/RepoInfo.cc:545
#, boost-format
msgid "Looking for gpg key ID %1% in repository %2%."
-msgstr "يتم البحث عن معرف لمفتاح الـgpg رقم %1% في المستودع %2%."
+msgstr "يتم البحث عن معرف لمفتاح gpg رقم %1% في المستودع %2%."
#. translator: %1% is a repositories name
#: zypp/RepoInfo.cc:569
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"تفضل بزيارة مركز عملاء SUSE للتحقق ما إذا كان التسجيل صالحًا وغير منته "
+"الصلاحية بعد."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: libzypp\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-09-17 08:56+0000\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
"Last-Translator: scootergrisen <scootergrisen@gmail.com>\n"
-"Language-Team: Danish <https://l10n.opensuse.org/projects/libzypp/master/da/"
-">\n"
+"Language-Team: Danish <https://l10n.opensuse.org/projects/libzypp/master/da/>"
+"\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
#: zypp/CheckSum.cc:136
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Besøg SUSE-kundercenteret for at tjekke om din registrering er gyldig og "
+"ikke er udløbet."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Visit the Novell Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
-"Besøg Novell kundercenter for at tjekke om din registrering er gyldig og "
-"ikke udløbet."
+"Besøg Novell-kundercenteret for at tjekke om din registrering er gyldig og "
+"ikke er udløbet."
#: zypp/media/MediaException.cc:31
#, c-format, boost-format
"Project-Id-Version: zypp\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-10-31 20:02+0000\n"
-"Last-Translator: jc sl <trcs@gmx.com>\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Juan Sarria <juansarriam@gmail.com>\n"
"Language-Team: Spanish <https://l10n.opensuse.org/projects/libzypp/master/es/"
">\n"
"Language: es\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
#: zypp/CheckSum.cc:136
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Visite el Centro de servicios al cliente de SUSE para comprobar si su "
+"registro es válido y no ha caducado."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp.fr\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-08-03 19:15+0000\n"
-"Last-Translator: Benoît Monin <benoit.monin@gmx.fr>\n"
-"Language-Team: French <https://l10n.opensuse.org/projects/libzypp/master/fr/"
-">\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Christine Gabriel <christine@stoquart.com>\n"
+"Language-Team: French <https://l10n.opensuse.org/projects/libzypp/master/fr/>"
+"\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
#: zypp/CheckSum.cc:136
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Visitez SUSE Customer Center pour vérifier si votre enregistrement est "
+"valide et n'a pas expiré."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp.hu\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2019-01-25 20:07+0000\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
"Last-Translator: Robert Taisz <robert.taisz@emerald.hu>\n"
"Language-Team: Hungarian <https://l10n.opensuse.org/projects/libzypp/master/"
"hu/>\n"
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Keresse fel a SUSE Ügyfélközpontot, és ellenőrizze, hogy a regisztrációja "
+"érvényes-e, illetve nem járt-e le."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-11-11 14:55+0000\n"
-"Last-Translator: Alessio Adamo <alessio.adamo@gmail.com>\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Davide Aiello <davidea@novilinguists.com>\n"
"Language-Team: Italian <https://l10n.opensuse.org/projects/libzypp/master/it/"
">\n"
"Language: it\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
"X-Poedit-Bookmarks: 370,-1,-1,-1,-1,-1,-1,-1,-1,-1\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Visitare SUSE Customer Center per verificare se la registrazione è valida e "
+"che non sia scaduta."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp.ko\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2019-02-02 22:17+0000\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
"Last-Translator: Hwajin Kim <hwajin.kim@e4net.net>\n"
-"Language-Team: Korean <https://l10n.opensuse.org/projects/libzypp/master/ko/"
-">\n"
+"Language-Team: Korean <https://l10n.opensuse.org/projects/libzypp/master/ko/>"
+"\n"
"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
msgid ""
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
-msgstr ""
+msgstr "SUSE 고객 센터를 방문하여 등록이 올바른지, 등록이 만료되지 않았는지 확인합니다."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp.ru\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2019-02-02 22:17+0000\n"
-"Last-Translator: Alex Minton <alex239@gmail.com>\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Nikita Maynagashev <maynagashev@palex.ru>\n"
"Language-Team: Russian <https://l10n.opensuse.org/projects/libzypp/master/ru/"
">\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
+"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 3.3\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Убедитесь, что ваша регистрация действительна и срок ее действия не истек, в "
+"центре SUSE Customer Center."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp.sv\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2019-02-02 22:17+0000\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
"Last-Translator: Sven Åhr <anders.ahr@gmail.com>\n"
"Language-Team: Swedish <https://l10n.opensuse.org/projects/libzypp/master/sv/"
">\n"
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
msgstr ""
+"Besök SUSE kundcenter för att se om din registrering är giltig och inte har "
+"slutat gälla."
#: zypp/media/MediaCurl.cc:1141
msgid ""
"Project-Id-Version: zypp\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 13:31+0100\n"
-"PO-Revision-Date: 2018-10-06 11:01+0000\n"
-"Last-Translator: Yi-Jyun Pan <pan93412@gmail.com>\n"
+"PO-Revision-Date: 2019-03-23 20:19+0000\n"
+"Last-Translator: Emily Dong <Emily.Dong@excel-gits.com>\n"
"Language-Team: Chinese (Taiwan) <https://l10n.opensuse.org/projects/libzypp/"
"master/zh_TW/>\n"
"Language: zh_TW\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
#. dubious: Throw on malformed known types, otherwise log a warning.
#: zypp/CheckSum.cc:136
msgid ""
"Visit the SUSE Customer Center to check whether your registration is valid "
"and has not expired."
-msgstr ""
+msgstr "造訪 SUSE Customer Center 以檢查您的註冊是否有效以及是否過期。"
#: zypp/media/MediaCurl.cc:1141
msgid ""
, _details( std::move(details) )
{}
+ Impl( std::string && description, std::string && details, std::vector<std::string> &&completeProblemInfo )
+ : _description( std::move(description) )
+ , _details( std::move(details) )
+ , _completeProblemInfo ( std::move(completeProblemInfo) )
+ {}
+
std::string _description;
std::string _details;
ProblemSolutionList _solutions;
+ std::vector<std::string> _completeProblemInfo;
private:
friend Impl * rwcowClone<Impl>( const Impl * rhs );
: _pimpl( new Impl( std::move(description), std::move(details) ) )
{}
+ ResolverProblem::ResolverProblem( std::string description, std::string details, std::vector<std::string> &&completeProblemInfo )
+ : _pimpl( new Impl( std::move(description), std::move(details), std::move(completeProblemInfo) ) )
+ {}
+
ResolverProblem::~ResolverProblem()
{}
const ProblemSolutionList & ResolverProblem::solutions() const
{ return _pimpl->_solutions; }
+ const std::vector<std::string> & ResolverProblem::completeProblemInfo() const
+ { return _pimpl->_completeProblemInfo; }
void ResolverProblem::setDescription( std::string description )
{ _pimpl->_description = std::move(description); }
#include <list>
#include <string>
+#include <vector>
#include "zypp/ProblemTypes.h"
#include "zypp/ProblemSolution.h"
ResolverProblem( std::string description );
/** Constructor. */
ResolverProblem( std::string description, std::string details );
+ /** Constructor. */
+ ResolverProblem( std::string description, std::string details, std::vector<std::string> &&completeProblemInfo );
/** Destructor. */
~ResolverProblem();
const std::string & details() const;
/**
+ * Return a one-line description for each problematic rule in the problem tree
+ **/
+ const std::vector<std::string> & completeProblemInfo() const;
+
+ /**
* Return the possible solutions to this problem.
* All problems should have at least 2-3 (mutually exclusive) solutions:
*
// We need one, so "en" is the last resort
const char *needone[] { "en" };
::pool_set_languages( _pool, needone, 1 );
+ return;
}
std::vector<std::string> fallbacklist;
sat::Solvable SATResolver::mapSolvable ( const Id & id )
{ return mapBuddy( sat::Solvable(id) ); }
+std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem )
+{
+ std::vector<std::string> ret;
+ sat::Queue problems;
+ solver_findallproblemrules( _satSolver, problem, problems );
+
+ bool nobad = false;
+
+ //filter out generic rule information if more explicit ones are available
+ for ( sat::Queue::size_type i = 0; i < problems.size(); i++ ) {
+ SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
+ if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
+ nobad = true;
+ break;
+ }
+ }
+ for ( sat::Queue::size_type i = 0; i < problems.size(); i++ ) {
+ SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
+ if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
+ continue;
+ }
+
+ std::string detail;
+ Id ignore = 0;
+ std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
+
+ //we get the same string multiple times, reduce the noise
+ if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
+ ret.push_back( pInfo );
+ }
+ return ret;
+}
+
string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreId)
{
+ // FIXME: solver_findallproblemrules to get all rules for this problem
+ // (the 'most relevabt' one returned by solver_findproblemrule is embedded
+ Id probr = solver_findproblemrule(_satSolver, problem);
+ return SATproblemRuleInfoString( probr, detail, ignoreId );
+}
+
+std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
+{
string ret;
sat::detail::CPool *pool = _satSolver->pool;
- Id probr;
Id dep, source, target;
- sat::Solvable s, s2;
+ SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
ignoreId = 0;
- // FIXME: solver_findallproblemrules to get all rules for this problem
- // (the 'most relevabt' one returned by solver_findproblemrule is embedded
- probr = solver_findproblemrule(_satSolver, problem);
- switch (solver_ruleinfo(_satSolver, probr, &source, &target, &dep))
+ sat::Solvable s = mapSolvable( source );
+ sat::Solvable s2 = mapSolvable( target );
+
+ // @FIXME, these strings are a duplicate copied from the libsolv library
+ // to provide translations. Instead of having duplicate code we should
+ // translate those strings directly in libsolv
+ switch ( type )
{
case SOLVER_RULE_DISTUPGRADE:
- s = mapSolvable (source);
ret = str::form (_("%s does not belong to a distupgrade repository"), s.asString().c_str());
break;
case SOLVER_RULE_INFARCH:
- s = mapSolvable (source);
ret = str::form (_("%s has inferior architecture"), s.asString().c_str());
break;
case SOLVER_RULE_UPDATE:
- s = mapSolvable (source);
ret = str::form (_("problem with installed package %s"), s.asString().c_str());
break;
case SOLVER_RULE_JOB:
ret = _("conflicting requests");
break;
- case SOLVER_RULE_RPM:
+ case SOLVER_RULE_PKG:
ret = _("some dependency problem");
break;
case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
ret = str::form (_("%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
break;
- case SOLVER_RULE_RPM_NOT_INSTALLABLE:
- s = mapSolvable (source);
+ case SOLVER_RULE_PKG_NOT_INSTALLABLE:
ret = str::form (_("%s is not installable"), s.asString().c_str());
break;
- case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
+ case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
ignoreId = source; // for setting weak dependencies
- s = mapSolvable (source);
ret = str::form (_("nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.asString().c_str());
break;
- case SOLVER_RULE_RPM_SAME_NAME:
- s = mapSolvable (source);
- s2 = mapSolvable (target);
+ case SOLVER_RULE_PKG_SAME_NAME:
ret = str::form (_("cannot install both %s and %s"), s.asString().c_str(), s2.asString().c_str());
break;
- case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
- s = mapSolvable (source);
- s2 = mapSolvable (target);
+ case SOLVER_RULE_PKG_CONFLICTS:
ret = str::form (_("%s conflicts with %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
- case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
- s = mapSolvable (source);
- s2 = mapSolvable (target);
+ case SOLVER_RULE_PKG_OBSOLETES:
ret = str::form (_("%s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
- case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
- s = mapSolvable (source);
- s2 = mapSolvable (target);
+ case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
ret = str::form (_("installed %s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
- case SOLVER_RULE_RPM_SELF_CONFLICT:
- s = mapSolvable (source);
+ case SOLVER_RULE_PKG_SELF_CONFLICT:
ret = str::form (_("solvable %s conflicts with %s provided by itself"), s.asString().c_str(), pool_dep2str(pool, dep));
break;
- case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
+ case SOLVER_RULE_PKG_REQUIRES: {
ignoreId = source; // for setting weak dependencies
- s = mapSolvable (source);
Capability cap(dep);
sat::WhatProvides possibleProviders(cap);
}
}
break;
+ }
+ default: {
+ DBG << "Unknown rule type(" << type << ") going to query libsolv for rule information." << endl;
+ ret = str::asString( ::solver_problemruleinfo2str( _satSolver, type, static_cast<Id>(s.id()), static_cast<Id>(s2.id()), dep ) );
+ break;
+ }
}
-
return ret;
}
string whatString = SATprobleminfoString (problem,detail,ignoreId);
MIL << whatString << endl;
MIL << "------------------------------------" << endl;
- ResolverProblem_Ptr resolverProblem = new ResolverProblem (whatString, detail);
+ ResolverProblem_Ptr resolverProblem = new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
solution = 0;
while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
private:
// ---------------------------------- methods
std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId);
+ std::string SATproblemRuleInfoString (Id rule, std::string &detail, Id &ignoreId);
+ std::vector<std::string> SATgetCompleteProblemInfoStrings ( Id problem );
void resetItemTransaction (PoolItem item);
// Create a SAT solver and reset solver selection in the pool (Collecting
#undef PATH_IS
}
- /** Recursively scan for modalias files and scan them to \a arg. */
- void foreach_file_recursive( const Pathname & dir_r, Modalias::ModaliasList & arg )
+ void foreach_file_recursive( const Pathname & dir_r, std::set<std::string> & arg_r )
{
AutoDispose<DIR *> dir( ::opendir( dir_r.c_str() ), ::closedir );
if ( ! dir )
if ( isBlackListed( dir_r, dirent->d_name ) )
continue;
- PathInfo pi( dir_r / dirent->d_name, PathInfo::LSTAT );
+ Pathname path; // lazy init as needed
+ unsigned char d_type = dirent->d_type;
+ if ( d_type == DT_UNKNOWN )
+ {
+ path = dir_r/dirent->d_name;
+ PathInfo pi( path, PathInfo::LSTAT );
+ if ( pi.isDir() )
+ d_type = DT_DIR;
+ else if ( pi.isFile() )
+ d_type = DT_REG;
+ }
- if ( pi.isDir() )
+ if ( d_type == DT_DIR )
{
- foreach_file_recursive( pi.path(), arg );
+ if ( path.empty() )
+ path = dir_r/dirent->d_name;
+ foreach_file_recursive( path, arg_r );
}
- else if ( pi.isFile() && ::strcmp( dirent->d_name, "modalias" ) == 0 )
+ else if ( d_type == DT_REG && ::strcmp( dirent->d_name, "modalias" ) == 0 )
{
+ if ( path.empty() )
+ path = dir_r/dirent->d_name;
// read modalias line from file
- std::ifstream str( pi.path().c_str() );
+ std::ifstream str( path.c_str() );
std::string line( iostr::getline( str ) );
if ( ! line.empty() )
- arg.push_back( line );
+ arg_r.insert( line );
}
}
}
+
+ /** Recursively scan for modalias files and scan them to \a arg. */
+ void foreach_file_recursive( const Pathname & dir_r, Modalias::ModaliasList & arg_r )
+ {
+ std::set<std::string> arg; // we want the aliases to be unified (the public API uses a vector)
+ foreach_file_recursive( dir_r, arg );
+ arg_r.insert( arg_r.end(), arg.begin(), arg.end() );
+ }
} // namespace
///////////////////////////////////////////////////////////////////