Author: mlandres Date: Wed Aug 6 18:38:30 2008 New Revision: 10768 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10768&view=rev Log: - Detect correct download path even if repository type is not set. (bnc #386386) Modified: trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/sat/Solvable.cc Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10768&r1=10767&r2=10768&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Wed Aug 6 18:38:30 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Aug 6 18:21:30 CEST 2008 ma@suse.de + +- Detect correct download path even if repository type + is not set. (bnc #386386) +- revision 10768 + +------------------------------------------------------------------- Wed Aug 6 17:15:48 CEST 2008 ma@suse.de - Cleanup, mostly by removing, unused parser code and related classes. Modified: trunk/libzypp/zypp/sat/Solvable.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=10768&r1=10767&r2=10768&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.cc (original) +++ trunk/libzypp/zypp/sat/Solvable.cc Wed Aug 6 18:38:30 2008 @@ -20,6 +20,8 @@ #include "zypp/sat/detail/PoolImpl.h" #include "zypp/sat/Solvable.h" #include "zypp/sat/Pool.h" +#include "zypp/sat/LookupAttr.h" + #include "zypp/Repository.h" #include "zypp/OnMediaLocation.h" #include "zypp/ZConfig.h" @@ -209,12 +211,24 @@ OnMediaLocation ret; Pathname path; - if ( repository().info().type().toEnum() == repo::RepoType::YAST2_e ) - { #warning STILL HARDCODED /suse PREFIX in location - // (ma@) loading a susetags repo search for a solvable with attribute - // susetags:datadir. this is the prefix. store it in RepoInfo(?). - path = "suse"; + // (ma@) loading a susetags repo search for a solvable with attribute + // susetags:datadir. this is the prefix. store it in RepoInfo(?). + // (ma@) Just a quick'n'dirty solution as we wan't + // to get rid of susetags. + static const sat::SolvAttr susetagsDatadir( "susetags:datadir" ); + switch ( repository().info().type().toEnum() ) + { + case repo::RepoType::NONE_e: + if ( sat::LookupAttr( susetagsDatadir, repository() ).empty() ) + break; + // else set type and fall through + repository().info().setProbedType( repo::RepoType::YAST2_e ); + case repo::RepoType::YAST2_e: + path = "suse"; + break; + default: + break; } ret.setLocation ( path/file, medianr ); ret.setDownloadSize( ByteCount( lookupNumAttribute( SolvAttr::downloadsize ), ByteCount::K ) ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org