From 4039d1f1d68363e999db5d32552cc3b5c340c73f Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 10:35:32 +0900 Subject: [PATCH] Imported Upstream version 14.42.0 Change-Id: I110b22c48032bbe3f46d105abe08d3aec750c42a Signed-off-by: DongHun Kwak --- VERSION.cmake | 6 +++--- mkChangelog | 12 +++++++++--- package/libzypp.changes | 27 +++++++++++++++++---------- zypp/ZYppCommitResult.cc | 7 +++++++ zypp/ZYppCommitResult.h | 10 ++++++++++ zypp/base/DefaultIntegral.h | 10 ++++++++++ zypp/target/TargetImpl.cc | 21 +++++++++++++++++++++ 7 files changed, 77 insertions(+), 16 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 8841878..092d1e6 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "39") -SET(LIBZYPP_MINOR "41") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_MINOR "42") +SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 14.41.1 (39) +# LAST RELEASED: 14.42.0 (39) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/mkChangelog b/mkChangelog index 82ba368..27ad6c7 100755 --- a/mkChangelog +++ b/mkChangelog @@ -48,7 +48,13 @@ esac export LC_ALL="" export LANG="en" -EDITOR=${EDITOR:-vi} + +function Edit() +{ + local FILE="$1" + vi "$FILE" + sed -i 's/ \+$//' "$FILE" +} EMAIL="$(git config --get user.email)" @@ -165,7 +171,7 @@ while true; do echo case "${RES:-e}" in [eE]*) - $EDITOR $VERSIONFILE + Edit $VERSIONFILE eval $(getversion) continue ;; @@ -207,7 +213,7 @@ trap " [ -f \"$TMPFILE\" ] && /bin/rm -f -- \"$TMPFILE\" " 0 1 2 3 13 15 RES=e while [ "$RES" == "e" ]; do - $EDITOR $TMPFILE + Edit $TMPFILE echo awk '{print}/^----------/{n=n+1; if ( n == 2 ) exit 0; }' $TMPFILE read -n 1 -p "$(Gecho "(a)bort, (c)ontinue, (s)ubmitt, (e)dit [e]: ")" RES diff --git a/package/libzypp.changes b/package/libzypp.changes index d326915..9e10100 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Sep 29 18:40:05 CEST 2015 - ma@suse.de + +- ZYppCommitResult: add attemptToModify to indicate an attempt to + actually install/remove was made (bsc#946750, FATE#319467) +- version 14.42.0 (39) + +------------------------------------------------------------------- Fri Sep 25 10:54:20 CEST 2015 - ma@suse.de - Avoid URL rewrite if probing local cache directories (bsc#946129) @@ -57,22 +64,22 @@ Fri Jul 3 15:24:15 CEST 2015 - ma@suse.de ------------------------------------------------------------------- Fri Jun 12 12:40:36 CEST 2015 - ma@suse.de -- zypp.conf: Add config values for gpgcheck, repo_gpgcheck +- zypp.conf: Add config values for gpgcheck, repo_gpgcheck and pkg_gpgcheck. The default behavior 'gpgcheck=On' will - automatically turn on the gpg signature check for packages + automatically turn on the gpg signature check for packages downloaded from repository with unsigned metadata. If the repo metadata are signed, a faster comparison via checksums is done. By explicitly setting repo_gpgcheck or pkg_gpgcheck you can enforce the signature check of repository metadata - or downloaded packages to be always performed. Those defaults - can be overwritten per repository. (FATE#314603) + or downloaded packages to be always performed. Those defaults + can be overwritten per repository. (FATE#314603) - Downloader: Accept unsigned repository if pkgGpgCheck is ON. - version 14.39.0 (39) ------------------------------------------------------------------- Tue Jun 2 16:56:13 CEST 2015 - ma@suse.de -- Fix SSL client certificate authentication via URL option +- Fix SSL client certificate authentication via URL option ssl_clientcert/ssl_clientkey (bnc#932393) - version 14.38.6 (30) @@ -115,13 +122,13 @@ Mon Mar 16 14:05:28 CET 2015 - ma@suse.de ------------------------------------------------------------------- Wed Mar 11 09:22:46 CET 2015 - ma@suse.de -- New RepoVarExpand: Functor expanding repo variables in a +- New RepoVarExpand: Functor expanding repo variables in a string . Supports bash style default ${v:-w}' and alternate ${v:+w} values (FATE#318354) - Easy.h: Use __typeof__ rather than typeof in header - Support repo variable replacement in service url - Support repo variable replacement in gpg url -- Gettext.h: Fallback to ::gettext if accidentally included +- Gettext.h: Fallback to ::gettext if accidentally included outside libzypp - version 14.37.0 (30) @@ -148,10 +155,10 @@ Thu Feb 12 01:13:34 CET 2015 - ma@suse.de ------------------------------------------------------------------- Mon Feb 9 16:05:38 CET 2015 - ma@suse.de -- Don't execute scripts in /tmp or /var/tmp, as they could be +- Don't execute scripts in /tmp or /var/tmp, as they could be mounted noexec for security reasons (bnc#915928) - zypp/PublicKey.cc: Use GPG_BINARY from KeyRing -- Support $releasever_major/$releasever_minor repo variables +- Support $releasever_major/$releasever_minor repo variables (FATE#318354) - version 14.36.0 (30) @@ -201,7 +208,7 @@ Thu Jan 15 01:13:12 CET 2015 - ma@suse.de Mon Jan 12 15:04:17 CET 2015 - ma@suse.de - Properly propagate repo variables in service refresh. -- Let $ZYPP_REPO_RELEASEVER overwrite $releasever in .repo files +- Let $ZYPP_REPO_RELEASEVER overwrite $releasever in .repo files (bnc#911658) - Call pool_set_rootdir to properly check for file conflicts. - Use xgettext --boost to support boost-format (%N%) diff --git a/zypp/ZYppCommitResult.cc b/zypp/ZYppCommitResult.cc index 4834760..ae4eb43 100644 --- a/zypp/ZYppCommitResult.cc +++ b/zypp/ZYppCommitResult.cc @@ -33,6 +33,7 @@ namespace zypp public: Pathname _root; + FalseBool _attemptToModify; sat::Transaction _transaction; TransactionStepList _transactionStepList; UpdateNotifications _updateMessages; @@ -67,6 +68,12 @@ namespace zypp const Pathname & ZYppCommitResult::root() const { return _pimpl->_root; } + bool ZYppCommitResult::attemptToModify() const + { return _pimpl->_attemptToModify; } + + void ZYppCommitResult::attemptToModify( bool yesno_r ) + { _pimpl->_attemptToModify = yesno_r; } + const sat::Transaction & ZYppCommitResult::transaction() const { return _pimpl->_transaction; } diff --git a/zypp/ZYppCommitResult.h b/zypp/ZYppCommitResult.h index 1769cab..c6e86cf 100644 --- a/zypp/ZYppCommitResult.h +++ b/zypp/ZYppCommitResult.h @@ -77,6 +77,16 @@ namespace zypp */ const Pathname & root() const; + /** \c True if at least one attempt to actually install/remove packages was made. + * While this is false there should have been no serious modifications to the system. + * Mainly used to detect whether commit failed while preloading the caches or within + * the real action. + */ + bool attemptToModify() const; + + /** Set \ref attemptToModify */ + void attemptToModify( bool yesno_r ); + /** The full transaction list. * The complete list including transaction steps that do not require * any action (like obsoletes or non-package actions). Depending on diff --git a/zypp/base/DefaultIntegral.h b/zypp/base/DefaultIntegral.h index fc0a0b8..39688f1 100644 --- a/zypp/base/DefaultIntegral.h +++ b/zypp/base/DefaultIntegral.h @@ -81,6 +81,16 @@ namespace zypp _Tp _val; }; + /** \relates DefaultIntegral \c true initialized \c bool */ + typedef DefaultIntegral TrueBool; + + /** \relates DefaultIntegral \c false initialized \c bool */ + typedef DefaultIntegral FalseBool; + + /** \relates DefaultIntegral \c zero initialized \c integral */ + template + using ZeroInit = DefaultIntegral; + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc index 89506ed..8f0b208 100644 --- a/zypp/target/TargetImpl.cc +++ b/zypp/target/TargetImpl.cc @@ -1499,6 +1499,20 @@ namespace zypp // COMMIT internal // /////////////////////////////////////////////////////////////////// + namespace + { + struct NotifyAttemptToModify + { + NotifyAttemptToModify( ZYppCommitResult & result_r ) : _result( result_r ) {} + + void operator()() + { if ( _guard ) { _result.attemptToModify( true ); _guard = false; } } + + TrueBool _guard; + ZYppCommitResult & _result; + }; + } // namespace + void TargetImpl::commit( const ZYppCommitPolicy & policy_r, CommitPackageCache & packageCache_r, ZYppCommitResult & result_r ) @@ -1507,7 +1521,11 @@ namespace zypp ZYppCommitResult::TransactionStepList & steps( result_r.rTransactionStepList() ); MIL << "TargetImpl::commit(" << policy_r << ")" << steps.size() << endl; + // Send notification once upon 1st call to rpm + NotifyAttemptToModify attemptToModify( result_r ); + bool abort = false; + RpmPostTransCollector postTransCollector( _root ); std::vector successfullyInstalledPackages; TargetImpl::PoolItemList remaining; @@ -1582,6 +1600,7 @@ namespace zypp if (policy_r.rpmExcludeDocs()) flags |= rpm::RPMINST_EXCLUDEDOCS; if (policy_r.rpmNoSignature()) flags |= rpm::RPMINST_NOSIGNATURE; + attemptToModify(); try { progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE ); @@ -1645,6 +1664,8 @@ namespace zypp rpm::RpmInstFlags flags( policy_r.rpmInstFlags() & rpm::RPMINST_JUSTDB ); flags |= rpm::RPMINST_NODEPS; if (policy_r.dryRun()) flags |= rpm::RPMINST_TEST; + + attemptToModify(); try { rpm().removePackage( p, flags ); -- 2.7.4