This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
patch for displaying package name before package descriptor
- To: "Cygwin-Patches" <cygwin-patches at sourceware dot cygnus dot com>
- Subject: patch for displaying package name before package descriptor
- From: "Ralf Habacker" <Ralf dot Habacker at freenet dot de>
- Date: Wed, 10 Oct 2001 20:52:13 +0200
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.
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));