From 49ea066e25dfc8bf861fd73ebda390f0a2cf341c Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Sat, 5 Sep 2020 18:36:12 +0800 Subject: [PATCH 1/3] fix build fail --- rubygem-railties.spec | 12 +-- rubygem-railties.spec~ | 159 ++++++++++++++++++++++++++++++++++++++ spec_prep_plus.sh | 168 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 334 insertions(+), 5 deletions(-) create mode 100644 rubygem-railties.spec~ create mode 100755 spec_prep_plus.sh diff --git a/rubygem-railties.spec b/rubygem-railties.spec index 67c11c5..fe1b8de 100644 --- a/rubygem-railties.spec +++ b/rubygem-railties.spec @@ -1,17 +1,14 @@ -%global gem_name railties +%bcond_with test %{?_with_bootstrap: %global bootstrap 1} %global bootstrap 1 Name: rubygem-%{gem_name} Version: 5.2.3 -Release: 1 +Release: 2 Summary: Tools for creating, working with, and running Rails applications License: MIT URL: http://rubyonrails.org Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz -# Check value of result.source_location in -# test_unit/reporter.rb#format_rerun_snippet -# https://github.com/rails/rails/pull/32297 Patch0: rubygem-railties-5.1.5-check-value-of-result-source-location.patch Suggests: %{_bindir}/sqlite3 BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(actioncable) = %{version} @@ -57,6 +54,7 @@ cp -p .%{_bindir}/* \ %{buildroot}%{_bindir}/ find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x +%if %{with test} %check ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport @@ -137,6 +135,7 @@ find test -type f -name '*_test.rb' -print0 | \ sort -z | \ xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255" popd +%endif %files %dir %{gem_instdir} @@ -154,5 +153,8 @@ popd %doc %{gem_instdir}/README.rdoc %changelog +* Sat Sep 5 2020 liyanan - 5.2.3-2 +- fix build fail + * Tue Aug 18 2020 huangyangke - 5.2.3-1 - package init diff --git a/rubygem-railties.spec~ b/rubygem-railties.spec~ new file mode 100644 index 0000000..9351630 --- /dev/null +++ b/rubygem-railties.spec~ @@ -0,0 +1,159 @@ +%bcond_with bootstrap +%global gem_name railties +%{?_with_bootstrap: %global bootstrap 1} +%global bootstrap 1 +Name: rubygem-%{gem_name} +Version: 5.2.3 +Release: 1 +Summary: Tools for creating, working with, and running Rails applications +License: MIT +URL: http://rubyonrails.org +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz +# Check value of result.source_location in +# test_unit/reporter.rb#format_rerun_snippet +# https://github.com/rails/rails/pull/32297 +Patch0: rubygem-railties-5.1.5-check-value-of-result-source-location.patch +Suggests: %{_bindir}/sqlite3 +BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(actioncable) = %{version} +BuildRequires: rubygem(actionmailer) = %{version} rubygem(actionpack) = %{version} +BuildRequires: rubygem(activerecord) = %{version} rubygem(activesupport) = %{version} +BuildRequires: rubygem(activestorage) = %{version} rubygem(bundler) rubygem(method_source) +BuildRequires: rubygem(rake) >= 0.8.7 rubygem(rack-cache) rubygem(sqlite3) rubygem(puma) +BuildRequires: rubygem(bootsnap) rubygem(capybara) sqlite rubygem(sprockets-rails) +BuildRequires: rubygem(thor) >= 0.18.1 rubygem(turbolinks) git +%if ! 0%{?bootstrap} +BuildRequires: rubygem(jquery-rails) rubygem(uglifier) rubygem(rails) %{_bindir}/node +%endif +BuildArch: noarch +%description +Rails internals: application bootup, plugins, generators, and rake tasks. +Railties is responsible to glue all frameworks together. Overall, it: +* handles all the bootstrapping process for a Rails application; +* manages rails command line interface; +* provides Rails generators core; + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +%description doc +Documentation for %{name}. + +%prep +%setup -q -c -T +%gem_install -n %{SOURCE0} +pushd .%{gem_instdir} +%patch0 -p2 +popd + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ +mkdir -p %{buildroot}%{_bindir} +cp -p .%{_bindir}/* \ + %{buildroot}%{_bindir}/ +find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x + +%check +ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec +ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport +ln -s %{gem_dir}/gems/activestorage-%{version}/ .%{gem_dir}/gems/activestorage +ln -s %{gem_dir}/gems/actionmailer-%{version}/ .%{gem_dir}/gems/actionmailer +ln -s %{gem_dir}/gems/activerecord-%{version}/ .%{gem_dir}/gems/activerecord +ln -s %{gem_dir}/gems/actionview-%{version}/ .%{gem_dir}/gems/actionview +ln -s %{gem_dir}/gems/actioncable-%{version}/ .%{gem_dir}/gems/actioncable +ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties +pushd .%{gem_dir}/gems/railties +tar xzf %{SOURCE1} +ln -s rails-%{version}/railties/test test +echo '%{version}' > ../RAILS_VERSION +touch ../Gemfile +echo 'gem "actioncable"' >> ../Gemfile +echo 'gem "actionmailer"' >> ../Gemfile +echo 'gem "actionpack"' >> ../Gemfile +echo 'gem "activerecord"' >> ../Gemfile +echo 'gem "activesupport"' >> ../Gemfile +echo 'gem "activestorage"' >> ../Gemfile +echo 'gem "method_source"' >> ../Gemfile +echo 'gem "rack-test"' >> ../Gemfile +echo 'gem "rack-cache"' >> ../Gemfile +echo 'gem "rake"' >> ../Gemfile +echo 'gem "rdoc"' >> ../Gemfile +echo 'gem "sqlite3"' >> ../Gemfile +echo 'gem "thor"' >> ../Gemfile +echo 'gem "turbolinks"' >> ../Gemfile +echo 'gem "sprockets-rails"' >> ../Gemfile +echo 'gem "puma"' >> ../Gemfile +echo 'gem "bootsnap"' >> ../Gemfile +echo 'gem "capybara"' >> ../Gemfile +echo 'gem "irb"' >> ../Gemfile +%if ! 0%{?bootstrap} +echo 'gem "jquery-rails"' >> ../Gemfile +echo 'gem "rails"' >> ../Gemfile +echo 'gem "uglifier", require: false' >> ../Gemfile +%else +mv test/application/assets_test.rb{,.disable} +mv test/application/asset_debugging_test.rb{,.disable} +sed -i '/def test_scaffold_.*tests_pass_by_default$/,/^ end$/ s/^/#/' test/application/rake_test.rb +sed -i '/def test_rake_routes_with_rake_options$/,/^ end$/ s/^/#/' test/application/rake_test.rb +sed -i '/def test_rails_routes_displays_message_when_no_routes_are_defined$/,/^ end$/ s/^/#/' test/application/rake_test.rb +sed -i '/def test_rails_routes_calls_the_route_inspector$/,/^ end$/ s/^/#/' test/application/rake_test.rb +sed -i '/def test_generated_controller_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb +sed -i '/def test_generated_scaffold_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb +mv test/application/bin_setup_test.rb{,.disable} +mv test/test_unit/reporter_test.rb{,.disable} +mv test/application/configuration/custom_test.rb{,.disable} +sed -i '/def test_generation_runs_bundle_install_with_full_and_mountable$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb +sed -i '/def test_generate_application_.*_when_does_not_exist_in_mountable_engine$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb +sed -i '/def test_controller_tests_pass_by_default_inside_mountable_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb +sed -i '/def test_controller_tests_pass_by_default_inside_full_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb +sed -i '/def test_application_new_exits_with_message_and_non_zero_code_when_generating_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb +sed -i '/def test_application_new_show_help_message_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb +%endif +sed -i '/^ def test_sqlite3_db_without_defined_rails_root$/,/^ end$/ s/^/#/' test/commands/dbconsole_test.rb +sed -i '/test "database middleware doesn.t initialize when activerecord is not in frameworks" do$/,/^ end$/ s/^/#/' \ + test/application/initializers/frameworks_test.rb +sed -i '/test "i18n files have lower priority than application ones" do$/,/^ end$/ s/^/#/' \ + test/railties/engine_test.rb +sed -i '/def test_system_tests_are_run_through_rake_test_when_given_in_TEST$/,/^ end$/ s/^/#/' \ + test/application/test_runner_test.rb +sed -i '/def test_reset_sessions_before_rollback_on_system_tests$/,/^ end$/ s/^/#/' \ + test/application/test_runner_test.rb +sed -i '/def test_output_inline_by_default$/,/^ end$/ s/^/#/' \ + test/generators/plugin_test_runner_test.rb +mv test/application/rake/dbs_test.rb{,.disable} +mv test/commands/dbconsole_test.rb{,.disable} +sed -i '/^ def test_new_application_load_defaults$/,/^ end$/ s/^/#/' \ + test/generators/app_generator_test.rb +sed -i 's/^\(\s*secrets\.secret_\)token/\1key_base/' \ + test/path_generation_test.rb +export RUBYOPT="-I${PWD}/../railties/lib" +export PATH="${PWD}/../railties/exe:$PATH" +export BUNDLE_GEMFILE=${PWD}/../Gemfile +find test -type f -name '*_test.rb' -print0 | \ + sort -z | \ + xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255" +popd + +%files +%dir %{gem_instdir} +%{_bindir}/rails +%license %{gem_instdir}/MIT-LICENSE +%{gem_instdir}/exe +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/CHANGELOG.md +%doc %{gem_instdir}/RDOC_MAIN.rdoc +%doc %{gem_instdir}/README.rdoc + +%changelog +* Tue Aug 18 2020 huangyangke - 5.2.3-1 +- package init diff --git a/spec_prep_plus.sh b/spec_prep_plus.sh new file mode 100755 index 0000000..473cec6 --- /dev/null +++ b/spec_prep_plus.sh @@ -0,0 +1,168 @@ +changelog_update(){ +# changelog replace +sed -i '/^%changelog/,$d' $file +date=`date +"%a %b %_d %Y"` +name='liyanan' +email='liyanan32@huawei.com' +changelog="%changelog\n* $date $name <$email> - ${version}-$release\n- fix build fail" +echo -e $changelog >> $file #sed -n '/^%changelog/,$p' $file +echo "Hint: changelog updated" +} + + +single_merge(){ +awk -v key="$1" -v max_len=80 -F : \ +'BEGIN {\ +tmp="";\ +} \ +{\ + if( key == $1 ){\ + if( NF > 2){\ + oofs=FS;FS="#"; + bbb=sub(/[[:alnum:] ]+:/,"",$0);\ + aaa=$bbb; + FS=oofs; + }\ + else{\ + $1=""; \ + aaa=$0;\ + }\ + + tmp1=tmp aaa + gsub(" +"," ",tmp1);\ + #print FNR tmp1 + if(length(tmp1) > max_len){\ + gsub(" +"," ",tmp);\ + printf "%-20s%s\n",key ":",tmp;\ + tmp="";\ + }\ + tmp=tmp aaa;\ + }\ + else {\ + if( length(tmp) != 0){\ + gsub(" +"," ",tmp);\ + printf "%-20s%s\n",key ":",tmp;\ + tmp="";\ + }\ + print $0;\ + }\ + +}' +} + +headers_merge(){ + cat $file | single_merge "BuildRequires" | single_merge "Requires" > .$file + mv -f .$file $file + echo "Hint: Tags merged" +} + +delete_comment(){ + sed -i '/^#.*/d' $file + echo "Hint: commentline deleted" +} +delete_blank(){ + sed -i 's/[[:blank:]]\{1,\}$//g' $file + echo "Hint: tail-blank deleted " +} + +insert_enter(){ + sed -i '/^$/d' $file + sed -i '/^%package.*/i\ ' $file + sed -i '/^%pre.*/i\ ' $file + sed -i '/^%post.*/i\ ' $file + sed -i '/^%build.*/i\ ' $file + sed -i '/^%install.*/i\ ' $file + sed -i '/^%check*/i\ ' $file + sed -i '/^%files.*/i\ ' $file + sed -i '/^%changelog.*/i\ ' $file + echo "Hint: insert newline before stages" +} + +increase_release(){ + # release +1 + sed -i "/^Release.*$/s/${release_oo}/${release}/" $file + # delete Group Tags + sed -i '/^Group.*/d' $file + echo "Hint: release ++" +} + +header_align() { +awk '{ +if ($0 ~ /^[A-Z][[:alnum:]]*: / ) { +va=""; +for(i=2;i<=NF;i++){ va=va" "$i}; +printf("%-20s%s\n",$1,va); +} +else print $0; +}' $file > .$file +mv -f .$file $file +echo "Hint: header_align done" +} + +#################### main +main(){ + +file_o=$1 +file=${file_o}.cp +sed -i 's/\t/ /g' $1 +#sed -i 's/%package\s\+javadoc$/%package help/g' $1 +#sed -i '/%description\s\+javadoc$/i\Provides: %{name}-javadoc = %{version}-%{release}' $1 +#sed -i '/%description\s\+javadoc$/i\Obsoletes: %{name}-javadoc < %{version}-%{release}' $1 +#sed -i 's/%description\s\+javadoc$/%description help/g' $1 +#sed -i 's/%files\s\+javadoc/%files help/g' $1 +#sed -i 's/%package\s\+doc$/%package help/g' $1 +#sed -i '/%description\s\+doc$/i\Provides: %{name}-doc = %{version}-%{release}' $1 +#sed -i '/%description\s\+doc$/i\Obsoletes: %{name}-doc < %{version}-%{release}' $1 +#sed -i 's/%description\s\+doc$/%description help/g' $1 +#sed -i 's/%files\s\+doc$/%files help/g' $1 +#echo 'mv javadoc or doc to help succeed!!!!!!!' +sed -i "1i %bcond_with bootstrap" $1 +sed -i "%check/i\'%if %{with bootstrap}'" $1 + + +cp -f $file_o $file + +# got verison release +version=`cat $file |grep '^Version' | awk '{print $2}'` +release_oo=`cat $file |grep '^Release' | awk '{print $2}'` +release_o=`echo $release_oo | sed 's/%{.*}//'` +release=$((release_o+1)) +release=1 + +#marcos_expand keep this bug ... +delete_comment +changelog_update +increase_release +header_align +headers_merge +insert_enter +delete_blank + +#let's play +#read -p "Hint: exec vimdiff $file $file_o ? enter [yes/no]: " ans +#vimdiff $file $file_o +#read -p "Hint: do mv -b -f $file $file_o ? enter [yes/no]: " ans +#if [[ $ans =~ [Yy]([Ee][Ss])? ]];then + mv -b -f $file $file_o + echo "Hint: $file_o updated" +#else +# rm -f $file +# echo "Hint: $file deleted. Not my bad :P " +#fi +echo "From SONG: Enjoy your spec working !" +} + +banner(){ +cat < Date: Sat, 5 Sep 2020 18:36:26 +0800 Subject: [PATCH 2/3] fix build fail --- rubygem-railties.spec~ | 159 -------------------------------------- spec_prep_plus.sh | 168 ----------------------------------------- 2 files changed, 327 deletions(-) delete mode 100644 rubygem-railties.spec~ delete mode 100755 spec_prep_plus.sh diff --git a/rubygem-railties.spec~ b/rubygem-railties.spec~ deleted file mode 100644 index 9351630..0000000 --- a/rubygem-railties.spec~ +++ /dev/null @@ -1,159 +0,0 @@ -%bcond_with bootstrap -%global gem_name railties -%{?_with_bootstrap: %global bootstrap 1} -%global bootstrap 1 -Name: rubygem-%{gem_name} -Version: 5.2.3 -Release: 1 -Summary: Tools for creating, working with, and running Rails applications -License: MIT -URL: http://rubyonrails.org -Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem -Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz -# Check value of result.source_location in -# test_unit/reporter.rb#format_rerun_snippet -# https://github.com/rails/rails/pull/32297 -Patch0: rubygem-railties-5.1.5-check-value-of-result-source-location.patch -Suggests: %{_bindir}/sqlite3 -BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(actioncable) = %{version} -BuildRequires: rubygem(actionmailer) = %{version} rubygem(actionpack) = %{version} -BuildRequires: rubygem(activerecord) = %{version} rubygem(activesupport) = %{version} -BuildRequires: rubygem(activestorage) = %{version} rubygem(bundler) rubygem(method_source) -BuildRequires: rubygem(rake) >= 0.8.7 rubygem(rack-cache) rubygem(sqlite3) rubygem(puma) -BuildRequires: rubygem(bootsnap) rubygem(capybara) sqlite rubygem(sprockets-rails) -BuildRequires: rubygem(thor) >= 0.18.1 rubygem(turbolinks) git -%if ! 0%{?bootstrap} -BuildRequires: rubygem(jquery-rails) rubygem(uglifier) rubygem(rails) %{_bindir}/node -%endif -BuildArch: noarch -%description -Rails internals: application bootup, plugins, generators, and rake tasks. -Railties is responsible to glue all frameworks together. Overall, it: -* handles all the bootstrapping process for a Rails application; -* manages rails command line interface; -* provides Rails generators core; - -%package doc -Summary: Documentation for %{name} -Requires: %{name} = %{version}-%{release} -BuildArch: noarch -%description doc -Documentation for %{name}. - -%prep -%setup -q -c -T -%gem_install -n %{SOURCE0} -pushd .%{gem_instdir} -%patch0 -p2 -popd - -%build - -%install -mkdir -p %{buildroot}%{gem_dir} -cp -a .%{gem_dir}/* \ - %{buildroot}%{gem_dir}/ -mkdir -p %{buildroot}%{_bindir} -cp -p .%{_bindir}/* \ - %{buildroot}%{_bindir}/ -find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x - -%check -ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec -ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport -ln -s %{gem_dir}/gems/activestorage-%{version}/ .%{gem_dir}/gems/activestorage -ln -s %{gem_dir}/gems/actionmailer-%{version}/ .%{gem_dir}/gems/actionmailer -ln -s %{gem_dir}/gems/activerecord-%{version}/ .%{gem_dir}/gems/activerecord -ln -s %{gem_dir}/gems/actionview-%{version}/ .%{gem_dir}/gems/actionview -ln -s %{gem_dir}/gems/actioncable-%{version}/ .%{gem_dir}/gems/actioncable -ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties -pushd .%{gem_dir}/gems/railties -tar xzf %{SOURCE1} -ln -s rails-%{version}/railties/test test -echo '%{version}' > ../RAILS_VERSION -touch ../Gemfile -echo 'gem "actioncable"' >> ../Gemfile -echo 'gem "actionmailer"' >> ../Gemfile -echo 'gem "actionpack"' >> ../Gemfile -echo 'gem "activerecord"' >> ../Gemfile -echo 'gem "activesupport"' >> ../Gemfile -echo 'gem "activestorage"' >> ../Gemfile -echo 'gem "method_source"' >> ../Gemfile -echo 'gem "rack-test"' >> ../Gemfile -echo 'gem "rack-cache"' >> ../Gemfile -echo 'gem "rake"' >> ../Gemfile -echo 'gem "rdoc"' >> ../Gemfile -echo 'gem "sqlite3"' >> ../Gemfile -echo 'gem "thor"' >> ../Gemfile -echo 'gem "turbolinks"' >> ../Gemfile -echo 'gem "sprockets-rails"' >> ../Gemfile -echo 'gem "puma"' >> ../Gemfile -echo 'gem "bootsnap"' >> ../Gemfile -echo 'gem "capybara"' >> ../Gemfile -echo 'gem "irb"' >> ../Gemfile -%if ! 0%{?bootstrap} -echo 'gem "jquery-rails"' >> ../Gemfile -echo 'gem "rails"' >> ../Gemfile -echo 'gem "uglifier", require: false' >> ../Gemfile -%else -mv test/application/assets_test.rb{,.disable} -mv test/application/asset_debugging_test.rb{,.disable} -sed -i '/def test_scaffold_.*tests_pass_by_default$/,/^ end$/ s/^/#/' test/application/rake_test.rb -sed -i '/def test_rake_routes_with_rake_options$/,/^ end$/ s/^/#/' test/application/rake_test.rb -sed -i '/def test_rails_routes_displays_message_when_no_routes_are_defined$/,/^ end$/ s/^/#/' test/application/rake_test.rb -sed -i '/def test_rails_routes_calls_the_route_inspector$/,/^ end$/ s/^/#/' test/application/rake_test.rb -sed -i '/def test_generated_controller_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb -sed -i '/def test_generated_scaffold_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb -mv test/application/bin_setup_test.rb{,.disable} -mv test/test_unit/reporter_test.rb{,.disable} -mv test/application/configuration/custom_test.rb{,.disable} -sed -i '/def test_generation_runs_bundle_install_with_full_and_mountable$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb -sed -i '/def test_generate_application_.*_when_does_not_exist_in_mountable_engine$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb -sed -i '/def test_controller_tests_pass_by_default_inside_mountable_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb -sed -i '/def test_controller_tests_pass_by_default_inside_full_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb -sed -i '/def test_application_new_exits_with_message_and_non_zero_code_when_generating_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb -sed -i '/def test_application_new_show_help_message_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb -%endif -sed -i '/^ def test_sqlite3_db_without_defined_rails_root$/,/^ end$/ s/^/#/' test/commands/dbconsole_test.rb -sed -i '/test "database middleware doesn.t initialize when activerecord is not in frameworks" do$/,/^ end$/ s/^/#/' \ - test/application/initializers/frameworks_test.rb -sed -i '/test "i18n files have lower priority than application ones" do$/,/^ end$/ s/^/#/' \ - test/railties/engine_test.rb -sed -i '/def test_system_tests_are_run_through_rake_test_when_given_in_TEST$/,/^ end$/ s/^/#/' \ - test/application/test_runner_test.rb -sed -i '/def test_reset_sessions_before_rollback_on_system_tests$/,/^ end$/ s/^/#/' \ - test/application/test_runner_test.rb -sed -i '/def test_output_inline_by_default$/,/^ end$/ s/^/#/' \ - test/generators/plugin_test_runner_test.rb -mv test/application/rake/dbs_test.rb{,.disable} -mv test/commands/dbconsole_test.rb{,.disable} -sed -i '/^ def test_new_application_load_defaults$/,/^ end$/ s/^/#/' \ - test/generators/app_generator_test.rb -sed -i 's/^\(\s*secrets\.secret_\)token/\1key_base/' \ - test/path_generation_test.rb -export RUBYOPT="-I${PWD}/../railties/lib" -export PATH="${PWD}/../railties/exe:$PATH" -export BUNDLE_GEMFILE=${PWD}/../Gemfile -find test -type f -name '*_test.rb' -print0 | \ - sort -z | \ - xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255" -popd - -%files -%dir %{gem_instdir} -%{_bindir}/rails -%license %{gem_instdir}/MIT-LICENSE -%{gem_instdir}/exe -%{gem_libdir} -%exclude %{gem_cache} -%{gem_spec} - -%files doc -%doc %{gem_docdir} -%doc %{gem_instdir}/CHANGELOG.md -%doc %{gem_instdir}/RDOC_MAIN.rdoc -%doc %{gem_instdir}/README.rdoc - -%changelog -* Tue Aug 18 2020 huangyangke - 5.2.3-1 -- package init diff --git a/spec_prep_plus.sh b/spec_prep_plus.sh deleted file mode 100755 index 473cec6..0000000 --- a/spec_prep_plus.sh +++ /dev/null @@ -1,168 +0,0 @@ -changelog_update(){ -# changelog replace -sed -i '/^%changelog/,$d' $file -date=`date +"%a %b %_d %Y"` -name='liyanan' -email='liyanan32@huawei.com' -changelog="%changelog\n* $date $name <$email> - ${version}-$release\n- fix build fail" -echo -e $changelog >> $file #sed -n '/^%changelog/,$p' $file -echo "Hint: changelog updated" -} - - -single_merge(){ -awk -v key="$1" -v max_len=80 -F : \ -'BEGIN {\ -tmp="";\ -} \ -{\ - if( key == $1 ){\ - if( NF > 2){\ - oofs=FS;FS="#"; - bbb=sub(/[[:alnum:] ]+:/,"",$0);\ - aaa=$bbb; - FS=oofs; - }\ - else{\ - $1=""; \ - aaa=$0;\ - }\ - - tmp1=tmp aaa - gsub(" +"," ",tmp1);\ - #print FNR tmp1 - if(length(tmp1) > max_len){\ - gsub(" +"," ",tmp);\ - printf "%-20s%s\n",key ":",tmp;\ - tmp="";\ - }\ - tmp=tmp aaa;\ - }\ - else {\ - if( length(tmp) != 0){\ - gsub(" +"," ",tmp);\ - printf "%-20s%s\n",key ":",tmp;\ - tmp="";\ - }\ - print $0;\ - }\ - -}' -} - -headers_merge(){ - cat $file | single_merge "BuildRequires" | single_merge "Requires" > .$file - mv -f .$file $file - echo "Hint: Tags merged" -} - -delete_comment(){ - sed -i '/^#.*/d' $file - echo "Hint: commentline deleted" -} -delete_blank(){ - sed -i 's/[[:blank:]]\{1,\}$//g' $file - echo "Hint: tail-blank deleted " -} - -insert_enter(){ - sed -i '/^$/d' $file - sed -i '/^%package.*/i\ ' $file - sed -i '/^%pre.*/i\ ' $file - sed -i '/^%post.*/i\ ' $file - sed -i '/^%build.*/i\ ' $file - sed -i '/^%install.*/i\ ' $file - sed -i '/^%check*/i\ ' $file - sed -i '/^%files.*/i\ ' $file - sed -i '/^%changelog.*/i\ ' $file - echo "Hint: insert newline before stages" -} - -increase_release(){ - # release +1 - sed -i "/^Release.*$/s/${release_oo}/${release}/" $file - # delete Group Tags - sed -i '/^Group.*/d' $file - echo "Hint: release ++" -} - -header_align() { -awk '{ -if ($0 ~ /^[A-Z][[:alnum:]]*: / ) { -va=""; -for(i=2;i<=NF;i++){ va=va" "$i}; -printf("%-20s%s\n",$1,va); -} -else print $0; -}' $file > .$file -mv -f .$file $file -echo "Hint: header_align done" -} - -#################### main -main(){ - -file_o=$1 -file=${file_o}.cp -sed -i 's/\t/ /g' $1 -#sed -i 's/%package\s\+javadoc$/%package help/g' $1 -#sed -i '/%description\s\+javadoc$/i\Provides: %{name}-javadoc = %{version}-%{release}' $1 -#sed -i '/%description\s\+javadoc$/i\Obsoletes: %{name}-javadoc < %{version}-%{release}' $1 -#sed -i 's/%description\s\+javadoc$/%description help/g' $1 -#sed -i 's/%files\s\+javadoc/%files help/g' $1 -#sed -i 's/%package\s\+doc$/%package help/g' $1 -#sed -i '/%description\s\+doc$/i\Provides: %{name}-doc = %{version}-%{release}' $1 -#sed -i '/%description\s\+doc$/i\Obsoletes: %{name}-doc < %{version}-%{release}' $1 -#sed -i 's/%description\s\+doc$/%description help/g' $1 -#sed -i 's/%files\s\+doc$/%files help/g' $1 -#echo 'mv javadoc or doc to help succeed!!!!!!!' -sed -i "1i %bcond_with bootstrap" $1 -sed -i "%check/i\'%if %{with bootstrap}'" $1 - - -cp -f $file_o $file - -# got verison release -version=`cat $file |grep '^Version' | awk '{print $2}'` -release_oo=`cat $file |grep '^Release' | awk '{print $2}'` -release_o=`echo $release_oo | sed 's/%{.*}//'` -release=$((release_o+1)) -release=1 - -#marcos_expand keep this bug ... -delete_comment -changelog_update -increase_release -header_align -headers_merge -insert_enter -delete_blank - -#let's play -#read -p "Hint: exec vimdiff $file $file_o ? enter [yes/no]: " ans -#vimdiff $file $file_o -#read -p "Hint: do mv -b -f $file $file_o ? enter [yes/no]: " ans -#if [[ $ans =~ [Yy]([Ee][Ss])? ]];then - mv -b -f $file $file_o - echo "Hint: $file_o updated" -#else -# rm -f $file -# echo "Hint: $file deleted. Not my bad :P " -#fi -echo "From SONG: Enjoy your spec working !" -} - -banner(){ -cat < Date: Sat, 5 Sep 2020 18:39:39 +0800 Subject: [PATCH 3/3] fix build fail --- rubygem-railties.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rubygem-railties.spec b/rubygem-railties.spec index fe1b8de..f25a817 100644 --- a/rubygem-railties.spec +++ b/rubygem-railties.spec @@ -1,3 +1,4 @@ +%global gem_name railties %bcond_with test %{?_with_bootstrap: %global bootstrap 1} %global bootstrap 1 @@ -9,6 +10,9 @@ License: MIT URL: http://rubyonrails.org Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz +# Check value of result.source_location in +# test_unit/reporter.rb#format_rerun_snippet +# https://github.com/rails/rails/pull/32297 Patch0: rubygem-railties-5.1.5-check-value-of-result-source-location.patch Suggests: %{_bindir}/sqlite3 BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(actioncable) = %{version} -- Gitee