Commit ce32dea9ed9413a4e49a731bfb8e9da88355d392

Authored by Silvan Calarco
1 parent 00a88dd5e6
Exists in master

Allow generating only html stats with --generatehtmlstats

Calling --generatehtml implies adding --generatehtmlstats

Showing 2 changed files with 12 additions and 3 deletions Side-by-side Diff

... ... @@ -93,6 +93,7 @@
93 93 #define MODE_SQLITE3 128
94 94 #define MODE_SQLITE3_FILES 256
95 95 #define MODE_GENCONTENTSLIST 512
  96 +#define MODE_HTMLSTATS 1024
96 97  
97 98 static void program_usage(int exit_code);
98 99 static void program_version(void);
... ... @@ -143,7 +144,8 @@
143 144 "Commands:",
144 145 " --gendatatables write dependencies, buildinfo and apt db files",
145 146 " --genbuildinfo generate build info files for all SRPMS packages",
146   -" --genhtml generate HTML code for repository",
  147 +" --genhtml generate HTML code for repository (implies --genhtmlstats)",
  148 +" --genhtmlstats generate HTML summary pages for repository",
147 149 " --genpkglist generate binary packages list with version and size",
148 150 " --gensrcpkglist generate a source packages list with version",
149 151 " --gensqlite3 dump data to SQLite3 databases",
... ... @@ -960,6 +962,7 @@
960 962 { "changelogsince", required_argument, 0, 0 },
961 963 { "genbuildinfo", no_argument, 0, 0 },
962 964 { "genhtml", no_argument, 0, 0 },
  965 + { "genhtmlstats", no_argument, 0, 0 },
963 966 { "genpkglist", no_argument, 0, 0 },
964 967 { "gensrcpkglist", no_argument, 0, 0 },
965 968 { "gensqlite3", no_argument, 0, 0 },
966 969  
... ... @@ -1011,10 +1014,15 @@
1011 1014 date = optarg;
1012 1015 name = NULL;
1013 1016 } else if (!strcmp(longopts[longindex].name, "genhtml")) {
1014   - mode |= MODE_HTML;
  1017 + mode |= MODE_HTML | MODE_HTMLSTATS;
1015 1018 genheader_mode |= GENHEADER_CHANGELOG | GENHEADER_STATS;
1016 1019 recursive_mode = 1;
1017 1020 name = NULL;
  1021 + } else if (!strcmp(longopts[longindex].name, "genhtmlstats")) {
  1022 + mode |= MODE_HTMLSTATS;
  1023 + genheader_mode |= GENHEADER_CHANGELOG | GENHEADER_STATS;
  1024 + recursive_mode = 1;
  1025 + name = NULL;
1018 1026 } else if (!strcmp(longopts[longindex].name, "gensqlite3")) {
1019 1027 mode |= MODE_SQLITE3;
1020 1028 } else if (!strcmp(longopts[longindex].name, "gensqlite3files")) {
... ... @@ -1339,7 +1347,7 @@
1339 1347 }
1340 1348  
1341 1349 // NOTE: generateStats must be called after generateHTML_SRPMSFiles for warnings to appear
1342   - if (mode & MODE_HTML) {
  1350 + if (mode & MODE_HTMLSTATS) {
1343 1351 logmsg(LOG_DEBUG,"generateStats - start");
1344 1352 generateStats(configtag,i);
1345 1353 logmsg(LOG_DEBUG,"generateStats - done");
... ... @@ -857,6 +857,7 @@
857 857 struct stat buf;
858 858 sizeString strsize;
859 859  
  860 + // create packages directory
860 861 snprintf(buffer,PATH_MAX,"%spackages",configtag->html_dir);
861 862 if (stat(buffer,&buf)) {
862 863 if (mkdir(buffer,S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {