Commit 4d259b30040eb3b92f60de72b76e61b6781b2a91

Authored by Athos
1 parent 7bdbfc12
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Noosfero: Apply new patch for backup task

Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com>
Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com>
patches/noosfero/0001-Fix-backup-task.patch 0 → 100644
... ... @@ -0,0 +1,52 @@
  1 +From 3b814b256441be6e0fc98cb1afa695c4f13d6849 Mon Sep 17 00:00:00 2001
  2 +From: Athos Ribeiro <athoscribeiro@gmail.com>
  3 +Date: Fri, 8 May 2015 15:13:40 -0300
  4 +Subject: [PATCH] Fix backup task
  5 +
  6 +- Adds host option to the postgres commands where necessary.
  7 +- Passes -h option to tar when compressing in order to follow symlinks.
  8 +
  9 +Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com>
  10 +Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com>
  11 +---
  12 + lib/tasks/backup.rake | 10 ++++++----
  13 + 1 file changed, 6 insertions(+), 4 deletions(-)
  14 +
  15 +diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake
  16 +index 7e64d17..14b2418 100644
  17 +--- a/lib/tasks/backup.rake
  18 ++++ b/lib/tasks/backup.rake
  19 +@@ -25,9 +25,10 @@ task :backup => :check_backup_support do
  20 + dump = File.join('tmp/backup', backup_name) + '.sql'
  21 +
  22 + database = $config['production']['database']
  23 +- sh "pg_dump #{database} > #{dump}"
  24 ++ host = $config['production']['host']
  25 ++ sh "pg_dump -h #{host} #{database} > #{dump}"
  26 +
  27 +- sh 'tar', 'caf', backup_file, dump, *dirs
  28 ++ sh 'tar', 'chaf', backup_file, dump, *dirs
  29 + rm_f dump
  30 +
  31 + puts "****************************************************"
  32 +@@ -81,14 +82,15 @@ task :restore => :check_backup_support do
  33 +
  34 + database = $config['production']['database']
  35 + username = $config['production']['username']
  36 ++ host = $config['production']['host']
  37 +
  38 + puts "WARNING: backups should be restored to an empty database, otherwise"
  39 + puts "data from the backup may not be loaded properly."
  40 + puts
  41 + puts 'You can remove the existing database and create a new one with:'
  42 + puts
  43 +- puts "$ sudo -u postgres dropdb #{database}"
  44 +- puts "$ sudo -u postgres createdb #{database} --owner #{username}"
  45 ++ puts "$ sudo -u postgres dropdb -h #{host} #{database}"
  46 ++ puts "$ sudo -u postgres createdb -h #{host} #{database} --owner #{username}"
  47 + puts
  48 + print "Are you sure you want to continue (y/N)? "
  49 + response = $stdin.gets.strip
  50 +--
  51 +2.1.0
  52 +
... ...
specs/noosfero/noosfero.spec
1 1 %define writable_dirs javascripts/cache stylesheets/cache articles image_uploads thumbnails
2 2  
3 3 Name: noosfero
4   -Version: 1.1~rc2.4
  4 +Version: 1.1~rc2.5
5 5 Release: 2%{?dist}
6 6 Summary: Social Networking Platform
7 7 Group: Applications/Publishing
... ... @@ -10,6 +10,7 @@ URL: http://noosfero.org
10 10 Source0: %{name}-%{version}.tar.gz
11 11 Patch0: 0001-Use-as-placeholder-for-current-user-in-URLs.patch
12 12 Patch1: 0001-Enhance-existing-backup-task-and-add-a-restore-one.patch
  13 +Patch2: 0001-Fix-backup-task.patch
13 14 BuildArch: noarch
14 15 BuildRequires: noosfero-deps, gettext, po4a
15 16 Requires: noosfero-deps, po4a, tango-icon-theme, memcached
... ... @@ -25,6 +26,7 @@ participate and contribute to this free software project!
25 26  
26 27 %patch0 -p1
27 28 %patch1 -p1
  29 +%patch2 -p1
28 30  
29 31 %build
30 32  
... ...