aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-17 19:35:19 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-17 19:35:19 +0100
commita16c259ef5daac94b2f7a41e35946cf0e9d9cfd9 (patch)
treee7eaa6c2b7f840b675bfcae8f913a8fbcb904d69
parentf1c60b855daf94c46035b167cc5ee638feed7852 (diff)
downloadpaludis-a16c259ef5daac94b2f7a41e35946cf0e9d9cfd9.tar.gz
paludis-a16c259ef5daac94b2f7a41e35946cf0e9d9cfd9.tar.xz
let slot be specified for fake package ids
-rw-r--r--ruby/repository.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 26e6afb..006ceeb 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
* Copyright (c) 2007 David Leverton
*
@@ -714,6 +714,7 @@ namespace
* call-seq:
* add_version(qualified_package_name, version_spec) -> PackageID
* add_version(category_name, package_name, version_string) -> PackageID
+ * add_version(category_name, package_name, version_string, slot) -> PackageID
*
* Add a version, and a package and category if necessary, and set some
* default values for its metadata, and return said metadata.
@@ -724,7 +725,7 @@ namespace
try
{
std::tr1::shared_ptr<FakeRepositoryBase> repo(value_to_fake_repository_base(self));
- std::tr1::shared_ptr<PackageID> pkg;
+ std::tr1::shared_ptr<FakePackageID> pkg;
switch (argc)
{
@@ -743,6 +744,16 @@ namespace
break;
}
+ case 4: {
+ std::string cat(StringValuePtr(argv[0]));
+ std::string name(StringValuePtr(argv[1]));
+ std::string ver(StringValuePtr(argv[2]));
+ std::string slot(StringValuePtr(argv[3]));
+ pkg = repo->add_version(cat, name, ver);
+ pkg->set_slot(SlotName(slot));
+ break;
+ }
+
default:
rb_raise(rb_eArgError, "FakeRepositoryBase.add_version expects two or three arguments, but got %d", argc);
}