aboutsummaryrefslogtreecommitdiffstats
path: root/src/configuration.h
diff options
context:
space:
mode:
authorJason Woodward2008-11-25 05:08:34 +0000
committerJason Woodward2008-11-25 05:08:34 +0000
commit9c93560701f95046335c0a69cac26a81969df01e (patch)
treed04c7f3a66373268cc00982d2e6c40ee83ff8073 /src/configuration.h
parent8d31622d3a7d3d6dc6fd109756baf56b56a7c799 (diff)
downloadslapt-get-9c93560701f95046335c0a69cac26a81969df01e.tar.gz
* (libslapt) added slapt_write_rc_config (incorporating from gslapt)
* (libslapt) added parsing of disabled sources (instead of ignoring what gslapt creates). * test updates * Added source priority support based on patch submitted by Ken Milmore
Diffstat (limited to 'src/configuration.h')
-rw-r--r--src/configuration.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/configuration.h b/src/configuration.h
index 388e6f0..7dbeb39 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -1,21 +1,29 @@
-#define SOURCE_TOKEN "SOURCE="
-#define WORKINGDIR_TOKEN "WORKINGDIR="
-#define WORKINGDIR_TOKEN_LEN 256
-#define EXCLUDE_TOKEN "EXCLUDE="
+#define SLAPT_SOURCE_TOKEN "SOURCE="
+#define SLAPT_DISABLED_SOURCE_TOKEN "#DISABLED="
+#define SLAPT_WORKINGDIR_TOKEN "WORKINGDIR="
+#define SLAPT_WORKINGDIR_TOKEN_LEN 256
+#define SLAPT_EXCLUDE_TOKEN "EXCLUDE="
+#define SLAPT_SOURCE_ATTRIBUTE_REGEX "(:[A-Z_,]+)$"
struct slapt_exclude_list {
char **excludes;
unsigned int count;
};
+typedef struct {
+ char *url;
+ SLAPT_PRIORITY_T priority;
+ SLAPT_BOOL_T disabled;
+} slapt_source_t;
+
struct slapt_source_list {
- char **url;
+ slapt_source_t **src;
unsigned int count;
};
typedef struct {
- char working_dir[WORKINGDIR_TOKEN_LEN];
+ char working_dir[SLAPT_WORKINGDIR_TOKEN_LEN];
struct slapt_source_list *sources;
struct slapt_exclude_list *exclude_list;
int(*progress_cb)(void *,double,double,double,double);
@@ -55,13 +63,19 @@ void slapt_add_exclude(struct slapt_exclude_list *list,const char *e);
void slapt_remove_exclude(struct slapt_exclude_list *list,const char *e);
void slapt_free_exclude_list(struct slapt_exclude_list *list);
+/* create, destroy the source struct */
+slapt_source_t *slapt_init_source(const char *s);
+void slapt_free_source(slapt_source_t *src);
+
/*
add or remove a package source url to the source list.
commonly called with global_config->source_list
*/
struct slapt_source_list *slapt_init_source_list(void);
-void slapt_add_source(struct slapt_source_list *list,const char *s);
+void slapt_add_source(struct slapt_source_list *list, slapt_source_t *s);
void slapt_remove_source (struct slapt_source_list *list, const char *s);
void slapt_free_source_list(struct slapt_source_list *list);
SLAPT_BOOL_T slapt_is_interactive(const slapt_rc_config *);
+
+int slapt_write_rc_config(const slapt_rc_config *global_config, const char *location);