tags 366608 + patch fixed-upstream pending
thanks

Martin Michlmayr <[EMAIL PROTECTED]> writes:

> Package: schroot
> Version: 0.2.9-1
> Severity: minor
>
> If you have a chroot "foo" and and alias=foo schroot will complain:
>
> 2323:[EMAIL PROTECTED]: ~] schroot -c cross
> W: cross chroot: alias ‘cross’ already associated with ‘cross’ chroot
>
> I think you can simply ignore this case and only print a warning if a
> name is associated already with another chroot.

Agreed.  The behaviour is unamiguous, so it's safe to omit the
warning.  I applied the following patch to do this:

Index: schroot/sbuild-chroot-config.cc
===================================================================
--- schroot/sbuild-chroot-config.cc     (revision 574)
+++ schroot/sbuild-chroot-config.cc     (working copy)
@@ -151,13 +151,17 @@
              .second == false)
            {
              string_map::const_iterator dup = this->aliases.find(*pos);
+             // Don't warn if alias is for chroot of same name.
              if (dup != this->aliases.end())
-               log_warning() <<
-                 format(_("%1% chroot: "
-                          "alias '%2%' already associated with "
-                          "'%3%' chroot"))
-                 % chroot->get_name() % dup->first % dup->second
-                             << endl;
+               {
+                 if (chroot->get_name() != dup->first)
+                   log_warning() <<
+                     format(_("%1% chroot: "
+                              "alias '%2%' already associated with "
+                              "'%3%' chroot"))
+                     % chroot->get_name() % dup->first % dup->second
+                                 << endl;
+               }
              else
                log_warning() <<
                  format(_("%1% chroot: "
Index: debian/changelog
===================================================================
--- debian/changelog    (revision 574)
+++ debian/changelog    (working copy)
@@ -2,6 +2,9 @@
 
   * New upstream release.
   * debian/control: Upgrade to Standards-Version 3.7.0.
+  * sbuild/sbuild-chroot-config.cc: If a chroot alias is the same as the
+    chroot name, don't warn about it, because the effect is still
+    unambiguous (Closes: #366608).
 
  --
 
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 574)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2006-05-14  Roger Leigh  <[EMAIL PROTECTED]>
+
+       * schroot/sbuild-chroot-config.cc (add): If a chroot alias is the
+       same as the chroot name, don't warn about it, because the effect
+       is still unambiguous.
+
 2006-04-30  Roger Leigh  <[EMAIL PROTECTED]>
 
        * Remove unused .cvsignore files.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

Attachment: pgp3nxWTRXsM4.pgp
Description: PGP signature

Reply via email to