This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patch for displaying package name before package descriptor



----- Original Message -----
From: "Ralf Habacker" <Ralf.Habacker@freenet.de>
To: "Cygwin-Patches" <cygwin-patches@sourceware.cygnus.com>
Sent: Thursday, October 11, 2001 4:52 AM
Subject: patch for displaying package name before package descriptor


> Hi,
> I have seen a current setup.exe in cvs and recognized,
> that prepending the package name to the printed
> package descriptor help to identify the displayed package.
> The following patch added this functionality.
>
> BTW: In some packages the package name is already in the
> package descriptor. If this would be cleared (removed)
> the lines
> +       // package name is already in descriptor
> +       if (strncmp(pkg->sdesc,pkg->name,strlen(pkg->name)) == 0)
>            s = pkg->sdesc;
> +
> +       // otherwise prepend the package name
> +       else {
> could be removed from the patch.

Right, well thats easy enough to fix :}. So those lines aren't needed.
This looks good to me Chris.

I've got a little mental anguish over whether we should do this during
parsing, and save all the duplication, or even just have a separate
column with the package name in it. However, this code is hre, and
working so AFAIAC it should go in.

Thanks Ralf!
Rob

>
> Regards
> Ralf
>
>
>
> $ cvs -z7 diff -ubB choose.cc
> Index: choose.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cinstall/choose.cc,v
> retrieving revision 2.48
> diff -u -b -B -r2.48 choose.cc
> --- choose.cc   2001/09/26 21:44:57     2.48
> +++ choose.cc   2001/10/10 18:37:11
> @@ -632,8 +632,20 @@
>         TextOut (hdc, x + chooser->headers[chooser->cat_col].x, r,
>                  pkg->category->name, strlen (pkg->category->name));
>
> -      if (pkg->sdesc)
> +      if (pkg->sdesc) {
> +       // package name is already in descriptor
> +         if (strncmp(pkg->sdesc,pkg->name,strlen(pkg->name)) == 0)
>              s = pkg->sdesc;
> +
> +      // otherwise prepend the package name
> +         else {
> +            static char buf[512];
> +            strcpy(buf,pkg->name);
> +            strcat(buf,": ");
> +            strcat(buf,pkg->sdesc);
> +            s = buf;
> +         }
> +      }
>        else
>         s = pkg->name;
>        TextOut (hdc, x + chooser->headers[chooser->pkg_col].x, r, s,
strlen
> (s));
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]