SET(LIBZYPP_MAJOR "14")
SET(LIBZYPP_COMPATMINOR "39")
SET(LIBZYPP_MINOR "45")
-SET(LIBZYPP_PATCH "16")
+SET(LIBZYPP_PATCH "17")
#
-# LAST RELEASED: 14.45.16 (39)
+# LAST RELEASED: 14.45.17 (39)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Fri Aug 31 08:28:08 CEST 2018 - ma@suse.de
+
+- lsof: use '-K i' if lsof supports it (bsc#1099847, bsc#1036304)
+- version 14.45.17 (39)
+
+-------------------------------------------------------------------
Fri Aug 24 10:19:35 CEST 2018 - ma@suse.de
- PackageProvider: Validate deta rpms before caching (bsc#1091624,
getRawGpgChecks( ogpg[0], ogpg[1], ogpg[2] );
bool changed = false;
- switch ( mode_r )
+ switch ( mode_r.asEnum() )
{
case GpgCheck::On:
changed = changeGpgCheckTo( ogpg, true, indeterminate, indeterminate );
std::ostream & operator<<( std::ostream & str, const RepoInfo::GpgCheck & obj )
{
- switch ( obj )
+ switch ( obj.asEnum() )
{
#define OUTS( V ) case RepoInfo::V: return str << #V; break
OUTS( GpgCheck::On );
#include "zypp/Url.h"
#include "zypp/Locale.h"
#include "zypp/TriBool.h"
+#include "zypp/base/EnumClass.h"
#include "zypp/repo/RepoType.h"
#include "zypp/repo/RepoVariables.h"
/** Set the value for \ref validRepoSignature (or \c indeterminate if unsigned). */
void setValidRepoSignature( TriBool value_r );
- /** Some predefined settings */
- enum class GpgCheck {
- indeterminate, //< not specified
- On, //< 1** --gpgcheck
- Strict, //< 111 --gpgcheck-strict
- AllowUnsigned, //< 100 --gpgcheck-allow-unsigned
- AllowUnsignedRepo, //< 10* --gpgcheck-allow-unsigned-repo
- AllowUnsignedPackage, //< 1*0 --gpgcheck-allow-unsigned-package
- Default, //< *** --default-gpgcheck
- Off, //< 0** --no-gpgcheck
+ /** Some predefined settings (use like 'enum class \ref GpgCheck') */
+ struct GpgCheckDef {
+ enum Enum {
+ indeterminate, //< not specified
+ On, //< 1** --gpgcheck
+ Strict, //< 111 --gpgcheck-strict
+ AllowUnsigned, //< 100 --gpgcheck-allow-unsigned
+ AllowUnsignedRepo, //< 10* --gpgcheck-allow-unsigned-repo
+ AllowUnsignedPackage, //< 1*0 --gpgcheck-allow-unsigned-package
+ Default, //< *** --default-gpgcheck
+ Off, //< 0** --no-gpgcheck
+ };
};
+ typedef base::EnumClass<GpgCheckDef> GpgCheck; ///< 'enum class GpgCheck'
/** Adjust *GpgCheck settings according to \a mode_r.
* \c GpgCheck::indeterminate will leave the settings as they are.
#include "zypp/PathInfo.h"
#include "zypp/ExternalProgram.h"
+#include "zypp/target/rpm/librpmDb.h"
#include "zypp/misc/CheckAccessDeleted.h"
ino_t pidNS;
};
+ /** bsc#1099847: Check for lsof version < 4.90 which does not support '-K i'
+ * Just a quick check to allow code15 libzypp runnig in a code12 environment.
+ * bsc#1036304: '-K i' was backported to older lsof versions, indicated by
+ * lsof providing 'backported-option-Ki'.
+ */
+ bool lsofNoOptKi()
+ {
+ using target::rpm::librpmDb;
+ // RpmDb access is blocked while the Target is not initialized.
+ // Launching the Target just for this query would be an overkill.
+ struct TmpUnblock {
+ TmpUnblock()
+ : _wasBlocked( librpmDb::isBlocked() )
+ { if ( _wasBlocked ) librpmDb::unblockAccess(); }
+ ~TmpUnblock()
+ { if ( _wasBlocked ) librpmDb::blockAccess(); }
+ private:
+ bool _wasBlocked;
+ } tmpUnblock;
+
+ librpmDb::db_const_iterator it;
+ return( it.findPackage( "lsof" ) && it->tag_edition() < Edition("4.90") && !it->tag_provides().count( Capability("backported-option-Ki") ) );
+ }
+
/////////////////////////////////////////////////////////////////
} // namespace
///////////////////////////////////////////////////////////////////
{
_data.clear();
- static const char* argv[] =
- {
- "lsof", "-n", "-FpcuLRftkn0", NULL
- };
+ static const char* argv[] = { "lsof", "-n", "-FpcuLRftkn0", "-K", "i", NULL };
+ if ( lsofNoOptKi() )
+ argv[3] = NULL;
ExternalProgram prog( argv, ExternalProgram::Discard_Stderr );
// cachemap: PID => (deleted files)