Skip to content

Instantly share code, notes, and snippets.

@janus57
Created October 2, 2017 11:26
Show Gist options
  • Save janus57/806b4f0dfd5e10795e0009f50992eeb5 to your computer and use it in GitHub Desktop.
Save janus57/806b4f0dfd5e10795e0009f50992eeb5 to your computer and use it in GitHub Desktop.
Create a patch file for specific files (.css & .tpl) and save it under the same tree
#!/bin/bash
FOLDER_OLD="phpboost_5-0"
FOLDER_NEW="phpboost_5-1"
FOLDER_PATCHES="./patches"
mkdir -p ${FOLDER_PATCHES}
for newfile in `find $FOLDER_NEW -type f -name "*.css" -o -name "*.tpl"`
do
sufix=${newfile#${FOLDER_NEW}/}
oldfile="${FOLDER_OLD}/${sufix}"
if [ -f $oldfile ]; then
patchfile="${FOLDER_PATCHES}/$sufix.patch"
if [ "`diff $oldfile $newfile`" != "" ]; then
echo "Make patch ${patchfile}"
mkdir -p `dirname $patchfile` && diff -dupN "$oldfile" "$newfile" > "$patchfile"
fi
fi
done
Example of patches between PHPBoost 5.0 and 5.1
root@patcher:~# tree patches/
patches/
β”œβ”€β”€ articles
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ articles.css.patch
β”‚Β Β  β”œβ”€β”€ ArticlesDisplayArticlesController.tpl.patch
β”‚Β Β  β”œβ”€β”€ ArticlesDisplaySeveralArticlesController.tpl.patch
β”‚Β Β  └── ArticlesFormFieldSelectSources.tpl.patch
β”œβ”€β”€ BBCode
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ bbcode.css.patch
β”‚Β Β  └── bbcode_editor.tpl.patch
β”œβ”€β”€ calendar
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ CalendarAjaxEventsController.tpl.patch
β”‚Β Β  β”œβ”€β”€ calendar.css.patch
β”‚Β Β  └── CalendarDisplayEventController.tpl.patch
β”œβ”€β”€ connect
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ connect_mini.css.patch
β”‚Β Β  └── connect_mini.tpl.patch
β”œβ”€β”€ contact
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ ContactController.tpl.patch
β”‚Β Β  β”œβ”€β”€ contact.css.patch
β”‚Β Β  β”œβ”€β”€ ContactFormFieldObjectPossibleValues.tpl.patch
β”‚Β Β  └── ContactFormFieldRecipientsPossibleValues.tpl.patch
β”œβ”€β”€ database
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_database_management.tpl.patch
β”‚Β Β  └── admin_database_tools.tpl.patch
β”œβ”€β”€ download
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ download.css.patch
β”‚Β Β  β”œβ”€β”€ DownloadDisplayDownloadFileController.tpl.patch
β”‚Β Β  β”œβ”€β”€ DownloadDisplaySeveralDownloadFilesController.tpl.patch
β”‚Β Β  β”œβ”€β”€ download_mini.css.patch
β”‚Β Β  └── DownloadModuleMiniMenu.tpl.patch
β”œβ”€β”€ faq
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ faq.css.patch
β”‚Β Β  β”œβ”€β”€ FaqDisplaySeveralFaqQuestionsController.tpl.patch
β”‚Β Β  └── FaqModuleMiniMenu.tpl.patch
β”œβ”€β”€ forum
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_ranks_add.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_ranks.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_bottom.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum.css.patch
β”‚Β Β  β”œβ”€β”€ forum_edit_msg.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_forum.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_index.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_membermsg.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_moderation_panel.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_post.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_topic.tpl.patch
β”‚Β Β  β”œβ”€β”€ forum_top.tpl.patch
β”‚Β Β  └── forum_track.tpl.patch
β”œβ”€β”€ gallery
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_gallery_add.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_gallery_config.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_gallery_management.tpl.patch
β”‚Β Β  β”œβ”€β”€ gallery_add.tpl.patch
β”‚Β Β  β”œβ”€β”€ gallery_mini.tpl.patch
β”‚Β Β  └── gallery.tpl.patch
β”œβ”€β”€ install
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ install.css.patch
β”‚Β Β  β”œβ”€β”€ main.tpl.patch
β”‚Β Β  └── server-config.tpl.patch
β”œβ”€β”€ kernel
β”‚Β Β  └── lib
β”‚Β Β  └── css
β”‚Β Β  └── font-awesome
β”‚Β Β  └── css
β”‚Β Β  └── font-awesome.css.patch
β”œβ”€β”€ LangsSwitcher
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ langsswitcher.css.patch
β”‚Β Β  └── langswitcher.tpl.patch
β”œβ”€β”€ media
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ media_action.tpl.patch
β”‚Β Β  β”œβ”€β”€ media.css.patch
β”‚Β Β  └── media.tpl.patch
β”œβ”€β”€ news
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ news.css.patch
β”‚Β Β  β”œβ”€β”€ NewsDisplayNewsController.tpl.patch
β”‚Β Β  β”œβ”€β”€ NewsDisplaySeveralNewsController.tpl.patch
β”‚Β Β  └── NewsFormFieldSelectSources.tpl.patch
β”œβ”€β”€ newsletter
β”‚Β Β  └── templates
β”‚Β Β  └── newsletter_mini.css.patch
β”œβ”€β”€ online
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ OnlineHomeController.tpl.patch
β”‚Β Β  └── OnlineModuleMiniMenu.tpl.patch
β”œβ”€β”€ pages
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ action.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_pages.tpl.patch
β”‚Β Β  β”œβ”€β”€ explorer.tpl.patch
β”‚Β Β  β”œβ”€β”€ index.tpl.patch
β”‚Β Β  β”œβ”€β”€ pages.css.patch
β”‚Β Β  └── post.tpl.patch
β”œβ”€β”€ poll
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_poll_add.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_poll_config.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_poll_management2.tpl.patch
β”‚Β Β  β”œβ”€β”€ admin_poll_management.tpl.patch
β”‚Β Β  β”œβ”€β”€ poll.css.patch
β”‚Β Β  β”œβ”€β”€ poll_mini.tpl.patch
β”‚Β Β  └── poll.tpl.patch
β”œβ”€β”€ QuestionCaptcha
β”‚Β Β  └── templates
β”‚Β Β  └── QuestionCaptchaFormFieldQuestions.tpl.patch
β”œβ”€β”€ ReCaptcha
β”‚Β Β  └── templates
β”‚Β Β  └── ReCaptcha.tpl.patch
β”œβ”€β”€ search
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_search.tpl.patch
β”‚Β Β  β”œβ”€β”€ search.css.patch
β”‚Β Β  β”œβ”€β”€ search_forms.tpl.patch
β”‚Β Β  β”œβ”€β”€ search_mini.css.patch
β”‚Β Β  β”œβ”€β”€ search_mini.tpl.patch
β”‚Β Β  └── search_results.tpl.patch
β”œβ”€β”€ shoutbox
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ ShoutboxAjaxMessagesBoxController.tpl.patch
β”‚Β Β  β”œβ”€β”€ ShoutboxHomeController.tpl.patch
β”‚Β Β  β”œβ”€β”€ shoutbox_mini.css.patch
β”‚Β Β  └── ShoutboxModuleMiniMenu.tpl.patch
β”œβ”€β”€ sitemap
β”‚Β Β  └── templates
β”‚Β Β  └── export
β”‚Β Β  └── sitemap.xml.tpl.patch
β”œβ”€β”€ stats
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ admin_stats_management.tpl.patch
β”‚Β Β  β”œβ”€β”€ stats.css.patch
β”‚Β Β  β”œβ”€β”€ stats_mini.tpl.patch
β”‚Β Β  └── stats.tpl.patch
β”œβ”€β”€ templates
β”‚Β Β  β”œβ”€β”€ base
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ body.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ frame.tpl.patch
β”‚Β Β  β”‚Β Β  └── theme
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.css.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ cssmenu.css.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ design.css.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ form.css.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ global.css.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ login.css.patch
β”‚Β Β  β”‚Β Β  └── table.css.patch
β”‚Β Β  └── default
β”‚Β Β  β”œβ”€β”€ admin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ admin_files_management.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ admin_files_move.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ admin_groups_management2.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ admin_index.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ body.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ frame.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ langs
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ AdminLangsInstalledListController.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── AdminLangsNotInstalledListController.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ member
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── AdminExtendedFieldsMemberlistController.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ menus
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ links.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ menu_edition.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ menus.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── menu.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ modules
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ AdminModuleAddController.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ AdminModulesManagementController.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── AdminModuleUpdateController.tpl.patch
β”‚Β Β  β”‚Β Β  └── themes
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ AdminThemesInstalledListController.tpl.patch
β”‚Β Β  β”‚Β Β  └── AdminThemesNotInstalledListController.tpl.patch
β”‚Β Β  β”œβ”€β”€ framework
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ builder
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ form
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldActionLinkList.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldAuthorizationsSetter.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldCaptcha.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldCheckbox.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldDate.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldLabel.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldMultiLineTextEditor.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldMultipleAutocompleter.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldMultipleFilePicker.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldMultipleSelectChoice.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldPossibleValues.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldset.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormFieldShortMultiLineTextEditor.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ FormField.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  └── FormFieldUploadFile.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── table
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── HTMLTable.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ print.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── syndication
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ atom.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── rss.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ groups_auth.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ helper
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── message.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ menus
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ feed.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ links.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── modules_mini.tpl.patch
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ module
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ admin_module_actions_links_menu.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ module_actions_links_menu.tpl.patch
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── module_actions_link.tpl.patch
β”‚Β Β  β”‚Β Β  └── util
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ mini_calendar.tpl.patch
β”‚Β Β  β”‚Β Β  └── pagination.tpl.patch
β”‚Β Β  β”œβ”€β”€ js_bottom.tpl.patch
β”‚Β Β  β”œβ”€β”€ js_top.tpl.patch
β”‚Β Β  └── theme
β”‚Β Β  β”œβ”€β”€ admin_content.css.patch
β”‚Β Β  β”œβ”€β”€ admin_cssmenu.css.patch
β”‚Β Β  β”œβ”€β”€ admin_design.css.patch
β”‚Β Β  β”œβ”€β”€ admin_form.css.patch
β”‚Β Β  β”œβ”€β”€ admin_global.css.patch
β”‚Β Β  β”œβ”€β”€ admin_menus.css.patch
β”‚Β Β  β”œβ”€β”€ admin_table.css.patch
β”‚Β Β  └── default.css.patch
β”œβ”€β”€ ThemesSwitcher
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ themeswitcher.css.patch
β”‚Β Β  └── themeswitcher.tpl.patch
β”œβ”€β”€ TinyMCE
β”‚Β Β  └── templates
β”‚Β Β  └── tinymce_editor.tpl.patch
β”œβ”€β”€ user
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ moderation_panel.tpl.patch
β”‚Β Β  β”œβ”€β”€ pm.tpl.patch
β”‚Β Β  β”œβ”€β”€ upload_move.tpl.patch
β”‚Β Β  β”œβ”€β”€ upload.tpl.patch
β”‚Β Β  β”œβ”€β”€ UserExploreGroupsController.tpl.patch
β”‚Β Β  β”œβ”€β”€ UserHomeProfileController.tpl.patch
β”‚Β Β  └── UserUsersListController.tpl.patch
β”œβ”€β”€ web
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ web.css.patch
β”‚Β Β  β”œβ”€β”€ WebDisplaySeveralWebLinksController.tpl.patch
β”‚Β Β  β”œβ”€β”€ WebDisplayWebLinkController.tpl.patch
β”‚Β Β  β”œβ”€β”€ web_mini.css.patch
β”‚Β Β  └── WebModuleMiniMenu.tpl.patch
└── wiki
└── templates
β”œβ”€β”€ admin_wiki_groups.tpl.patch
β”œβ”€β”€ admin_wiki.tpl.patch
β”œβ”€β”€ explorer.tpl.patch
β”œβ”€β”€ index.tpl.patch
β”œβ”€β”€ post.tpl.patch
β”œβ”€β”€ property.tpl.patch
β”œβ”€β”€ wiki.css.patch
β”œβ”€β”€ wiki_js_tools.tpl.patch
└── wiki.tpl.patch
85 directories, 182 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment