Author: jkupec Date: Mon Jan 14 14:21:55 2008 New Revision: 8270 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8270&view=rev Log: - use root_dir before rpm file cache dir - user /var/cache/zypper/RPMS as download dir for plain rpms Modified: trunk/zypper/src/zypper-utils.cc trunk/zypper/src/zypper-utils.h trunk/zypper/src/zypper.cc trunk/zypper/src/zypper.h Modified: trunk/zypper/src/zypper-utils.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.cc?rev=82... ============================================================================== --- trunk/zypper/src/zypper-utils.cc (original) +++ trunk/zypper/src/zypper-utils.cc Mon Jan 14 14:21:55 2008 @@ -187,7 +187,7 @@ // ---------------------------------------------------------------------------- -Pathname cache_rpm(const string & rpm_uri_str) +Pathname cache_rpm(const string & rpm_uri_str, const string & cache_dir) { Url rpmurl = make_url(rpm_uri_str); Pathname rpmpath(rpmurl.getPathName()); @@ -202,7 +202,7 @@ mm.provideFile(mid, rpmpath.basename()); Pathname localrpmpath = mm.localPath(mid, rpmpath.basename()); - Pathname cachedrpmpath = "/var/cache/zypp/RPMS/"; + Pathname cachedrpmpath = cache_dir; filesystem::assert_dir(cachedrpmpath); bool error = filesystem::copy(localrpmpath, cachedrpmpath / localrpmpath.basename()); Modified: trunk/zypper/src/zypper-utils.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.h?rev=827... ============================================================================== --- trunk/zypper/src/zypper-utils.h (original) +++ trunk/zypper/src/zypper-utils.h Mon Jan 14 14:21:55 2008 @@ -42,12 +42,13 @@ bool looks_like_rpm_file(const std::string & s); /** - * Download the RPM file specified by \a rpm_uri_str and copy it into zypp - * cache dir. + * Download the RPM file specified by \a rpm_uri_str and copy it into + * \a cache_dir. * * \return The local Pathname of the file in the cache on success, empty * Pathname if a problem occurs. */ -zypp::Pathname cache_rpm(const std::string & rpm_uri_str); +zypp::Pathname cache_rpm(const std::string & rpm_uri_str, + const std::string & cache_dir); #endif /*ZYPPER_UTILS_H*/ Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8270&... ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Mon Jan 14 14:21:55 2008 @@ -1649,7 +1649,9 @@ // download the rpm into the cache //! \todo do we want this or a tmp dir? What about the files cached before? //! \todo optimize: don't mount the same media multiple times for each rpm - Pathname rpmpath = cache_rpm(*it); + Pathname rpmpath = cache_rpm(*it, + (_gopts.root_dir != "/" ? _gopts.root_dir : "") + + ZYPPER_RPM_CACHE_DIR); if (rpmpath.empty()) { @@ -1695,7 +1697,9 @@ // add a plaindir repo RepoInfo repo; repo.setType(repo::RepoType::RPMPLAINDIR); - repo.addBaseUrl(Url("dir:///var/cache/zypp/RPMS")); + repo.addBaseUrl(Url("dir://" + + (_gopts.root_dir != "/" ? _gopts.root_dir : "") + + ZYPPER_RPM_CACHE_DIR)); repo.setEnabled(true); repo.setAutorefresh(true); repo.setAlias("_tmpRPMcache_"); @@ -1705,7 +1709,7 @@ } //! \todo quit here if the argument list remains empty after founding only invalid rpm args - + // prepare repositories init_repos(*this); if (exitCode() != ZYPPER_EXIT_OK) Modified: trunk/zypper/src/zypper.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=8270&... ============================================================================== --- trunk/zypper/src/zypper.h (original) +++ trunk/zypper/src/zypper.h Mon Jan 14 14:21:55 2008 @@ -16,6 +16,10 @@ #include "zypper-command.h" #include "zypper-getopt.h" +/** directory for storing manually installed (zypper install foo.rpm) RPM files + */ +#define ZYPPER_RPM_CACHE_DIR "/var/cache/zypper/RPMS" + /** * Structure for holding global options. */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org