Merge pull request #900 from warpc/898-publish-i686-packages-into-x86_64-repository
[refs #898]: publish i686 packages into x86 64 repository
This commit is contained in:
commit
0c69326e80
|
@ -5,6 +5,8 @@ Rosa.Views.ProjectModifyView = Backbone.View.extend({
|
||||||
this.$checkbox_wrapper = $('#niceCheckbox1');
|
this.$checkbox_wrapper = $('#niceCheckbox1');
|
||||||
this._$checkbox = this.$checkbox_wrapper.children('#project_is_package').first();
|
this._$checkbox = this.$checkbox_wrapper.children('#project_is_package').first();
|
||||||
this.$maintainer_form = $('#maintainer_form');
|
this.$maintainer_form = $('#maintainer_form');
|
||||||
|
this.$publish_form = $('#publish_form');
|
||||||
|
this._$publish_checkbox = this.$publish_form.find('#project_publish_i686_into_x86_64').first();
|
||||||
|
|
||||||
this.$checkbox_wrapper.on('click', this.checkboxClick);
|
this.$checkbox_wrapper.on('click', this.checkboxClick);
|
||||||
},
|
},
|
||||||
|
@ -12,8 +14,13 @@ Rosa.Views.ProjectModifyView = Backbone.View.extend({
|
||||||
checkboxClick: function() {
|
checkboxClick: function() {
|
||||||
if (this._$checkbox.is(':checked')) {
|
if (this._$checkbox.is(':checked')) {
|
||||||
this.$maintainer_form.slideDown();
|
this.$maintainer_form.slideDown();
|
||||||
|
this.$publish_form.slideDown();
|
||||||
} else {
|
} else {
|
||||||
this.$maintainer_form.slideUp();
|
this.$maintainer_form.slideUp();
|
||||||
|
this.$publish_form.slideUp();
|
||||||
|
if (this._$publish_checkbox.is(':checked')) {
|
||||||
|
changeCheck(this.$publish_form.find('.niceCheck-main'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Project < ActiveRecord::Base
|
||||||
validate { errors.add(:base, :can_have_less_or_equal, :count => MAX_OWN_PROJECTS) if owner.projects.size >= MAX_OWN_PROJECTS }
|
validate { errors.add(:base, :can_have_less_or_equal, :count => MAX_OWN_PROJECTS) if owner.projects.size >= MAX_OWN_PROJECTS }
|
||||||
validate :check_default_branch
|
validate :check_default_branch
|
||||||
|
|
||||||
attr_accessible :name, :description, :visibility, :srpm, :is_package, :default_branch, :has_issues, :has_wiki, :maintainer_id
|
attr_accessible :name, :description, :visibility, :srpm, :is_package, :default_branch, :has_issues, :has_wiki, :maintainer_id, :publish_i686_into_x86_64
|
||||||
attr_readonly :name, :owner_id, :owner_type
|
attr_readonly :name, :owner_id, :owner_type
|
||||||
|
|
||||||
scope :recent, order("name ASC")
|
scope :recent, order("name ASC")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
json.projects @projects do |json, project|
|
json.projects @projects do |json, project|
|
||||||
json.partial! 'project', :project => project, :json => json
|
json.partial! 'project', :project => project, :json => json
|
||||||
json.(project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :average_build_time)
|
json.(project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :average_build_time, :publish_i686_into_x86_64)
|
||||||
json.created_at project.created_at.to_i
|
json.created_at project.created_at.to_i
|
||||||
json.updated_at project.updated_at.to_i
|
json.updated_at project.updated_at.to_i
|
||||||
json.partial! 'api/v1/shared/owner', :owner => project.owner
|
json.partial! 'api/v1/shared/owner', :owner => project.owner
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
json.project do |json|
|
json.project do |json|
|
||||||
json.partial! 'project', :project => @project, :json => json
|
json.partial! 'project', :project => @project, :json => json
|
||||||
json.(@project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :average_build_time)
|
json.(@project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :average_build_time, :publish_i686_into_x86_64)
|
||||||
json.created_at @project.created_at.to_i
|
json.created_at @project.created_at.to_i
|
||||||
json.updated_at @project.updated_at.to_i
|
json.updated_at @project.updated_at.to_i
|
||||||
json.partial! 'api/v1/shared/owner', :owner => @project.owner
|
json.partial! 'api/v1/shared/owner', :owner => @project.owner
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
- act = controller.action_name.to_sym
|
- act = controller.action_name.to_sym
|
||||||
- if [:new, :create].include? act
|
- if [:new, :create].include? act
|
||||||
.leftlist= f.label :name, t("activerecord.attributes.project.name"), :class => :label
|
.leftlist= f.label :name
|
||||||
.rightlist= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
.rightlist= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
||||||
.both
|
.both
|
||||||
.leftlist= f.label :description, t("activerecord.attributes.project.description"), :class => :label
|
.leftlist= f.label :description
|
||||||
.rightlist= f.text_area :description, :class => 'text_field', :cols => 80
|
.rightlist= f.text_area :description, :class => 'text_field', :cols => 80
|
||||||
.both
|
.both
|
||||||
- if [:new, :create].include? act
|
- if [:new, :create].include? act
|
||||||
.leftlist= f.label :owner_id, t("activerecord.attributes.project.owner"), :class => :label
|
.leftlist= f.label :owner
|
||||||
.rightlist
|
.rightlist
|
||||||
= label_tag t("activerecord.attributes.project.who_owns.me")
|
= label_tag t("activerecord.attributes.project.who_owns.me")
|
||||||
- if Group.can_own_project(current_user).count > 0
|
- if Group.can_own_project(current_user).count > 0
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
= hidden_field_tag :who_owns, :me
|
= hidden_field_tag :who_owns, :me
|
||||||
.both
|
.both
|
||||||
|
|
||||||
.leftlist= f.label :visibility, t("activerecord.attributes.project.visibility"), :class => :label
|
.leftlist= f.label :visibility
|
||||||
.rightlist
|
.rightlist
|
||||||
=# f.select :visibility, Project::VISIBILITIES
|
=# f.select :visibility, Project::VISIBILITIES
|
||||||
- Project::VISIBILITIES.each do |visibility|
|
- Project::VISIBILITIES.each do |visibility|
|
||||||
|
@ -35,12 +35,19 @@
|
||||||
\
|
\
|
||||||
.rightlist
|
.rightlist
|
||||||
.check
|
.check
|
||||||
%span#niceCheckbox1.niceCheck-main= f.check_box :is_package#, :class => 'niceCheckbox1'
|
%span#niceCheckbox1.niceCheck-main= f.check_box :is_package
|
||||||
.forcheck= t("activerecord.attributes.project.is_package")
|
.forcheck= f.label :is_package
|
||||||
.both
|
.both
|
||||||
|
- unless [:new, :create].include? act
|
||||||
|
#publish_form{:class => @project.publish_i686_into_x86_64 ? '' : 'hidden'}
|
||||||
|
.check
|
||||||
|
%span.niceCheck-main= f.check_box :publish_i686_into_x86_64
|
||||||
|
.forcheck= f.label :publish_i686_into_x86_64
|
||||||
|
.both
|
||||||
|
|
||||||
.both
|
.both
|
||||||
- if [:edit, :update].include? act
|
- if [:edit, :update].include? act
|
||||||
.leftlist= t("activerecord.attributes.project.default_branch")
|
.leftlist= f.label :default_branch
|
||||||
.rightlist
|
.rightlist
|
||||||
= f.select :default_branch,
|
= f.select :default_branch,
|
||||||
options_from_collection_for_select( @project.repo.branches,
|
options_from_collection_for_select( @project.repo.branches,
|
||||||
|
@ -50,7 +57,7 @@
|
||||||
#maintainer_form{:class => @project.is_package ? '' : 'hidden'}
|
#maintainer_form{:class => @project.is_package ? '' : 'hidden'}
|
||||||
= f.hidden_field :maintainer_id, :value => @project.maintainer_id
|
= f.hidden_field :maintainer_id, :value => @project.maintainer_id
|
||||||
.leftlist
|
.leftlist
|
||||||
= t("activerecord.attributes.project.maintainer")
|
= f.label :maintainer
|
||||||
.rightlist
|
.rightlist
|
||||||
-# TODO: Maybe use something like Chosen with filter and prepopulated
|
-# TODO: Maybe use something like Chosen with filter and prepopulated
|
||||||
-# list of potential maintainers?
|
-# list of potential maintainers?
|
||||||
|
@ -59,7 +66,7 @@
|
||||||
:id_element => '#project_maintainer_id',
|
:id_element => '#project_maintainer_id',
|
||||||
:placeholder => @project.maintainer.fullname
|
:placeholder => @project.maintainer.fullname
|
||||||
- if [:new, :create].include? act
|
- if [:new, :create].include? act
|
||||||
.leftlist= f.label :srpm, t("activerecord.attributes.project.srpm"), :class => :label
|
.leftlist= f.label :srpm
|
||||||
.rightlist= f.file_field :srpm, :class => 'file_field'
|
.rightlist= f.file_field :srpm, :class => 'file_field'
|
||||||
.both
|
.both
|
||||||
.leftlist
|
.leftlist
|
||||||
|
|
|
@ -94,6 +94,7 @@ en:
|
||||||
group: Group
|
group: Group
|
||||||
default_branch: Default branch
|
default_branch: Default branch
|
||||||
is_package: Project is a package
|
is_package: Project is a package
|
||||||
|
publish_i686_into_x86_64: Publish i686 packages into x86_64 repository (only for rhel)
|
||||||
maintainer: Maintainer of project
|
maintainer: Maintainer of project
|
||||||
maintainer_id: Maintainer of project
|
maintainer_id: Maintainer of project
|
||||||
errors:
|
errors:
|
||||||
|
|
|
@ -94,6 +94,7 @@ ru:
|
||||||
group: Группа
|
group: Группа
|
||||||
default_branch: Ветка по умолчанию
|
default_branch: Ветка по умолчанию
|
||||||
is_package: Проект является пакетом
|
is_package: Проект является пакетом
|
||||||
|
publish_i686_into_x86_64: Публиковать i686 пакеты в x86_64 репозиторий (только для rhel)
|
||||||
maintainer_id: Майнтейнер проекта
|
maintainer_id: Майнтейнер проекта
|
||||||
maintainer: Майнтейнер проекта
|
maintainer: Майнтейнер проекта
|
||||||
errors:
|
errors:
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddPublishi686IntoX8664ToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :publish_i686_into_x86_64, :boolean, :default => false
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20130201094007) do
|
ActiveRecord::Schema.define(:version => 20130207101148) do
|
||||||
|
|
||||||
create_table "activity_feeds", :force => true do |t|
|
create_table "activity_feeds", :force => true do |t|
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
|
@ -368,6 +368,7 @@ ActiveRecord::Schema.define(:version => 20130201094007) do
|
||||||
t.integer "average_build_time", :default => 0, :null => false
|
t.integer "average_build_time", :default => 0, :null => false
|
||||||
t.integer "build_count", :default => 0, :null => false
|
t.integer "build_count", :default => 0, :null => false
|
||||||
t.integer "maintainer_id"
|
t.integer "maintainer_id"
|
||||||
|
t.boolean "publish_i686_into_x86_64", :default => false
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "projects", ["owner_id", "name", "owner_type"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
|
add_index "projects", ["owner_id", "name", "owner_type"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
|
||||||
|
|
|
@ -268,7 +268,14 @@ module AbfWorker
|
||||||
|
|
||||||
def fill_packages(bl, results_map, field = :sha1)
|
def fill_packages(bl, results_map, field = :sha1)
|
||||||
results_map[:sources] |= bl.packages.by_package_type('source').pluck(field).compact if field != :sha1
|
results_map[:sources] |= bl.packages.by_package_type('source').pluck(field).compact if field != :sha1
|
||||||
results_map[:binaries][bl.arch.name.to_sym] |= bl.packages.by_package_type('binary').pluck(field).compact
|
|
||||||
|
binaries = bl.packages.by_package_type('binary').pluck(field).compact
|
||||||
|
arch = bl.arch.name.to_sym
|
||||||
|
results_map[:binaries][arch] |= binaries
|
||||||
|
# Publish/remove i686 RHEL packages into/from x86_64
|
||||||
|
if arch == :i586 && bl.build_for_platform.distrib_type == 'rhel' && bl.project.publish_i686_into_x86_64?
|
||||||
|
results_map[:binaries][:x86_64] |= binaries
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue