Author: jkupec Date: Mon Dec 1 16:51:34 2008 New Revision: 11843 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11843&view=rev Log: - fixed handling of source-install -d and -D options (bnc #428131) Modified: trunk/zypper/src/Zypper.cc trunk/zypper/src/misc.cc trunk/zypper/src/misc.h Modified: trunk/zypper/src/Zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=11843&r1=11842&r2=11843&view=diff ============================================================================== --- trunk/zypper/src/Zypper.cc (original) +++ trunk/zypper/src/Zypper.cc Mon Dec 1 16:51:34 2008 @@ -3165,14 +3165,15 @@ if (exitCode() != ZYPPER_EXIT_OK) return; init_target(*this); - if (!copts.count("no-build-deps")) - load_target_resolvables(*this); + // if (!copts.count("no-build-deps")) // if target resolvables are not read, solver produces a weird result + load_target_resolvables(*this); load_repo_resolvables(*this); - if (!copts.count("no-build-deps")) + if (copts.count("no-build-deps")) + mark_src_pkgs(*this); + else build_deps_install(*this); - if (!copts.count("build-deps-only")) - find_src_pkgs(*this); + solve_and_commit(*this); break; } Modified: trunk/zypper/src/misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/misc.cc?rev=11843&r1=11842&r2=11843&view=diff ============================================================================== --- trunk/zypper/src/misc.cc (original) +++ trunk/zypper/src/misc.cc Mon Dec 1 16:51:34 2008 @@ -354,17 +354,20 @@ DBG << format("Injecting build requieres for source package %s-%s") % srcpkg->name() % srcpkg->edition() << endl; - // add all src requires to pool DEPRECATED: srcpakcages will be in - // the pool (together with their build-deps) like normal packages - // so only require the srcpackage - /* - for_( itc, srcpkg->dep(Dep::REQUIRES).begin(), srcpkg->dep(Dep::REQUIRES).end() ) + // install build depenendcies only + if (zypper.cOpts().count("build-deps-only")) + for_(itc, srcpkg->requires().begin(), srcpkg->requires().end()) + { + God->resolver()->addRequire(*itc); + DBG << "requiring: " << *itc << endl; + } + // install the source package with build deps + else { - God->resolver()->addRequire(*itc); - DBG << "added req: " << *itc << endl; - }*/ - God->resolver()->addRequire(Capability(srcpkg->name(), Rel::EQ, srcpkg->edition(), ResKind::srcpackage)); - //installer.item.status().setToBeInstalled( zypp::ResStatus::USER ); + Capability cap(srcpkg->name(), Rel::EQ, srcpkg->edition(), ResKind::srcpackage); + God->resolver()->addRequire(cap); + DBG << "requiring: " << cap << endl; + } } else { @@ -375,8 +378,7 @@ } } - -void find_src_pkgs(Zypper & zypper) +void mark_src_pkgs(Zypper & zypper) { /* * Workflow: Modified: trunk/zypper/src/misc.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/misc.h?rev=11843&r1=11842&r2=11843&view=diff ============================================================================== --- trunk/zypper/src/misc.h (original) +++ trunk/zypper/src/misc.h Mon Dec 1 16:51:34 2008 @@ -17,8 +17,8 @@ * Loops through resolvables, checking if there is license to confirm. When * run interactively, it displays a dialog, otherwise it answers automatically * according to --auto-agree-with-licenses present or not present. - * - * \returns true if all licenses have been confirmed, false otherwise. + * + * \returns true if all licenses have been confirmed, false otherwise. */ bool confirm_licenses(Zypper & zypper); @@ -37,15 +37,25 @@ /** - * Find source packages by names specified as arguments. + * Find source packages by names specified as arguments and enqueue them + * for installation. + * + * \todo this will get deprecated after commit refactoring + * \note we still need to be able to install the source package alone + * (without build-deps, which are listed as 'requires' of the srcpackage) */ -void find_src_pkgs(Zypper & zypper); +void mark_src_pkgs(Zypper & zypper); + /** - * Install source packages found by \ref find_src_pkgs. + * Install source packages found by \ref mark_src_pkgs. + * \todo this uses ZYpp->installSrcPackage(srcpkg) - if it is to be gone + * during the zypp commit refactoring, we need a replacement */ void install_src_pkgs(Zypper & zypper); + /** - * Inject requirements of source packages' build dependencies to the pool. + * Inject requirements of a source package or its build dependencies (depending + * on command line options) to the pool. */ void build_deps_install(Zypper & zypper); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org