Author: jkupec Date: Mon Aug 6 18:10:40 2007 New Revision: 6498 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6498&view=rev Log: - changed zypper source-install to take more arguments at once Modified: trunk/zypper/doc/zypper.8 trunk/zypper/src/zypper-misc.cc trunk/zypper/src/zypper.cc Modified: trunk/zypper/doc/zypper.8 URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=6498&r1=6497&r2=6498&view=diff ============================================================================== --- trunk/zypper/doc/zypper.8 (original) +++ trunk/zypper/doc/zypper.8 Mon Aug 6 18:10:40 2007 @@ -77,10 +77,10 @@ install or remove command. .TP -.B source-install (si) <name> -Install a source package specified by its name. +.B source-install (si) <name> ... +Install source packages specified by their names. -This command will try to find the newest available version of the source package and use rpm -i to install it. +This command will try to find the newest available versions of the source packages and use rpm -i to install them. .TP .B list-updates (lu) [options] Modified: trunk/zypper/src/zypper-misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=6498&r1=6497&r2=6498&view=diff ============================================================================== --- trunk/zypper/src/zypper-misc.cc (original) +++ trunk/zypper/src/zypper-misc.cc Mon Aug 6 18:10:40 2007 @@ -1304,43 +1304,47 @@ * 4. install the source package with ZYpp->installSrcPackage(SrcPackage::constPtr); */ - SrcPackage::Ptr srcpkg; - - gData.repo_resolvables.forEach( - functor::chain( - resfilter::ByName(arguments[0]), - resfilter::ByKind(ResTraits<SrcPackage>::kind)), - FindSrcPackage(srcpkg)); - - if (srcpkg) + int ret = ZYPPER_EXIT_OK; + + for (vector<string>::const_iterator it = arguments.begin(); + it != arguments.end(); ++it) { - cout << format(_("Installing source package %s-%s")) - % srcpkg->name() % srcpkg->edition() << endl; - MIL << "Going to install srcpackage: " << srcpkg << endl; + SrcPackage::Ptr srcpkg; - try + gData.repo_resolvables.forEach( + functor::chain( + resfilter::ByName(*it), + resfilter::ByKind(ResTraits<SrcPackage>::kind)), + FindSrcPackage(srcpkg)); + + if (srcpkg) { - God->installSrcPackage(srcpkg); - - cout << format(_("Source package %s-%s successfully installed.")) + cout << format(_("Installing source package %s-%s")) % srcpkg->name() % srcpkg->edition() << endl; - - return ZYPPER_EXIT_OK; - } - catch (const Exception & ex) - { - ZYPP_CAUGHT(ex); - cerr << format(_("Problem installing source package %s-%s:")) - % srcpkg->name() % srcpkg->edition() << endl; - cerr << ex.asUserString() << endl; - - return ZYPPER_EXIT_ERR_ZYPP; + MIL << "Going to install srcpackage: " << srcpkg << endl; + + try + { + God->installSrcPackage(srcpkg); + + cout << format(_("Source package %s-%s successfully installed.")) + % srcpkg->name() % srcpkg->edition() << endl; + } + catch (const Exception & ex) + { + ZYPP_CAUGHT(ex); + cerr << format(_("Problem installing source package %s-%s:")) + % srcpkg->name() % srcpkg->edition() << endl; + cerr << ex.asUserString() << endl; + + ret = ZYPPER_EXIT_ERR_ZYPP; + } } + else + cerr << format(_("Source package '%s' not found.")) % (*it) << endl; } - else - cerr << format(_("Source package '%s' not found.")) % arguments[0] << endl; - return ZYPPER_EXIT_OK; + return ret; } // Local Variables: Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=6498&r1=6497&r2=6498&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Mon Aug 6 18:10:40 2007 @@ -329,9 +329,9 @@ }; specific_options = src_install_options; specific_help = _( - "source-install (si) <name>\n" + "source-install (si) <name> ...\n" "\n" - "Install a source package specified by its name.\n" + "Install source packages specified by their names.\n" "\n" "This command has no additional options.\n" ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org