From 3b82840d88d69947beb759bd9d8442de754f97cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 26 Jul 2024 14:21:38 +0200 Subject: [PATCH] Fix patches for v3 --- .../patches/main-1-use-latest_uglify-js.patch | 34 +++++++++----- .../main-4-fix-missing-git-repository.patch | 47 ++++++++++++------- .../main-6-fix-download-calendar.patch | 20 ++++++-- 3 files changed, 69 insertions(+), 32 deletions(-) diff --git a/sources/patches/main-1-use-latest_uglify-js.patch b/sources/patches/main-1-use-latest_uglify-js.patch index 415ec9e..ad1af53 100644 --- a/sources/patches/main-1-use-latest_uglify-js.patch +++ b/sources/patches/main-1-use-latest_uglify-js.patch @@ -1,14 +1,26 @@ +From 0d5cfdaf5d1b65cff5b2c1bde026dbb9b3351d4f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= +Date: Fri, 26 Jul 2024 14:15:56 +0200 +Subject: [PATCH 1/3] Use latest uglify-js + +--- + lib/tasks/assets.rake | 3 +++ + 1 file changed, 3 insertions(+) + diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake -index 4a02d5f1b1..7b47f21658 100644 +index 96082977..ce59ce85 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake -@@ -126,6 +126,9 @@ - data = File.read("#{assets_path}/#{from}") - - uglified, map = Uglifier.new(comments: :none, -+ harmony: true, -+ mangle: false, -+ compress: false, - source_map: { - filename: File.basename(from), - output_filename: File.basename(to) +@@ -181,6 +181,9 @@ def compress_ruby(from, to) + uglified, map = + Uglifier.new( + comments: :none, ++ harmony: true, ++ mangle: false, ++ compress: false, + source_map: { + filename: File.basename(from), + output_filename: File.basename(to), +-- +2.45.2 + diff --git a/sources/patches/main-4-fix-missing-git-repository.patch b/sources/patches/main-4-fix-missing-git-repository.patch index a98afb6..6e117d0 100644 --- a/sources/patches/main-4-fix-missing-git-repository.patch +++ b/sources/patches/main-4-fix-missing-git-repository.patch @@ -1,22 +1,35 @@ +From 2319de5a4759f17c11a6000779d1c8840c342771 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= +Date: Fri, 26 Jul 2024 14:19:22 +0200 +Subject: [PATCH 2/3] Fix missing git commands in repository + +--- + lib/discourse.rb | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + diff --git a/lib/discourse.rb b/lib/discourse.rb -index 2b53a91eb3..eec55647d5 100644 +index 1af04378..6207c8f5 100644 --- a/lib/discourse.rb +++ b/lib/discourse.rb -@@ -439,7 +439,7 @@ module Discourse - def self.full_version - @full_version ||= begin - git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null' -- self.try_git(git_cmd, 'unknown') -+ self.try_git(git_cmd, Discourse::VERSION::STRING) - end +@@ -842,7 +842,7 @@ module Discourse + @full_version ||= + begin + git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null' +- self.try_git(git_cmd, "unknown") ++ self.try_git(git_cmd, Discourse::VERSION::STRING) + end end + +@@ -850,7 +850,8 @@ module Discourse + @last_commit_date ||= + begin + git_cmd = 'git log -1 --format="%ct"' +- seconds = self.try_git(git_cmd, nil) ++ # Note(decentral1se): Output from actual command in the v3.2.4 branch ++ seconds = self.try_git(git_cmd, '1721046633') + seconds.nil? ? nil : DateTime.strptime(seconds, "%s") + end + end +-- +2.45.2 -@@ -448,7 +448,7 @@ module Discourse - def self.last_commit_date - @last_commit_date ||= begin - git_cmd = 'git log -1 --format="%ct"' -- seconds = self.try_git(git_cmd, nil) -+ seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch - seconds.nil? ? nil : DateTime.strptime(seconds, '%s') - end - end diff --git a/sources/patches/main-6-fix-download-calendar.patch b/sources/patches/main-6-fix-download-calendar.patch index 580e10d..132ca9c 100644 --- a/sources/patches/main-6-fix-download-calendar.patch +++ b/sources/patches/main-6-fix-download-calendar.patch @@ -1,13 +1,25 @@ +From e515c68e1011d42f5fd817a799f4694fb469eea2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= +Date: Fri, 26 Jul 2024 14:20:17 +0200 +Subject: [PATCH 3/3] Fix download calendar + +--- + app/assets/javascripts/discourse/app/lib/download-calendar.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/app/assets/javascripts/discourse/app/lib/download-calendar.js b/app/assets/javascripts/discourse/app/lib/download-calendar.js -index 2b53a91eb3..eec55647d5 100644 +index 238a8cf0..541b6b1b 100644 --- a/app/assets/javascripts/discourse/app/lib/download-calendar.js +++ b/app/assets/javascripts/discourse/app/lib/download-calendar.js -@@ -22,7 +22,7 @@ +@@ -23,7 +23,7 @@ export function downloadCalendar(title, dates, recurrenceRule = null) { } - export function downloadIcs(title, dates) { + export function downloadIcs(title, dates, recurrenceRule) { - const REMOVE_FILE_AFTER = 20_000; + const REMOVE_FILE_AFTER = 20000; - const file = new File([generateIcsData(title, dates)], { + const file = new File([generateIcsData(title, dates, recurrenceRule)], { type: "text/plain", }); +-- +2.45.2 +