Package: reprepro
Version: 5.3.0-1.2
Severity: wishlist
Tags: patch

Hi,

the attached patch allows suite pattern *- for conf/updates in addition to */.
Needed for bullseye security, -backports and -updates in the main archive.

Regards,
Stefan

Examples:

Name: security-buster
Method: http://security.debian.org/debian-security
Suite: */updates

Name: security
Method: http://security.debian.org/debian-security
Suite: *-updates

Name: backports
Method: http://ftp.debian.org/debian
Suite: *-backports

Name: updates
Method: http://ftp.debian.org/debian
Suite: *-updates
diff -uNrp reprepro-5.3.0.orig/docs/reprepro.1 reprepro-5.3.0/docs/reprepro.1
--- reprepro-5.3.0.orig/docs/reprepro.1	2018-09-09 07:17:15.000000000 +0200
+++ reprepro-5.3.0/docs/reprepro.1	2022-10-13 17:04:32.150363395 +0200
@@ -1678,7 +1678,7 @@ if both get their \fBMethod\fP informati
 .B Suite
 The suite to update from. If this is not present, the codename
 of the distribution using this one is used. Also "*/whatever"
-is replaced by "<codename>/whatever"
+is replaced by "<codename>/whatever", "*-whatever" is replaced by "<codename>-whatever"
 .TP
 .B Components
 The components to update. Each item can be either the name
diff -uNrp reprepro-5.3.0.orig/updates.c reprepro-5.3.0/updates.c
--- reprepro-5.3.0.orig/updates.c	2019-02-02 12:14:59.000000000 +0100
+++ reprepro-5.3.0/updates.c	2022-10-13 17:15:28.735408139 +0200
@@ -593,6 +593,7 @@ CFfinishparse(update_pattern) {
 		}
 		if (n->suite_from != NULL && strcmp(n->suite_from, "*") != 0 &&
 				strncmp(n->suite_from, "*/", 2) != 0 &&
+				strncmp(n->suite_from, "*-", 2) != 0 &&
 				strchr(n->suite_from, '*') != NULL) {
 			fprintf(stderr,
 "%s:%u to %u: Unsupported suite pattern '%s'\n",
@@ -755,8 +756,8 @@ static inline char *translate_suite_patt
 
 	if (p == NULL || strcmp(p->suite_from, "*") == 0)
 		return strdup(codename);
-	if (p->suite_from[0] == '*' && p->suite_from[1] == '/')
-		return calc_dirconcat(codename, p->suite_from + 2);
+	if (p->suite_from[0] == '*' && (p->suite_from[1] == '/' || p->suite_from[1] == '-'))
+		return mprintf("%s%s", codename, p->suite_from + 1);
 	else if (strchr(p->suite_from, '*') == NULL)
 		return strdup(p->suite_from);
 	//TODO: implement this

Reply via email to