#include "zypp/parser/yum/RepoParser.h"
#include "zypp/repo/susetags/Downloader.h"
#include "zypp/parser/susetags/RepoParser.h"
+#include "zypp/parser/plaindir/RepoParser.h"
#include "zypp/ZYppCallbacks.h"
return refresh ? REFRESH_NEEDED : REPO_UP_TO_DATE;
}
-#if 0
else if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e )
{
RepoStatus newstatus = parser::plaindir::dirStatus(url.getPathName());
if (!refresh)
touchIndexFile(info);
- return refresh;
+ return refresh ? REFRESH_NEEDED : REPO_UP_TO_DATE;
}
-#endif
else
{
ZYPP_THROW(RepoUnknownTypeException());
downloader_ptr->download( media, tmpdir.path());
}
-#if 0
else if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e )
{
RepoStatus newstatus = parser::plaindir::dirStatus(url.getPathName());
file.close();
}
-#endif
else
{
ZYPP_THROW(RepoUnknownTypeException());
{
case RepoType::RPMMD_e :
case RepoType::YAST2_e :
+ case RepoType::RPMPLAINDIR_e :
{
// Take care we unlink the solvfile on exception
ManagedFile guard( solvfile, filesystem::unlink );
ostringstream cmd;
- cmd << str::form( "repo2solv.sh \"%s\" > \"%s\"", rawpath.c_str(), solvfile.c_str() );
+ if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e )
+ {
+ cmd << str::form( "repo2solv.sh \"%s\" > \"%s\"", info.baseUrlsBegin()->getPathName().c_str(), solvfile.c_str() );
+ } else
+ cmd << str::form( "repo2solv.sh \"%s\" > \"%s\"", rawpath.c_str(), solvfile.c_str() );
MIL << "Executing: " << cmd.str() << endl;
ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout );
// no error
}
break;
-#endif
-#if 0
- case RepoType::RPMPLAINDIR_e :
- {
- CombinedProgressData subprogrcv( progress, 100);
- InputStream is(rawpath + "cookie");
- string buffer;
- getline( is.stream(), buffer);
- Url url(buffer);
- parser::plaindir::RepoParser parser(id, store, subprogrcv);
- parser.parse(url.getPathName());
- }
- break;
default:
ZYPP_THROW(RepoUnknownTypeException());
return status;
}
-data::Package_Ptr makePackageDataFromHeader( const RpmHeader::constPtr header,
- set<string> * filerequires,
- const Pathname & location, std::string &repoid )
-{
- if ( ! header )
- return 0;
-
- if ( header->isSrc() ) {
- WAR << "Can't make Package from SourcePackage header" << endl;
- return 0;
- }
-
- data::Package_Ptr pkg = new data::Package;
-
- pkg->name = header->tag_name();
- pkg->edition = header->tag_edition();
- pkg->arch = header->tag_arch();
-
- header->tag_requires( filerequires ).swap( pkg->deps[Dep::REQUIRES] );
- header->tag_prerequires( filerequires ).swap( pkg->deps[Dep::PREREQUIRES] );
- header->tag_conflicts( filerequires ).swap( pkg->deps[Dep::CONFLICTS] );
- header->tag_obsoletes( filerequires ).swap( pkg->deps[Dep::OBSOLETES] );
- header->tag_enhances( filerequires ).swap( pkg->deps[Dep::ENHANCES] );
- header->tag_suggests( filerequires ).swap( pkg->deps[Dep::SUGGESTS] );
- header->tag_freshens( filerequires ).swap( pkg->deps[Dep::FRESHENS] );
- header->tag_supplements( filerequires ).swap( pkg->deps[Dep::SUPPLEMENTS] );
-
- pkg->vendor = header->tag_vendor();
- pkg->installedSize = header->tag_size();
- pkg->buildTime = header->tag_buildtime();
- pkg->summary = (TranslatedText)header->tag_summary();
- pkg->description = (TranslatedText)header->tag_description();
-
- pkg->repositoryLocation = location;
-
- header->tag_du( pkg->diskusage );
-
- list<string> filenames = header->tag_filenames();
- pkg->deps[Dep::PROVIDES] = header->tag_provides ( filerequires );
-
- for (list<string>::const_iterator filename = filenames.begin();
- filename != filenames.end();
- ++filename)
- {
- if ( Capability::isInterestingFileSpec( *filename ) )
- {
- pkg->deps[Dep::PROVIDES].insert( Capability( *filename, Capability::PARSED ) );
- }
- }
-
- return pkg;
-}
-
-
/** RepoParser implementation.
* \todo Clean data on exeption.
*/
ZYPP_THROW( AbortRequestException() );
}
+#if 0
int RepoParser::Impl::extract_packages_from_directory( const Pathname & rootpath,
const Pathname & subdir,
bool recursive)
}
return 0;
}
+#endif
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : RepoParser