mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.9 KiB

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/base/mine/extraver.patch
# ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
--- ./readdb.c (revision 53)
+++ ./readdb.c (working copy)
@@ -115,7 +115,7 @@
struct dependency *dep;
char line[1024], *t;
char filename[PATH_MAX];
- int line_length;
+ int line_length, i;
FILE *f = dbf;
if ( !dbf ) {
@@ -151,8 +151,15 @@
if ( line[line_length-1] == '\n' ) line[--line_length] = 0;
if ( !strncmp(line, "[V] ", 4) ) {
+#ifdef ROCK20
p->version = malloc(line_length-3);
sscanf(line+4, "%s", p->version);
+#else
+ p->version = strdup(line+4);
+ for (i=0; p->version[i]; i++)
+ if (p->version[i] == ' ')
+ p->version[i] = '-';
+#endif
continue;
}
@@ -217,8 +224,15 @@
line[--line_length] = 0;
if ( !strncmp(line, "[V] ", 4) ) {
+#ifdef ROCK20
p->installed_version = malloc(line_length-3);
- strcpy(p->installed_version, line+4);
+ sscanf(line+4, "%s", p->installed_version);
+#else
+ p->installed_version = strdup(line+4);
+ for (i=0; p->installed_version[i]; i++)
+ if (p->installed_version[i] == ' ')
+ p->installed_version[i] = '-';
+#endif
continue;
}
}