Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packages source: fix new version addition to redirect list #1563

Merged
merged 3 commits into from
May 18, 2023

Conversation

komainu8
Copy link
Member

@komainu8 komainu8 commented May 17, 2023

For example, this script output .htaccess as below when we release PGroonga 3.0.3.

edirect /source/pgroonga/pgroonga-3.0.1.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.1.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.1.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip 
Redirect /source/pgroonga/pgroonga-3.0.1.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.2.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.zip 
Redirect /source/pgroonga/pgroonga-3.0.2.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-latest.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-latest.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.3.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip 
Redirect /source/pgroonga/pgroonga-3.0.3.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc
Redirect /source/pgroonga/pgroonga-latest.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip 
Redirect /source/pgroonga/pgroonga-latest.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc

…t version

For example, this script output .htaccess as below when we release PGroonga 3.0.3.

Redirect /source/pgroonga/pgroonga-3.0.0.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.0/pgroonga-3.0.0.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.0.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.0/pgroonga-3.0.0.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.0.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.0/pgroonga-3.0.0.zip
Redirect /source/pgroonga/pgroonga-3.0.0.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.0/pgroonga-3.0.0.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.1.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.1.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.1.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip
Redirect /source/pgroonga/pgroonga-3.0.1.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.2.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.zip
Redirect /source/pgroonga/pgroonga-3.0.2.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-latest.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-latest.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.3.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-3.0.3.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc
Redirect /source/pgroonga/pgroonga-latest.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-latest.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc
@kou
Copy link
Member

kou commented May 17, 2023

Hmm... It's too overkill...

I think that the following changes are enough:

diff --git a/packages/packages-groonga-org-package-task.rb b/packages/packages-groonga-org-package-task.rb
index fbe0cdfe7..50b364b4c 100644
--- a/packages/packages-groonga-org-package-task.rb
+++ b/packages/packages-groonga-org-package-task.rb
@@ -263,7 +263,6 @@ class PackagesGroongaOrgPackageTask < PackageTask
         "#{repository_rsync_base_path}/#{target_namespace}/#{@package}/"
       sh("rsync",
          "-av",
-         "--dry-run",
          "--include=.htaccess",
          "--exclude=*",
          rsync_dir,
@@ -285,7 +284,7 @@ class PackagesGroongaOrgPackageTask < PackageTask
       end
       File.open(htaccess_path, "w") do |htaccess|
         htaccess_content.each_line do |line|
-          htaccess.puts(line) unless line.include?("-latest-")
+          htaccess.puts(line) unless line.include?("-latest")
         end
         __send__("#{target_namespace}_targets").each do |target|
           redirect_url = built_package_url(target_namespace, target)

@komainu8
Copy link
Member Author

Oh...

Your modification output ".htaccess" as below.

Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-latest.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-latest.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.3.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-3.0.3.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc
Redirect /source/pgroonga/pgroonga-latest.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-latest.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc

I think that redirect target is only a source of 3.0.3 in the above definition.
Should we redirect sources of 3.0.2, 3.0.1, and 3.0.0?

May be, I still don't understand this problem yet...

@askdkc
Copy link

askdkc commented May 18, 2023

Should we redirect sources of 3.0.2, 3.0.1, and 3.0.0?

Outside script like Homebrew is dependent on these links so we should keep all these versions links.

@kou
Copy link
Member

kou commented May 18, 2023

How did you confirm this?

You can confirm this by the following command line:

(cd packages && GROONGA_REPOSITORY=/path/to/groonga rake source:download source:prepare && cat source/repositories/source/pgroonga/.htaccess)

@komainu8
Copy link
Member Author

I confirm it as below.

export GROONGA_REPOSITORY=/path/to/groonga
cd packages
rake source:prepare
less source/repositories/source/pgroonga/.htaccess

I don't execute rake source:download...

@komainu8
Copy link
Member Author

I confirm result of the following command.

(cd packages && GROONGA_REPOSITORY=/path/to/groonga rake source:download source:prepare && cat source/repositories/source/pgroonga/.htaccess)

"Redirect" definitions of a new version were added in existing "Redirect" definitions and rewrited latest version as below.

Definitions of 3.0.0, tar.gz of 3.0.1, zip of 3.0.2 don't define.
However, we can download these sources. Because these are already uploaded as zip and tar.gz.

Redirect /source/pgroonga/pgroonga-3.0.1.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip
Redirect /source/pgroonga/pgroonga-3.0.1.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.1/pgroonga-3.0.1.zip.asc
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.2.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.2/pgroonga-3.0.2.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-3.0.3.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-latest.tar.gz https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz
Redirect /source/pgroonga/pgroonga-latest.tar.gz.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.tar.gz.asc
Redirect /source/pgroonga/pgroonga-3.0.3.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-3.0.3.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc
Redirect /source/pgroonga/pgroonga-latest.zip https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip
Redirect /source/pgroonga/pgroonga-latest.zip.asc https://github.com/pgroonga/pgroonga/releases/download/3.0.3/pgroonga-3.0.3.zip.asc

I'll fix my modification in according to #1563 (comment).

@kou
Copy link
Member

kou commented May 18, 2023

They are problem of the existing .htaccess.
I've fixed it manually.

…he latest version"

This reverts commit d6b59e6.
Because this modification too overkill.
@komainu8
Copy link
Member Author

Thanks!
I've apply your suggestion.

@kou kou changed the title packages source: add missing definitions of redirect except the latest version packages source: fix new version addition to redirect list May 18, 2023
@kou kou merged commit b00cc61 into master May 18, 2023
29 of 31 checks passed
@kou kou deleted the fix-source-archive-upload-task branch May 18, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants