On 03/06/2012 05:42 PM, Johannes Renner wrote:
> Hey,
> 
> I want to propose a change concerning the names of cloned errata.
> Currently, names of cloned errata are generated like this:
> 
> String clonedAdvisoryName = "CL" + published.getAdvisoryName().substring(3);
> String clonedAdvisory = "CL" + published.getAdvisory().substring(3);
> 
> The reason for doing it like this might have been a small sized field in the
> database, but AFAIK we already upstreamed a patch to enlarge the respective
> field. Since cloned errata currently end up with rather strange names, I
> would like to propose to do the naming like this instead:
> 
> String clonedAdvisoryName = "CL-" + published.getAdvisoryName();
> String clonedAdvisory = "CL-" + published.getAdvisory();
> 
> Even the classification used for the Red Hat patches (E, S and B) gets lost
> when removing the first 3 characters, since names start with RH(E|S|B). So
> please tell me if I am missing any reason to keep the old naming scheme.
> 
> Attached please find my proposed patch for spacewalk master.

Of course this algorithm is duplicated in the perl parts of Spacewalk ;-)
Patch is attached.

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
>From 1397508621edc9e7a4804c3aee46a74a23421bb4 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Wed, 7 Mar 2012 11:13:43 +0100
Subject: [PATCH] Fix naming of cloned patches to not remove the first 3 chars

---
 web/modules/rhn/RHN/DB/ErrataEditor.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/modules/rhn/RHN/DB/ErrataEditor.pm b/web/modules/rhn/RHN/DB/ErrataEditor.pm
index 8c19fa5..249ef8d 100644
--- a/web/modules/rhn/RHN/DB/ErrataEditor.pm
+++ b/web/modules/rhn/RHN/DB/ErrataEditor.pm
@@ -159,8 +159,8 @@ sub find_next_advisory {
   my $suffix = '';
   my $i = 1;
 
-  $adv = 'CL' . substr($adv, 3);
-  $adv_name = 'CL' . substr($adv_name, 3);
+  $adv = 'CL-' . $adv;
+  $adv_name = 'CL-' . $adv_name;
 
   if (advisory_exists($adv) || advisory_name_exists($adv_name)) {
     $suffix = sprintf("-%u", $i++);
-- 
1.7.7

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to