Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rpm-software-management/createrepo_c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mlcoch <tmlcoch@redhat.com>2014-05-06 16:49:23 +0400
committerTomas Mlcoch <tmlcoch@redhat.com>2014-05-06 16:51:30 +0400
commit95d06bb2b5285378d57ae11fff30d6c4c4640468 (patch)
treed89568b5eae9d849e9de8390baba400f261ca310
parent57e2fad3d8a39b938dfbe15aa68313f2f5226550 (diff)
Change default file handling (RhBug: 1094539)
During update, the original createrepo leaves behind some files which were originaly part of repodata (were listed in the repomd.xml) and after the update they are not part of the repomd.xml but they still exists in the repodata/ directory. E.g. comps files (group files) - when you add a new group file (using --groupfile) and use --update, the old groupfile remains are in the repodata/. This patch changes the approach and the files that are not part of repomd.xml anymore are removed. See: https://github.com/Tojaj/createrepo_c/wiki/New-File-Handling
-rw-r--r--src/cmd_parser.c2
-rw-r--r--src/cmd_parser.h4
-rw-r--r--src/createrepo_c.c1
-rw-r--r--src/helpers.c4
-rw-r--r--src/helpers.h1
5 files changed, 10 insertions, 2 deletions
diff --git a/src/cmd_parser.c b/src/cmd_parser.c
index 6b6f119..1f52ec1 100644
--- a/src/cmd_parser.c
+++ b/src/cmd_parser.c
@@ -124,6 +124,8 @@ static GOptionEntry cmd_entries[] =
"Which compression type to use.", "<compress_type>" },
{ "keep-all-metadata", 0, 0, G_OPTION_ARG_NONE, &(_cmd_options.keep_all_metadata),
"Keep groupfile and updateinfo from source repo during update.", NULL },
+ { "compatibility", 0, 0, G_OPTION_ARG_NONE, &(_cmd_options.compatibility),
+ "Enforce maximal compatibility with classical createrepo.", NULL },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL },
};
diff --git a/src/cmd_parser.h b/src/cmd_parser.h
index 5f19aeb..b3e0710 100644
--- a/src/cmd_parser.h
+++ b/src/cmd_parser.h
@@ -72,6 +72,10 @@ struct CmdOptions {
create the new one (empty) to serve as
a lock and use a .repodata.date.pid for
data generation. */
+ gboolean compatibility; /*!< Enforce maximal compatibility with
+ createrepo. I.e. mimics some dump
+ behavior like perseve old comps file(s)
+ during update etc.*/
/* Items filled by check_arguments() */
diff --git a/src/createrepo_c.c b/src/createrepo_c.c
index 4155e82..1b55c26 100644
--- a/src/createrepo_c.c
+++ b/src/createrepo_c.c
@@ -1525,6 +1525,7 @@ main(int argc, char **argv)
ret = cr_old_metadata_retention(out_repo,
tmp_out_repo,
cmd_options->retain_old,
+ cmd_options->compatibility,
&tmp_err);
if (!ret) {
g_critical("%s", tmp_err->message);
diff --git a/src/helpers.c b/src/helpers.c
index dc01541..e95ebe8 100644
--- a/src/helpers.c
+++ b/src/helpers.c
@@ -318,6 +318,7 @@ gboolean
cr_old_metadata_retention(const char *old_repo,
const char *new_repo,
int retain_old,
+ int compatibility,
GError **err)
{
gboolean ret = TRUE;
@@ -325,7 +326,6 @@ cr_old_metadata_retention(const char *old_repo,
GDir *dirp = NULL;
const gchar *filename;
GError *tmp_err = NULL;
- int compatibility_mode = 1;
assert(!err || *err == NULL);
@@ -335,7 +335,7 @@ cr_old_metadata_retention(const char *old_repo,
g_debug("Copying files from old repository to the new one");
// Get list of file that should be skiped during copying
- if (compatibility_mode)
+ if (compatibility)
ret = cr_repodata_blacklist_classic(old_repo, retain_old, &blacklist, err);
else
ret = cr_repodata_blacklist(old_repo, retain_old, &blacklist, err);
diff --git a/src/helpers.h b/src/helpers.h
index 62219c2..5647f7f 100644
--- a/src/helpers.h
+++ b/src/helpers.h
@@ -40,6 +40,7 @@ gboolean
cr_old_metadata_retention(const char *old_repo,
const char *new_repo,
int retain_old,
+ int compatibility,
GError **err);
/** Remove files related to repodata from the specified path.