SET(LIBZYPP_MAJOR "17")
SET(LIBZYPP_COMPATMINOR "22")
SET(LIBZYPP_MINOR "23")
-SET(LIBZYPP_PATCH "2")
+SET(LIBZYPP_PATCH "3")
#
-# LAST RELEASED: 17.23.2 (22)
+# LAST RELEASED: 17.23.3 (22)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Wed Mar 25 15:26:14 CET 2020 - ma@suse.de
+
+- Add HistoryLogReader actionFilter to parse only specific
+ HistoryActionIDs.
+- version 17.23.3 (22)
+
+-------------------------------------------------------------------
Fri Mar 20 12:28:18 CET 2020 - ma@suse.de
- RepoVariables: Add safe guard in case the caller does not own a
void readFrom( const Date & date_r, const ProgressData::ReceiverFnc & progress_r );
void readFromTo( const Date & fromDate_r, const Date & toDate_r, const ProgressData::ReceiverFnc & progress_r );
+ void addActionFilter( const HistoryActionID & action_r )
+ {
+ if ( action_r == HistoryActionID::NONE )
+ _actionfilter.clear();
+ else
+ _actionfilter.insert( action_r.asString() );
+ }
+
Pathname _filename;
Options _options;
ProcessData _callback;
+ std::set<std::string> _actionfilter;
};
bool HistoryLogReader::Impl::parseLine( const std::string & line_r, unsigned lineNr_r )
HistoryLogData::FieldVector fields;
str::splitEscaped( line_r, std::back_inserter(fields), "|", true );
if ( fields.size() >= 2 )
- str::trim( fields[1] ); // for whatever reason writer is padding the action field
+ fields[1] = str::trim( std::move(fields[1]) ); // for whatever reason writer is padding the action field
+
+ if ( !_actionfilter.empty() && !_actionfilter.count( fields[1] ) )
+ return true;
// move into data class
HistoryLogData::Ptr data;
void HistoryLogReader::readFromTo( const Date & fromDate_r, const Date & toDate_r, const ProgressData::ReceiverFnc & progress_r )
{ _pimpl->readFromTo( fromDate_r, toDate_r, progress_r ); }
+ void HistoryLogReader::addActionFilter( const HistoryActionID & action_r )
+ { _pimpl->addActionFilter( action_r ); }
+
} // namespace parser
///////////////////////////////////////////////////////////////////
} // namespace zypp
*/
bool ignoreInvalidItems() const;
+
+ /** Process only specific HistoryActionIDs.
+ * Call repeatedly to add multiple HistoryActionIDs to process.
+ * Passing an empty HistoryActionID (HistoryActionID::NONE) clears
+ * the filter.
+ */
+ void addActionFilter( const HistoryActionID & action_r );
+
+ /** Clear any HistoryActionIDs. */
+ void clearActionFilter()
+ { addActionFilter( HistoryActionID::NONE ); }
+
private:
/** Implementation */
struct Impl;