From: Michael Andres Date: Fri, 22 Sep 2006 12:21:05 +0000 (+0000) Subject: backup X-Git-Tag: 6.6.0~3025 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a92e22f9af875a173cfa4e7f1475a59d053702e;p=platform%2Fupstream%2Flibzypp.git backup --- diff --git a/devel/devel.ma/Main.cc b/devel/devel.ma/Main.cc index 22620e9ef..122b28a1c 100644 --- a/devel/devel.ma/Main.cc +++ b/devel/devel.ma/Main.cc @@ -13,58 +13,11 @@ using namespace std; using namespace zypp; -static bool verbose = false; -static bool debug = false; +/////////////////////////////////////////////////////////////////// -#define LOG (debug ? USR : cout) +static const Pathname sysRoot( "/Local/ROOT" ); -struct KeyRingReceiver : public callback::ReceiveReport -{ - KeyRingReceiver() - { - connect(); - } - - virtual bool askUserToAcceptUnsignedFile( const std::string & file ) - { - LOG << "===[UnsignedFile " << file << "]" << endl; - return true; - } - virtual bool askUserToAcceptUnknownKey( const std::string &file, - const std::string &id ) - { - LOG << "===[UnknownKey " << id << "]" << endl; - return true; - } - virtual bool askUserToTrustKey( const PublicKey &key) - { - LOG << "===[TrustKey" << key << "]" << endl; - return true; - } - virtual bool askUserToImportKey( const PublicKey &key) - { - LOG << "===[ImportKey " << key << "]" << endl; - return true; - } - virtual bool askUserToAcceptVerificationFailed( const std::string &file, - const PublicKey &key ) - { - LOG << "===[VerificationFailed " << file << " " << key << "]" << endl; - return true; - } -}; - -struct ResStoreStats : public pool::PoolStats -{ - void operator()( const ResObject::constPtr & obj ) - { - if ( isKind( obj ) ) - { - LOG << obj << endl; - } - pool::PoolStats::operator()( obj ); - } -}; +/////////////////////////////////////////////////////////////////// /****************************************************************** ** @@ -73,88 +26,13 @@ struct ResStoreStats : public pool::PoolStats */ int main( int argc, char * argv[] ) { - zypp::base::LogControl::instance().logfile( "" ); + //zypp::base::LogControl::instance().logfile( "" ); INT << "===[START]==========================================" << endl; --argc; ++argv; - if ( ! argc ) - { - LOG << "Usage: ScanSource [options] url [[options] url...]" << endl; - LOG << " Display summary of Sources found at 'url'. " << endl; - LOG << " " << endl; - LOG << " " << endl; - LOG << " options:" << endl; - LOG << " +/-l enable/disable detailed listing of Source content" << endl; - LOG << " +/-d enable/disable debug output" << endl; - return 0; - } - - KeyRingReceiver accept; - - for ( ; argc; --argc, ++argv ) - { - if ( *argv == string("+l") ) - { - verbose = true; - continue; - } - if ( *argv == string("-l") ) - { - verbose = false; - continue; - } - if ( *argv == string("+d") ) - { - zypp::base::LogControl::instance().logfile( "-" ); - debug = true; - continue; - } - if ( *argv == string("-d") ) - { - zypp::base::LogControl::instance().logfile( "" ); - debug = false; - continue; - } - - LOG << "====================================================" << endl; - LOG << "===Search Source at Url(" << *argv << ")..." << endl; - Source_Ref src; - try - { - src = SourceFactory().createFrom( Url(*argv), "/", "" ); - } - catch ( const Exception & except_r ) - { - LOG << "***Failed: " << except_r << endl; - continue; - } - LOG << "numberOfMedia: " << src.numberOfMedia() << endl; - LOG << "alias: " << src.alias() << endl; - LOG << "vendor: " << src.vendor() << endl; - LOG << "unique_id: " << src.unique_id() << endl; - LOG << "zmdName: " << src.zmdName() << endl; - LOG << "zmdDescription: " << src.zmdDescription() << endl; - LOG << "baseSource: " << src.baseSource() << endl; - LOG << "publicKeys: " << src.publicKeys() << endl; + cout << "x" << endl; - LOG << "===Parse content..." << endl; - try - { - src.resolvables(); - } - catch ( const Exception & except_r ) - { - LOG << "***Failed: " << except_r << endl; - continue; - } - LOG << for_each( src.resolvables().begin(), src.resolvables().end(), - ResStoreStats() ) << endl; - if ( verbose ) - { - dumpRange( LOG, src.resolvables().begin(), src.resolvables().end() ) << endl; - } - } INT << "===[END]============================================" << endl << endl; return 0; diff --git a/devel/devel.ma/ma_test b/devel/devel.ma/ma_test index cd7f362cf..52da971c3 100755 --- a/devel/devel.ma/ma_test +++ b/devel/devel.ma/ma_test @@ -39,4 +39,8 @@ $MAKE $PRG || exit 1 export ZYPP_LOGFILE=- export ZYPP_KEYRING_DEFAULT_ACCEPT_ALL=1 #export ZYPP_TESTSUITE_FAKE_ARCH=x86_64 -$SUDO ./$PRG "$@" 2>&1 | tee log > $LPIPE +#$SUDO ./$PRG "$@" 2>&1 | tee log > $LPIPE + +exec 2> >(tee log > $LPIPE) +$SUDO ./$PRG "$@" +