Author: jkupec Date: Wed Mar 26 12:39:19 2008 New Revision: 9274 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9274&view=rev Log: - fixed location of RPMs in subdirs when parsing plaindir repo recursively (bnc #368218) Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.cc branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.h Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.cc?rev=9274&r1=9273&r2=9274&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.cc (original) +++ branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.cc Wed Mar 26 12:39:19 2008 @@ -53,18 +53,20 @@ Pathname thePath = Pathname(url().getPathName()) + path(); MIL << "Going to read dir " << thePath << std::endl; - extract_packages_from_directory( _store, thePath, selfSourceRef(), true ); + extract_packages_from_directory( _store, thePath, Pathname(), selfSourceRef(), true ); } -int PlaindirImpl::extract_packages_from_directory (ResStore & store, const Pathname & path, Source_Ref source, bool recursive) +int PlaindirImpl::extract_packages_from_directory (ResStore & store, const Pathname & rootpath, const Pathname & subdir, Source_Ref source, bool recursive) { using target::rpm::RpmHeader; + Pathname path = rootpath / subdir; + Pathname filename; PathInfo magic; bool distro_magic, pkginfo_magic; - DBG << "extract_packages_from_directory(.., " << path << ", " << source.alias() << ", " << recursive << ")" << endl; + DBG << "extract_packages_from_directory(.., " << rootpath << ", " << subdir << ", " << source.alias() << ", " << recursive << ")" << endl; /* Check for magic files that indicate how to treat the @@ -101,12 +103,13 @@ PathInfo file_info( file_path ); if (recursive && file_info.isDir()) { - extract_packages_from_directory( store, file_path, source, recursive ); + extract_packages_from_directory( store, rootpath, subdir / *it, source, recursive ); } else if (file_info.isFile() && file_path.extension() == ".rpm" ) { RpmHeader::constPtr header = RpmHeader::readPackage( file_path, RpmHeader::NOSIGNATURE ); #warning FIX creation of Package from src.rpm header - Package::Ptr package = target::rpm::RpmDb::makePackageFromHeader( header, NULL, *it, source ); + // make up proper location relative to rootpath (bnc #368218) + Package::Ptr package = target::rpm::RpmDb::makePackageFromHeader( header, NULL, subdir / *it, source ); if (package != NULL) { DBG << "Adding package " << *package << endl; store.insert( package ); Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.h?rev=9274&r1=9273&r2=9274&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.h (original) +++ branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/source/plaindir/PlaindirImpl.h Wed Mar 26 12:39:19 2008 @@ -63,7 +63,7 @@ virtual void factoryInit(); virtual void createResolvables(Source_Ref source_r); - int extract_packages_from_directory (ResStore & store, const Pathname & path, Source_Ref source, bool recursive); + int extract_packages_from_directory (ResStore & store, const Pathname & rootpath, const Pathname & subdir, Source_Ref source, bool recursive); }; /////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org