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>2012-05-24 12:47:05 +0400
committerTomas Mlcoch <tmlcoch@redhat.com>2012-05-24 12:47:05 +0400
commit61bef5c35cfc2b22ec385a88f4b0bb2fd87c0ded (patch)
treef9732f9c559b458e5a790b63e2937cf89b1e11de
parent859ac87c3142c8c4d995cec31a364cdca5bb370d (diff)
Add version.h0.1.2
-rw-r--r--src/createrepo_c.c4
-rw-r--r--src/mergerepo_c.c8
-rw-r--r--src/version.h26
3 files changed, 35 insertions, 3 deletions
diff --git a/src/createrepo_c.c b/src/createrepo_c.c
index 2411ffa..1ebbc86 100644
--- a/src/createrepo_c.c
+++ b/src/createrepo_c.c
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
+#include "version.h"
#include "constants.h"
#include "parsepkg.h"
#include <fcntl.h>
@@ -36,7 +37,6 @@
#include "xml_dump.h"
-#define VERSION "0.1"
#define G_LOG_DOMAIN ((gchar*) 0)
@@ -241,7 +241,7 @@ int main(int argc, char **argv) {
// Arguments pre-check
if (cmd_options->version) {
- puts("Version: "VERSION);
+ printf("Version: %d.%d.%d\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
free_options(cmd_options);
exit(0);
} else if (argc != 2) {
diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c
index e2215bb..8d9e3fa 100644
--- a/src/mergerepo_c.c
+++ b/src/mergerepo_c.c
@@ -21,6 +21,7 @@
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
+#include "version.h"
#include "compression_wrapper.h"
#include "misc.h"
#include "locate_metadata.h"
@@ -30,7 +31,6 @@
#include "repomd.h"
-#define VERSION "0.1"
#define G_LOG_DOMAIN ((gchar*) 0)
#define DEFAULT_OUTPUTDIR "merged_repo/"
@@ -539,6 +539,12 @@ int main(int argc, char **argv)
return 1;
}
+ if (cmd_options->version) {
+ printf("Version: %d.%d.%d\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
+ free_options(cmd_options);
+ exit(0);
+ }
+
if (g_slist_length(cmd_options->repo_list) < 2) {
free_options(cmd_options);
fprintf(stderr, "Usage: %s [options]\n\n"
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 0000000..1bc182b
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1,26 @@
+/* createrepo_c - Library of routines for manipulation with repodata
+ * Copyright (C) 2012 Tomas Mlcoch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __C_CREATEREPOLIB_VERSION_H__
+#define __C_CREATEREPOLIB_VERSION_H__
+
+#define MAJOR_VERSION 0
+#define MINOR_VERSION 1
+#define PATCH_VERSION 1
+
+#endif /* __C_CREATEREPOLIB_VERSION_H__ */