diff --git a/src/reports.c b/src/reports.c index ad117cd..b10dcbe 100644 --- a/src/reports.c +++ b/src/reports.c @@ -709,8 +709,8 @@ generateStats(struct configTag *configtag,int arch) int generateHTMLMainIndex(struct configTag *configtag) { - char indexfile[PATH_MAX],smartfile[PATH_MAX],buffer[PATH_MAX],smartpyfile[PATH_MAX]; - FILE *fout,*fsmart,*fsmartpy; + char indexfile[PATH_MAX],buffer[PATH_MAX]; + FILE *fout; int i; if (!configtag->configdefaults->html_basedir) { @@ -725,76 +725,25 @@ generateHTMLMainIndex(struct configTag *configtag) return 1; } - /* create Smart Package Manager channel files */ - snprintf(smartfile,PATH_MAX,"%s%s.smart", - configtag->configdefaults->html_basedir, - configtag->configdefaults->distribution_name); - snprintf(smartpyfile,PATH_MAX,"%s%s.smart.py", - configtag->configdefaults->html_basedir, - configtag->configdefaults->distribution_name); - - if ((fsmart = fopen(smartfile, "w")) == NULL) { - perror(smartfile); - return 1; - } - if ((fsmartpy = fopen(smartpyfile, "w")) == NULL) { - perror(smartpyfile); - return 1; - } - fprintf(fout,"Available repositories:

\n"); while (configtag) { + fprintf(fout, + "%s: %s
", + configtag->configdefaults->url_prefix, + configtag->tag, + configtag->tag, + configtag->description); - fprintf(fout, - "%s: %s
", - configtag->configdefaults->url_prefix, - configtag->tag, - configtag->tag, - configtag->description); - - /* remove final slashes from download_prefix as required by apt */ - strcpy(buffer, configtag->download_dir); - i=strlen(buffer); - while ((i > 0) && (buffer[i-1] == '/' )) { - buffer[i-1]='\0'; - i--; - } - fprintf(fsmart, "#\n# %s %s channel configuration for Smart Package Manager\n#\n\n", - configtag->configdefaults->distribution_name, - configtag->tag); - fprintf(fsmart, "[%s]\ntype = apt-rpm\n", - configtag->tag); - fprintf(fsmart, "name = %s\n", - configtag->description); - fprintf(fsmart, "disabled = yes\n"); - fprintf(fsmart, "baseurl = http://%s%s\n", - configtag->configdefaults->url_address, buffer); - fprintf(fsmart, "components = %s\n\n", - configtag->arch[0]); - fprintf(fsmartpy, "#\n# %s %s channel configuration for Smart Package Manager\n#\n\n", - configtag->configdefaults->distribution_name, - configtag->tag); - fprintf(fsmartpy, "if not sysconf.get((\"channels\", \"%s\")):\n", - configtag->tag); - fprintf(fsmartpy, "\tsysconf.set((\"channels\", \"%s\"),\n", - configtag->tag); - fprintf(fsmartpy, "\t\t\t{\"alias\": \"%s\",\n", - configtag->tag); - fprintf(fsmartpy, "\t\t\t\"type\": \"apt-rpm\",\n"); - fprintf(fsmartpy, "\t\t\t\"name\": \"%s\",\n", - configtag->description); - fprintf(fsmartpy, "\t\t\t\"disabled\": \"yes\",\n"); - fprintf(fsmartpy, "\t\t\t\"baseurl\": \"http://%s%s\",\n", - configtag->configdefaults->url_address, buffer); - fprintf(fsmartpy, "\t\t\t\"components\": \"%s\"})\n\n", - configtag->arch[0]); - - configtag = configtag->next; - + /* remove final slashes from download_prefix as required by apt */ + strcpy(buffer, configtag->download_dir); + i=strlen(buffer); + while ((i > 0) && (buffer[i-1] == '/' )) { + buffer[i-1]='\0'; + i--; + } + configtag = configtag->next; } fclose(fout); - fclose(fsmart); - fclose(fsmartpy); return 0; }