From 36ae15d5dec917d5712e77e4dc916ff12e4ec2fd Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:19:22 +0900 Subject: [PATCH] Imported Upstream version 17.11.4 --- .clang-format | 117 ++++++++++++++++++++++++++++++++++++++ VERSION.cmake | 4 +- libzypp.spec.cmake | 11 ++-- package/libzypp.changes | 19 +++++++ po/ar.po | 14 +++-- po/da.po | 14 +++-- po/es.po | 8 ++- po/fr.po | 12 ++-- po/hu.po | 4 +- po/it.po | 8 ++- po/ko.po | 8 +-- po/ru.po | 10 ++-- po/sv.po | 4 +- po/zh_TW.po | 8 +-- zypp/ResolverProblem.cc | 13 +++++ zypp/ResolverProblem.h | 8 +++ zypp/sat/detail/PoolImpl.cc | 1 + zypp/solver/detail/SATResolver.cc | 97 ++++++++++++++++++++----------- zypp/solver/detail/SATResolver.h | 2 + zypp/target/modalias/Modalias.cc | 37 +++++++++--- 20 files changed, 314 insertions(+), 85 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..da75ab9 --- /dev/null +++ b/.clang-format @@ -0,0 +1,117 @@ +--- +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 +... diff --git a/VERSION.cmake b/VERSION.cmake index be1fa1d..d9253de 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ 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) #======= diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index e4d3b75..e148e20 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -221,6 +221,9 @@ export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON" %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 \ @@ -228,14 +231,10 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \ ${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 @@ -264,9 +263,9 @@ mkdir -p %{buildroot}/%{_var}/cache/zypp 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 diff --git a/package/libzypp.changes b/package/libzypp.changes index a98c1a5..614d042 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +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 + +- 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 diff --git a/po/ar.po b/po/ar.po index d90df0c..cba1728 100644 --- a/po/ar.po +++ b/po/ar.po @@ -13,17 +13,17 @@ msgstr "" "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 \n" -"Language-Team: Arabic \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Iman Abd Elaziz \n" +"Language-Team: Arabic " +"\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" @@ -3792,7 +3792,7 @@ msgstr "البحث عن مفتاح gpg للتشفير %1% في الذاكرة ا #: 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 @@ -4074,6 +4074,8 @@ msgid "" "Visit the SUSE Customer Center to check whether your registration is valid " "and has not expired." msgstr "" +"تفضل بزيارة مركز عملاء SUSE للتحقق ما إذا كان التسجيل صالحًا وغير منته " +"الصلاحية بعد." #: zypp/media/MediaCurl.cc:1141 msgid "" diff --git a/po/da.po b/po/da.po index 3080112..eef0428 100644 --- a/po/da.po +++ b/po/da.po @@ -7,16 +7,16 @@ msgstr "" "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 \n" -"Language-Team: Danish \n" +"Language-Team: Danish " +"\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 @@ -4053,14 +4053,16 @@ msgid "" "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 diff --git a/po/es.po b/po/es.po index 9269a20..9420662 100644 --- a/po/es.po +++ b/po/es.po @@ -17,8 +17,8 @@ msgstr "" "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 \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Juan Sarria \n" "Language-Team: Spanish \n" "Language: es\n" @@ -26,7 +26,7 @@ msgstr "" "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 @@ -4079,6 +4079,8 @@ msgid "" "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 "" diff --git a/po/fr.po b/po/fr.po index 6bd567e..671c298 100644 --- a/po/fr.po +++ b/po/fr.po @@ -20,16 +20,16 @@ msgstr "" "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 \n" -"Language-Team: French \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Christine Gabriel \n" +"Language-Team: French " +"\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 @@ -4077,6 +4077,8 @@ msgid "" "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 "" diff --git a/po/hu.po b/po/hu.po index e1af47f..8b9134a 100644 --- a/po/hu.po +++ b/po/hu.po @@ -19,7 +19,7 @@ msgstr "" "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 \n" "Language-Team: Hungarian \n" @@ -4342,6 +4342,8 @@ msgid "" "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 "" diff --git a/po/it.po b/po/it.po index 52272a5..fb8e263 100644 --- a/po/it.po +++ b/po/it.po @@ -15,8 +15,8 @@ msgstr "" "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 \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Davide Aiello \n" "Language-Team: Italian \n" "Language: it\n" @@ -24,7 +24,7 @@ msgstr "" "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. @@ -4067,6 +4067,8 @@ msgid "" "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 "" diff --git a/po/ko.po b/po/ko.po index 24795fb..bdac089 100644 --- a/po/ko.po +++ b/po/ko.po @@ -9,10 +9,10 @@ msgstr "" "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 \n" -"Language-Team: Korean \n" +"Language-Team: Korean " +"\n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4244,7 +4244,7 @@ msgstr "'%s'에 대한 인증 필요" 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 "" diff --git a/po/ru.po b/po/ru.po index 434e542..86180de 100644 --- a/po/ru.po +++ b/po/ru.po @@ -14,16 +14,16 @@ msgstr "" "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 \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Nikita Maynagashev \n" "Language-Team: Russian \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. @@ -4065,6 +4065,8 @@ msgid "" "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 "" diff --git a/po/sv.po b/po/sv.po index a798afd..dcc7d12 100644 --- a/po/sv.po +++ b/po/sv.po @@ -14,7 +14,7 @@ msgstr "" "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 \n" "Language-Team: Swedish \n" @@ -4227,6 +4227,8 @@ msgid "" "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 "" diff --git a/po/zh_TW.po b/po/zh_TW.po index b079f02..3ff9f73 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -11,8 +11,8 @@ msgstr "" "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 \n" +"PO-Revision-Date: 2019-03-23 20:19+0000\n" +"Last-Translator: Emily Dong \n" "Language-Team: Chinese (Taiwan) \n" "Language: zh_TW\n" @@ -20,7 +20,7 @@ msgstr "" "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 @@ -4049,7 +4049,7 @@ msgstr "%s 需要驗證" 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 "" diff --git a/zypp/ResolverProblem.cc b/zypp/ResolverProblem.cc index 980c77e..c231f61 100644 --- a/zypp/ResolverProblem.cc +++ b/zypp/ResolverProblem.cc @@ -70,9 +70,16 @@ namespace zypp , _details( std::move(details) ) {} + Impl( std::string && description, std::string && details, std::vector &&completeProblemInfo ) + : _description( std::move(description) ) + , _details( std::move(details) ) + , _completeProblemInfo ( std::move(completeProblemInfo) ) + {} + std::string _description; std::string _details; ProblemSolutionList _solutions; + std::vector _completeProblemInfo; private: friend Impl * rwcowClone( const Impl * rhs ); @@ -94,6 +101,10 @@ namespace zypp : _pimpl( new Impl( std::move(description), std::move(details) ) ) {} + ResolverProblem::ResolverProblem( std::string description, std::string details, std::vector &&completeProblemInfo ) + : _pimpl( new Impl( std::move(description), std::move(details), std::move(completeProblemInfo) ) ) + {} + ResolverProblem::~ResolverProblem() {} @@ -107,6 +118,8 @@ namespace zypp const ProblemSolutionList & ResolverProblem::solutions() const { return _pimpl->_solutions; } + const std::vector & ResolverProblem::completeProblemInfo() const + { return _pimpl->_completeProblemInfo; } void ResolverProblem::setDescription( std::string description ) { _pimpl->_description = std::move(description); } diff --git a/zypp/ResolverProblem.h b/zypp/ResolverProblem.h index c0ab438..548f780 100644 --- a/zypp/ResolverProblem.h +++ b/zypp/ResolverProblem.h @@ -11,6 +11,7 @@ #include #include +#include #include "zypp/ProblemTypes.h" #include "zypp/ProblemSolution.h" @@ -31,6 +32,8 @@ namespace zypp ResolverProblem( std::string description ); /** Constructor. */ ResolverProblem( std::string description, std::string details ); + /** Constructor. */ + ResolverProblem( std::string description, std::string details, std::vector &&completeProblemInfo ); /** Destructor. */ ~ResolverProblem(); @@ -48,6 +51,11 @@ namespace zypp const std::string & details() const; /** + * Return a one-line description for each problematic rule in the problem tree + **/ + const std::vector & completeProblemInfo() const; + + /** * Return the possible solutions to this problem. * All problems should have at least 2-3 (mutually exclusive) solutions: * diff --git a/zypp/sat/detail/PoolImpl.cc b/zypp/sat/detail/PoolImpl.cc index 520b093..b9f42b3 100644 --- a/zypp/sat/detail/PoolImpl.cc +++ b/zypp/sat/detail/PoolImpl.cc @@ -431,6 +431,7 @@ namespace zypp // We need one, so "en" is the last resort const char *needone[] { "en" }; ::pool_set_languages( _pool, needone, 1 ); + return; } std::vector fallbacklist; diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc index fd13ceb..9251ec9 100644 --- a/zypp/solver/detail/SATResolver.cc +++ b/zypp/solver/detail/SATResolver.cc @@ -968,37 +968,77 @@ PoolItem SATResolver::mapItem ( const PoolItem & item ) sat::Solvable SATResolver::mapSolvable ( const Id & id ) { return mapBuddy( sat::Solvable(id) ); } +std::vector SATResolver::SATgetCompleteProblemInfoStrings ( Id problem ) +{ + std::vector 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: @@ -1015,42 +1055,30 @@ string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreI 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); @@ -1101,8 +1129,13 @@ string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreI } } break; + } + default: { + DBG << "Unknown rule type(" << type << ") going to query libsolv for rule information." << endl; + ret = str::asString( ::solver_problemruleinfo2str( _satSolver, type, static_cast(s.id()), static_cast(s2.id()), dep ) ); + break; + } } - return ret; } @@ -1131,7 +1164,7 @@ SATResolver::problems () 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) { diff --git a/zypp/solver/detail/SATResolver.h b/zypp/solver/detail/SATResolver.h index 3e70592..a26ee7e 100644 --- a/zypp/solver/detail/SATResolver.h +++ b/zypp/solver/detail/SATResolver.h @@ -117,6 +117,8 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable, pr private: // ---------------------------------- methods std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId); + std::string SATproblemRuleInfoString (Id rule, std::string &detail, Id &ignoreId); + std::vector SATgetCompleteProblemInfoStrings ( Id problem ); void resetItemTransaction (PoolItem item); // Create a SAT solver and reset solver selection in the pool (Collecting diff --git a/zypp/target/modalias/Modalias.cc b/zypp/target/modalias/Modalias.cc index 8533a28..3e647ac 100644 --- a/zypp/target/modalias/Modalias.cc +++ b/zypp/target/modalias/Modalias.cc @@ -54,8 +54,7 @@ namespace zypp #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 & arg_r ) { AutoDispose dir( ::opendir( dir_r.c_str() ), ::closedir ); if ( ! dir ) @@ -70,22 +69,44 @@ namespace zypp 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 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 /////////////////////////////////////////////////////////////////// -- 2.7.4