[24003] users/jberry/mpwa
source_changes at macosforge.org
source_changes at macosforge.org
Sat Apr 14 08:26:12 PDT 2007
Revision: 24003
http://trac.macosforge.org/projects/macports/changeset/24003
Author: jberry at macports.org
Date: 2007-04-14 08:26:12 -0700 (Sat, 14 Apr 2007)
Log Message:
-----------
mpwa: make sure tags are created only once
Modified Paths:
--------------
users/jberry/mpwa/app/models/port.rb
users/jberry/mpwa/app/models/port_pkg.rb
users/jberry/mpwa/app/models/tag.rb
users/jberry/mpwa/doc/portpkg-design.txt
users/jberry/mpwa/doc/schema-thoughts.sql
Modified: users/jberry/mpwa/app/models/port.rb
===================================================================
--- users/jberry/mpwa/app/models/port.rb 2007-04-14 14:45:49 UTC (rev 24002)
+++ users/jberry/mpwa/app/models/port.rb 2007-04-14 15:26:12 UTC (rev 24003)
@@ -40,7 +40,7 @@
end
def add_tag(name)
- self.tags.build('name' => name) unless has_tag name
+ self.tags << Tag.ensure_tag(name) unless has_tag name
end
end
Modified: users/jberry/mpwa/app/models/port_pkg.rb
===================================================================
--- users/jberry/mpwa/app/models/port_pkg.rb 2007-04-14 14:45:49 UTC (rev 24002)
+++ users/jberry/mpwa/app/models/port_pkg.rb 2007-04-14 15:26:12 UTC (rev 24003)
@@ -109,7 +109,7 @@
end
def add_tag(name)
- self.tags.build('name' => name) unless has_tag name
+ self.tags << Tag.ensure_tag(name) unless has_tag name
end
end
Modified: users/jberry/mpwa/app/models/tag.rb
===================================================================
--- users/jberry/mpwa/app/models/tag.rb 2007-04-14 14:45:49 UTC (rev 24002)
+++ users/jberry/mpwa/app/models/tag.rb 2007-04-14 15:26:12 UTC (rev 24003)
@@ -6,7 +6,7 @@
Tag.find(:first, :conditions => "name = '#{name}'")
end
- def Tag.ensure_tag(name, info)
+ def Tag.ensure_tag(name)
tag = Tag.by_name(name)
if tag.nil?
# build a new tag
Modified: users/jberry/mpwa/doc/portpkg-design.txt
===================================================================
--- users/jberry/mpwa/doc/portpkg-design.txt 2007-04-14 14:45:49 UTC (rev 24002)
+++ users/jberry/mpwa/doc/portpkg-design.txt 2007-04-14 15:26:12 UTC (rev 24003)
@@ -34,6 +34,7 @@
* Submitter Name
* Submitter Email address
* Submitter Notes (about the package)
+ * Submitter tags (tags the submitter would like to add on submit)
(package information: automatically parsed from the Portfile)
* Port name
@@ -56,7 +57,9 @@
* Dependencies
Additionally, it's possible that the following additional meta information will be
- appended on submission of the portpkg through mpwa:
+ appended on submission of the portpkg through mpwa. This is probably not a good
+ idea, as then there is not a verifiable correspondence between the package the submitter
+ submitted (and potentially signed) and the one that is stored.
* Submitter Account UserName
* Submission Date
Modified: users/jberry/mpwa/doc/schema-thoughts.sql
===================================================================
--- users/jberry/mpwa/doc/schema-thoughts.sql 2007-04-14 14:45:49 UTC (rev 24002)
+++ users/jberry/mpwa/doc/schema-thoughts.sql 2007-04-14 15:26:12 UTC (rev 24003)
@@ -79,7 +79,8 @@
id bigint not null primary key auto_increment,
name varchar(31)
);
-
+create unique index tagNames on Tags(name);
+
-- many-many relationship between PortPkg and Tag
drop table if exists Port_Pkgs_Tags;
create table Port_Pkgs_Tags (
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070414/3c9b935a/attachment.html
More information about the macports-changes
mailing list