location_base now set to 'media://' if no -u option set
authorFrank Schreiner <schreiner@suse.de>
Fri, 18 Mar 2016 06:32:20 +0000 (06:32 +0000)
committerFrank Schreiner <schreiner@suse.de>
Fri, 18 Mar 2016 06:39:04 +0000 (06:39 +0000)
.gitignore
src/createrepo_c.c
src/dumper_thread.c

index 5363e68534f7855b851e129053fea60edc579301..58b0e69a68d7398786256b8e031f43f4a9feba90 100644 (file)
@@ -42,3 +42,6 @@ deltarepo/acceptance_tests/repos/repo*/repodata
 BUG*/
 JIRA*/
 ISSUE*/
+
+# vim swap files
+*.sw?
index f964d8291b9f86cb9aee54129e637f5640f63c8a..87d3e56e455631025e61316ac77261f19ae37f09 100644 (file)
@@ -265,7 +265,7 @@ fill_pool(GThreadPool *pool,
         ++*package_count;
     }
 
-    return package_count;
+    return *package_count;
 }
 
 
@@ -818,7 +818,6 @@ main(int argc, char **argv)
     user_data.fil_db            = fil_db;
     user_data.oth_db            = oth_db;
     user_data.changelog_limit   = cmd_options->changelog_limit;
-    user_data.location_base     = cmd_options->location_base;
     user_data.checksum_type_str = cr_checksum_name_str(cmd_options->checksum_type);
     user_data.checksum_type     = cmd_options->checksum_type;
     user_data.checksum_cachedir = cmd_options->checksum_cachedir;
@@ -845,6 +844,11 @@ main(int argc, char **argv)
     user_data.cut_dirs          = cmd_options->cut_dirs;
     user_data.location_prefix   = cmd_options->location_prefix;
 
+    if ( cmd_options->split && ! cmd_options->location_base)
+        user_data.location_base     = "media://";
+    else
+        user_data.location_base     = cmd_options->location_base;
+
     g_debug("Thread pool user data ready");
 
     // Start pool
index 228ff77a12b1051b3b0e2bf7c78921fc4d6fa7d1..3fe4c932c570249fc216270f46e26923da24ed6a 100644 (file)
@@ -245,8 +245,8 @@ load_rpm(const char *fullpath,
         goto errexit;
 
     // cut off trailing slashes from urls e.g. media:// -> media:
-    gsize  lb_length       = strlen(location_base);
-    gchar  *t_location_base;
+    gsize  lb_length        = strlen(location_base);
+    gchar  *t_location_base = g_malloc0(sizeof(location_base));
     char suf[2];
     strncpy(suf,&location_base[lb_length-2],2);
 
@@ -263,6 +263,8 @@ load_rpm(const char *fullpath,
     pkg->location_href = cr_safe_string_chunk_insert(pkg->chunk, location_href);
     pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, t_location_base);
 
+    g_free(t_location_base);
+
     // Get checksum type string
     pkg->checksum_type = cr_safe_string_chunk_insert(pkg->chunk,
                                         cr_checksum_name_str(checksum_type));