1 #if defined(MANDRIVA) || defined(MAGEIA)
12 #include "repoinfo_config_urpmi.h"
15 #define URPMI_CFG "/etc/urpmi/urpmi.cfg"
19 read_repoinfos_urpmi(Pool *pool, int *nrepoinfosp)
21 char buf[4096], *bp, *arg;
24 struct repoinfo *cinfo = 0;
25 struct repoinfo *repoinfos = 0;
28 if ((fp = fopen(URPMI_CFG, "r")) == 0)
33 while (fgets(buf, sizeof(buf), fp))
36 while (l && (buf[l - 1] == '\n' || buf[l - 1] == ' ' || buf[l - 1] == '\t'))
39 while (l && (*bp == ' ' || *bp == '\t'))
46 if (!insect && bp[l - 1] == '{')
52 while (l && (bp[l - 1] == ' ' || bp[l - 1] == '\t'))
57 char *bbp = bp, *bbp2 = bp;
61 if (*bbp == '\\' && bbp[1])
66 repoinfos = solv_extend(repoinfos, nrepoinfos, 1, sizeof(*repoinfos), 15);
67 cinfo = repoinfos + nrepoinfos++;
68 memset(cinfo, 0, sizeof(*cinfo));
69 cinfo->alias = strdup(bp);
70 cinfo->type = TYPE_MDK;
71 cinfo->autorefresh = 1;
74 cinfo->metadata_expire = METADATA_EXPIRE;
78 if (insect && *bp == '}')
84 if (!insect || !cinfo)
86 if ((arg = strchr(bp, ':')) != 0)
89 while (*arg == ' ' || *arg == '\t')
94 if (strcmp(bp, "ignore") == 0)
96 if (strcmp(bp, "mirrorlist") == 0)
97 cinfo->mirrorlist = solv_strdup(arg);
98 if (strcmp(bp, "with-dir") == 0)
99 cinfo->path = solv_strdup(arg);
102 *nrepoinfosp = nrepoinfos;