Commit db1159a1 authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra

Revert "Add a new none-or-some element <allowbuilddep> to project meta config"

Added as an external patch in c4a04440
This reverts commit 309e5a9e.
parent 66988814
......@@ -149,14 +149,6 @@
</element>
</define>
<define ns="" name="allowbuilddep-element">
<element name="allowbuilddep">
<attribute name="name">
<data type="string" />
</attribute>
</element>
</define>
<define ns="" name="group-element">
<element name="group">
<attribute name="groupid">
......
......@@ -95,10 +95,6 @@
</element>
</optional>
<zeroOrMore>
<ref name="allowbuilddep-element"/>
</zeroOrMore>
<zeroOrMore>
<ref name="person-element"/>
</zeroOrMore>
......
class Allowbuilddep < ActiveRecord::Base
belongs_to :project, foreign_key: :db_project_id, inverse_of: :allowbuilddeps
end
......@@ -51,8 +51,6 @@ class Project < ActiveRecord::Base
end
has_many :attribs, :dependent => :destroy
has_many :allowbuilddeps, :dependent => :destroy, foreign_key: :db_project_id
has_many :repositories, :dependent => :destroy, foreign_key: :db_project_id
has_many :repository_architectures, -> { order("position") }, through: :repositories
has_many :architectures, -> { order("position").distinct }, :through => :repository_architectures
......@@ -577,7 +575,6 @@ class Project < ActiveRecord::Base
#--- update repositories ---#
update_repositories(xmlhash, force)
#--- end update repositories ---#
update_allowbuilddep_from_xml(xmlhash)
end
def update_from_xml(xmlhash, force = nil)
......@@ -587,13 +584,6 @@ class Project < ActiveRecord::Base
{ error: e.message }
end
def update_allowbuilddep_from_xml(xmlhash)
self.allowbuilddeps.destroy_all
xmlhash.elements('allowbuilddep') do |abd|
self.allowbuilddeps.create(name: abd['name'])
end
end
def update_repositories(xmlhash, force)
fill_repo_cache
......
......@@ -20,11 +20,6 @@ xml.project(project_attributes) do
my_model.render_relationships(xml)
adbs = my_model.allowbuilddeps.sort { |a, b| b.name <=> a.name }
adbs.each do |adb|
xml.allowbuilddep(name: adb.name)
end
repos = my_model.repositories.not_remote.sort { |a, b| b.name <=> a.name }
FlagHelper.flag_types.each do |flag_name|
flaglist = my_model.type_flags(flag_name)
......
class CreateAllowbuilddeps < ActiveRecord::Migration
def self.up
create_table :allowbuilddeps do |t|
t.integer :db_project_id, :null => false
t.string :name, :null => false
t.index [ :db_project_id, :name ]
end
end
def self.down
drop_table :allowbuilddeps
end
end
CREATE TABLE `allowbuilddeps` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`db_project_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `index_allowbuilddeps_on_db_project_id_and_name` (`db_project_id`,`name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `architectures` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
......@@ -1690,8 +1682,6 @@ INSERT INTO schema_migrations (version) VALUES ('20160518105300');
INSERT INTO schema_migrations (version) VALUES ('20160824132643');
INSERT INTO schema_migrations (version) VALUES ('20191011000000');
INSERT INTO schema_migrations (version) VALUES ('21');
INSERT INTO schema_migrations (version) VALUES ('22');
......
......@@ -115,10 +115,6 @@ our @flags = (
[ 'access' => @disableenable ],
);
our @allowbuilddep = (
[[ 'allowbuilddep' => 'name' ]],
);
our @roles = (
[[ 'person' =>
'userid',
......@@ -155,7 +151,6 @@ our $proj = [
'project',
],
@roles,
@allowbuilddep,
$maintenance,
@flags,
[ $repo ],
......@@ -297,7 +292,6 @@ our $projpack = [
[],
'title',
'description',
@allowbuilddep,
'config',
'patternmd5',
[[ 'link' =>
......
......@@ -3266,7 +3266,7 @@ sub getprojpack {
}
next if $repoids && !grep {$repoids->{$_->{'name'}}} @{$proj->{'repository'} || []};
next if $packids && !grep {$packids->{$_}} @packages;
for (qw{title description build publish debuginfo useforbuild remoteurl remoteproject download link sourceaccess privacy access lock allowbuilddep}) {
for (qw{title description build publish debuginfo useforbuild remoteurl remoteproject download link sourceaccess privacy access lock}) {
$jinfo->{$_} = $proj->{$_} if exists $proj->{$_};
}
if ($proj->{'access'}) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment