diff options
author | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-06-29 23:57:52 +0300 |
---|---|---|
committer | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-06-29 23:57:52 +0300 |
commit | 51a6a560d3dd24de795b4fdd1c312233a6483f9b (patch) | |
tree | c97ea1e3764c8fe32545743291d542684bcdc6c1 | |
parent | Add avg speed measurement for connections. (diff) | |
download | idfetch-51a6a560d3dd24de795b4fdd1c312233a6483f9b.tar.gz idfetch-51a6a560d3dd24de795b4fdd1c312233a6483f9b.tar.bz2 idfetch-51a6a560d3dd24de795b4fdd1c312233a6483f9b.zip |
Add option pkg_list_dir
PKG_LIST_DIR
Define a dir with pkg.list file
Default:
pkg_list_dir=./
-rw-r--r-- | segget/segget.conf | 6 | ||||
-rw-r--r-- | segget/segget.cpp | 2 | ||||
-rw-r--r-- | segget/settings.cpp | 2 | ||||
-rw-r--r-- | segget/settings.h | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/segget/segget.conf b/segget/segget.conf index 2218cec..50c1454 100644 --- a/segget/segget.conf +++ b/segget/segget.conf @@ -1,4 +1,10 @@ [folders] +# PKG_LIST_DIR +# Define a dir with pkg.list file +# Default: +# pkg_list_dir=./ +pkg_list_dir=./ + # DISTFILES_DIR # Define a dir to store distfiles # Default: diff --git a/segget/segget.cpp b/segget/segget.cpp index 5fcc987..b06e147 100644 --- a/segget/segget.cpp +++ b/segget/segget.cpp @@ -45,7 +45,7 @@ int load_pkgs(){ try{ ifstream json_pkg_list_file; try{ - json_pkg_list_file.open("pkg.list"); + json_pkg_list_file.open((settings.pkg_list_dir+"pkg.list").c_str()); }catch(...){ error_log("Error: Can't open pkg.list file"); return 1; diff --git a/segget/settings.cpp b/segget/settings.cpp index 3dd8ed0..2f244ad 100644 --- a/segget/settings.cpp +++ b/segget/settings.cpp @@ -38,7 +38,7 @@ void Tsettings::load_from_conf_file(){ conf.set(distfiles_dir, "folders", "distfiles_dir"); conf.set(segments_dir, "folders", "segments_dir"); - // log("segments_dir set to:"+segments_dir); + conf.set(pkg_list_dir, "folders", "pkg_list_dir"); conf.set(max_connection_num_per_distfile, "distfiles", "max_connection_num_per_distfile",1,20); diff --git a/segget/settings.h b/segget/settings.h index f6db28d..83251e2 100644 --- a/segget/settings.h +++ b/segget/settings.h @@ -39,6 +39,7 @@ class Tsettings{ //folders string distfiles_dir; string segments_dir; + string pkg_list_dir; //distfiles ulong max_connection_num_per_distfile; //segments @@ -76,6 +77,7 @@ class Tsettings{ //folders distfiles_dir("./distfiles"), segments_dir("./tmp"), + pkg_list_dir("./"), //distfiles max_connection_num_per_distfile(3), //segments |