[Groonga-commit] groonga/groonga at 9a23230 [master] package ubuntu: use Ubuntu version instead of code name for deb version

アーカイブの一覧に戻る
Kouhei Sutou null+****@clear*****
Mon May 13 10:20:27 JST 2019


Kouhei Sutou	2019-05-13 10:20:27 +0900 (Mon, 13 May 2019)

  Revision: 9a23230ef596301aff163216f3b3872df49a60aa
  https://github.com/groonga/groonga/commit/9a23230ef596301aff163216f3b3872df49a60aa

  Message:
    package ubuntu: use Ubuntu version instead of code name for deb version
    
    Because xenial is greater than bionic in deb version.

  Modified files:
    packages/ubuntu/Makefile.am
    packages/ubuntu/upload.rb

  Modified: packages/ubuntu/Makefile.am (+4 -2)
===================================================================
--- packages/ubuntu/Makefile.am    2019-05-13 09:07:34 +0900 (88405f2d5)
+++ packages/ubuntu/Makefile.am    2019-05-13 10:20:27 +0900 (7df6e44ed)
@@ -1,4 +1,5 @@
-CODE_NAMES = xenial,bionic,cosmic,disco
+UBUNTU_CODE_NAMES = xenial,bionic,cosmic,disco
+UBUNTU_VERSIONS = 16.04,18.04,18.10,19.04
 SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz
 
 all:
@@ -14,7 +15,8 @@ upload: source ensure-launchpad-configuration
 	  --package '$(PACKAGE)' \
 	  --version '$(VERSION)' \
 	  --source-archive '$(SOURCE)' \
-	  --code-names '$(CODE_NAMES)' \
+	  --ubuntu-code-names '$(UBUNTU_CODE_NAMES)' \
+	  --ubuntu-versions '$(UBUNTU_VERSIONS)' \
 	  --debian-directory '$(srcdir)/../debian/' \
 	  --ppa '$(LAUNCHPAD_PPA)' \
 	  --pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)'

  Modified: packages/ubuntu/upload.rb (+31 -10)
===================================================================
--- packages/ubuntu/upload.rb    2019-05-13 09:07:34 +0900 (2dba00119)
+++ packages/ubuntu/upload.rb    2019-05-13 10:20:27 +0900 (12d1010ba)
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 #
-# Copyright(C) 2014-2017  Kouhei Sutou <kou****@clear*****>
+# Copyright(C) 2014-2019  Kouhei Sutou <kou****@clear*****>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@ require "pathname"
 class Uploader
   def initialize
     @dput_configuration_name = "groonga-ppa"
+    @dput_ppa_incoming = "~groonga/ppa/ubuntu/"
   end
 
   def run
@@ -29,8 +30,8 @@ class Uploader
 
     parse_command_line!
 
-    @code_names.each do |code_name|
-      upload(code_name)
+    @ubuntu_code_names.zip(@ubuntu_versions) do |code_name, version|
+      upload(code_name, version || code_name)
     end
   end
 
@@ -52,7 +53,7 @@ class Uploader
 [#{@dput_configuration_name}]
 fqdn = ppa.launchpad.net
 method = ftp
-incoming = ~groonga/ppa/ubuntu/
+incoming = #{@dput_ppa_incoming}
 login = anonymous
 allow_unsigned_uploads = 0
       CONFIGURATION
@@ -75,8 +76,17 @@ allow_unsigned_uploads = 0
       @source_archive = Pathname.new(source_archive).expand_path
     end
     parser.on("--code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array,
+              "The target code names",
+              "Deprecated. Use --ubuntu-code-names instead.") do |code_names|
+      @ubuntu_code_names = code_names
+    end
+    parser.on("--ubuntu-code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array,
               "The target code names") do |code_names|
-      @code_names = code_names
+      @ubuntu_code_names = code_names
+    end
+    parser.on("--ubuntu-versions=VERSION1,VERSION2,VERSION3,...", Array,
+              "The target versions") do |versions|
+      @ubuntu_versions = versions
     end
     parser.on("--debian-directory=DIRECTORY",
               "The debian/ directory") do |debian_directory|
@@ -87,14 +97,20 @@ allow_unsigned_uploads = 0
       @pgp_sign_key = pgp_sign_key
     end
     parser.on("--ppa=PPA",
-              "The personal package archive name (groonga-ppa or groonga-nightly") do |ppa|
+              "The personal package archive name (groonga-ppa or groonga-nightly",
+              "(#{@dput_configuration_name})") do |ppa|
       @dput_configuration_name = ppa
     end
+    parser.on("--ppa-incoming=INCOMING",
+              "The incoming value in dput.cf for personal package archive",
+              "(#{@dput_incoming})") do |incoming|
+      @dput_incoming = incoming
+    end
 
     parser.parse!
   end
 
-  def upload(code_name)
+  def upload(ubuntu_code_name, ubuntu_version)
     in_temporary_directory do
       FileUtils.cp(@source_archive.to_s,
                    "#{@package}_#{@version}.orig.tar.gz")
@@ -102,11 +118,16 @@ allow_unsigned_uploads = 0
       directory_name = "#{@package}-#{@version}"
       Dir.chdir(directory_name) do
         FileUtils.cp_r(@debian_directory.to_s, "debian")
-        deb_version = "#{current_deb_version.succ}~#{code_name}1"
+        if ubuntu_version
+          version_suffix = "ubuntu#{ubuntu_version}.1"
+        else
+          version_suffix = "#{ubuntu_code_name}1"
+        end
+        deb_version = "#{current_deb_version.succ}~#{version_suffix}"
         run_command("dch",
-                    "--distribution", code_name,
+                    "--distribution", ubuntu_code_name,
                     "--newversion", deb_version,
-                    "Build for #{code_name}.")
+                    "Build for #{ubuntu_code_name}.")
         run_command("debuild",
                     "--set-envvar=LINTIAN_PROFILE=ubuntu",
                     # Workaround for Launchpad. Launchpad doesn't accept
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190513/36dc80b7/attachment-0001.html>


More information about the Groonga-commit mailing list
アーカイブの一覧に戻る