From 2ed525a1f655f3d1826d8e0e687d2b0a1ee8c14e Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 1 Oct 2025 22:39:00 +0200 Subject: [PATCH 1/8] Make debian package setup example more self explained --- templates/package/content/debian.tmpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index 73b82578357fd..4c153c251d45e 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -4,8 +4,14 @@
-
sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
-echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  $distribution $component" | sudo tee -a /etc/apt/sources.list.d/gitea.list
+				
{{ if gt (len .Distributions) 1 }}# please select one:
+distribution="" # {{StringUtils.Join .Distributions ", "}}
+
+{{end}}{{ if gt (len .Components) 1 }}# please select one:
+component="" # {{StringUtils.Join .Components ", "}}
+
+{{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
+echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$distribution{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$component{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update

{{ctx.Locale.Tr "packages.debian.registry.info"}}

From f503ca1db7c20e3e6d352e5d33512a2a5f4c2653 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 3 Oct 2025 02:30:32 +0200 Subject: [PATCH 2/8] Apply suggestions from code review Signed-off-by: 6543 <6543@obermui.de> --- templates/package/content/debian.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index 4c153c251d45e..f54e95b6b33e7 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -5,13 +5,13 @@
{{ if gt (len .Distributions) 1 }}# please select one:
-distribution="" # {{StringUtils.Join .Distributions ", "}}
+DISTRIBUTION="" # {{StringUtils.Join .Distributions ", "}}
 
 {{end}}{{ if gt (len .Components) 1 }}# please select one:
 component="" # {{StringUtils.Join .Components ", "}}
 
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
-echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$distribution{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$component{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
+echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$DISTRIBUTION{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$component{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update

{{ctx.Locale.Tr "packages.debian.registry.info"}}

From 2df6ac4ab740c50f34e036e681c6f359d9e2bb00 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 3 Oct 2025 02:32:21 +0200 Subject: [PATCH 3/8] Apply suggestions from code review Signed-off-by: 6543 <6543@obermui.de> --- templates/package/content/debian.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index f54e95b6b33e7..cbc1aad40acef 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -8,10 +8,10 @@ DISTRIBUTION="" # {{StringUtils.Join .Distributions ", "}} {{end}}{{ if gt (len .Components) 1 }}# please select one: -component="" # {{StringUtils.Join .Components ", "}} +COMPONENT="" # {{StringUtils.Join .Components ", "}} {{end}}sudo curl -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc -echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc] {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$DISTRIBUTION{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$component{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list +echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc] {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$DISTRIBUTION{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list sudo apt update

{{ctx.Locale.Tr "packages.debian.registry.info"}}

From b7d6b2c2dc9f85b6424ae56b9a5bab7e500c3a29 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 4 Oct 2025 00:08:06 +0200 Subject: [PATCH 4/8] Update templates/package/content/debian.tmpl Co-authored-by: silverwind Signed-off-by: 6543 <6543@obermui.de> --- templates/package/content/debian.tmpl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index cbc1aad40acef..8f1f596874411 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -4,11 +4,8 @@
-
{{ if gt (len .Distributions) 1 }}# please select one:
-DISTRIBUTION="" # {{StringUtils.Join .Distributions ", "}}
-
-{{end}}{{ if gt (len .Components) 1 }}# please select one:
-COMPONENT="" # {{StringUtils.Join .Components ", "}}
+        
{{ if gt (len .Distributions) 1 }}DISTRIBUTION="" # one of {{StringUtils.Join .Distributions ", "}}{{end}}
+          {{ if gt (len .Components) 1 }}COMPONENT="" # one of {{StringUtils.Join .Components ", "}}
 
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
 echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$DISTRIBUTION{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list

From 183059f359c7b49b6f21852caa8bbe822f199f99 Mon Sep 17 00:00:00 2001
From: silverwind 
Date: Mon, 6 Oct 2025 18:46:30 +0200
Subject: [PATCH 5/8] make fmt

---
 templates/package/content/debian.tmpl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl
index 8f1f596874411..a322dec35eea8 100644
--- a/templates/package/content/debian.tmpl
+++ b/templates/package/content/debian.tmpl
@@ -4,11 +4,11 @@
 		
-
{{ if gt (len .Distributions) 1 }}DISTRIBUTION="" # one of {{StringUtils.Join .Distributions ", "}}{{end}}
-          {{ if gt (len .Components) 1 }}COMPONENT="" # one of {{StringUtils.Join .Components ", "}}
+        
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # one of {{StringUtils.Join .Distributions ", "}}{{end}}
+          {{if gt (len .Components) 1}}COMPONENT="" # one of {{StringUtils.Join .Components ", "}}
 
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
-echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{ if eq (len .Distributions) 1 }}{{ index .Distributions 0 }}{{else}}$DISTRIBUTION{{end}} {{ if eq (len .Components) 1 }}{{ index .Components 0 }}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
+echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{if eq (len .Distributions) 1}}{{index .Distributions 0}}{{else}}$DISTRIBUTION{{end}} {{if eq (len .Components) 1}}{{index .Components 0}}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update

{{ctx.Locale.Tr "packages.debian.registry.info"}}

From 6714e6edfdfa70a5b6babf4c338d810566a07802 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 7 Oct 2025 09:17:36 +0200 Subject: [PATCH 6/8] With translation --- options/locale/locale_en-US.ini | 2 +- templates/package/content/debian.tmpl | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 03017ce6746df..99d7ce3d4aefe 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3685,7 +3685,7 @@ container.labels.value = Value cran.registry = Set up this registry in your Rprofile.site file: cran.install = To install the package, run the following command: debian.registry = Set up this registry from the command line: -debian.registry.info = Choose $distribution and $component from the list below. +debian.registry.one_of_vars = Choose one of: debian.install = To install the package, run the following command: debian.repository = Repository Info debian.repository.distributions = Distributions diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index a322dec35eea8..3b0244ccacdf5 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -4,13 +4,11 @@
-
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # one of {{StringUtils.Join .Distributions ", "}}{{end}}
-          {{if gt (len .Components) 1}}COMPONENT="" # one of {{StringUtils.Join .Components ", "}}
-
+        
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Distributions ", "}}
+{{end}}{{if gt (len .Components) 1}}COMPONENT="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Components ", "}}
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
 echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{if eq (len .Distributions) 1}}{{index .Distributions 0}}{{else}}$DISTRIBUTION{{end}} {{if eq (len .Components) 1}}{{index .Components 0}}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update
-

{{ctx.Locale.Tr "packages.debian.registry.info"}}

From 56a8afc14c6be5b06aad21f486cbb6512012fea3 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 7 Oct 2025 09:18:28 +0200 Subject: [PATCH 7/8] did not syntaxhiglight so rm it again --- templates/package/content/debian.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index 3b0244ccacdf5..618f6b65fde04 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -4,7 +4,7 @@
-
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Distributions ", "}}
+        
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Distributions ", "}}
 {{end}}{{if gt (len .Components) 1}}COMPONENT="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Components ", "}}
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
 echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{if eq (len .Distributions) 1}}{{index .Distributions 0}}{{else}}$DISTRIBUTION{{end}} {{if eq (len .Components) 1}}{{index .Components 0}}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list

From 463ffbe639fd7f81350b4af0f44122ad7ab75d01 Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Tue, 7 Oct 2025 19:08:16 +0200
Subject: [PATCH 8/8] fmt

---
 templates/package/content/debian.tmpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl
index 618f6b65fde04..15eff9e1589ca 100644
--- a/templates/package/content/debian.tmpl
+++ b/templates/package/content/debian.tmpl
@@ -4,8 +4,9 @@
 		
-
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Distributions ", "}}
+				
{{if gt (len .Distributions) 1}}DISTRIBUTION="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Distributions ", "}}
 {{end}}{{if gt (len .Components) 1}}COMPONENT="" # {{ctx.Locale.Tr "packages.debian.registry.one_of_vars"}} {{StringUtils.Join .Components ", "}}
+{{end}}{{if or (gt (len .Distributions) 1) (gt (len .Components) 1)}}
 {{end}}sudo curl  -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
 echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc]  {{if eq (len .Distributions) 1}}{{index .Distributions 0}}{{else}}$DISTRIBUTION{{end}} {{if eq (len .Components) 1}}{{index .Components 0}}{{else}}$COMPONENT{{end}}" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update