diff options
Diffstat (limited to 'src/Daemon')
-rw-r--r-- | src/Daemon/PluginManager.cpp | 54 | ||||
-rw-r--r-- | src/Daemon/PluginManager.h | 9 | ||||
-rw-r--r-- | src/Daemon/Settings.cpp | 12 | ||||
-rwxr-xr-x | src/Daemon/abrt-debuginfo-install | 83 |
4 files changed, 54 insertions, 104 deletions
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index e63cb3ac..f01d9435 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -80,60 +80,6 @@ static const char *const plugin_type_str[] = { }; -bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings) -{ - FILE *fp = fopen(pPath, "r"); - if (!fp) - return false; - - char line[512]; - while (fgets(line, sizeof(line), fp)) - { - strchrnul(line, '\n')[0] = '\0'; - unsigned ii; - bool is_value = false; - bool valid = false; - bool in_quote = false; - string key; - string value; - for (ii = 0; line[ii] != '\0'; ii++) - { - if (line[ii] == '"') - { - in_quote = !in_quote; - } - if (isspace(line[ii]) && !in_quote) - { - continue; - } - if (line[ii] == '#' && !in_quote && key == "") - { - break; - } - if (line[ii] == '=' && !in_quote) - { - is_value = true; - continue; - } - if (!is_value) - { - key += line[ii]; - } - else - { - valid = true; - value += line[ii]; - } - } - if (valid && !in_quote) - { - pSettings[key] = value; - } - } - fclose(fp); - return true; -} - /** * A function. It saves settings. On success it returns true, otherwise returns false. * @param path A path of config file. diff --git a/src/Daemon/PluginManager.h b/src/Daemon/PluginManager.h index b5dcebc5..bf6952f4 100644 --- a/src/Daemon/PluginManager.h +++ b/src/Daemon/PluginManager.h @@ -154,13 +154,4 @@ class CPluginManager map_plugin_settings_t GetPluginSettings(const char *pName); }; -/** - * Loads settings and stores it in second parameter. On success it - * returns true, otherwise returns false. - * @param path A path of config file. - * @param settings A readed plugin's settings. - * @return if it success it returns true, otherwise it returns false. - */ -bool LoadPluginSettings(const char *pPath, - map_plugin_settings_t& pSettings); #endif /*PLUGINMANAGER_H_*/ diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 9b0376b3..5644d370 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -376,8 +376,16 @@ void LoadSettings() ParseCommon(); ParseAnalyzerActionsAndReporters(); ParseCron(); - if(g_settings_bOpenGPGCheck) - LoadGPGKeys(); + + /* + loading gpg keys will invoke LoadOpenGPGPublicKey() from rpm.cpp + pgpReadPkts which makes nss to re-init and thus makes + bugzilla plugin work :-/ + */ + + //FIXME FIXME FIXME FIXME FIXME FIXME!!! + //if(g_settings_bOpenGPGCheck) + LoadGPGKeys(); } /* dbus call to retrieve .conf file data from daemon */ diff --git a/src/Daemon/abrt-debuginfo-install b/src/Daemon/abrt-debuginfo-install index 35f4d6a1..3bb9c415 100755 --- a/src/Daemon/abrt-debuginfo-install +++ b/src/Daemon/abrt-debuginfo-install @@ -145,7 +145,9 @@ print_package_names() { fi # when we look for debuginfo we need only -debuginfo* repos, so we can disable the rest and thus make it faster # also we want only fedora repositories, because abrt won't work for other packages anyway - local cmd="yum $yumopts '--disablerepo=*' '--enablerepo=fedora-debuginfo*' '--enablerepo=updates-debuginfo*' --quiet provides $missing_debuginfo_files" + # --showduplicates: do not just show the latest package + # -R2: wait two minutes max (hopefully this prevents infinite hang on yum lock) + local cmd="yum $yumopts '--disablerepo=*' '--enablerepo=fedora-debuginfo*' '--enablerepo=updates-debuginfo*' --showduplicates -R2 --quiet provides $missing_debuginfo_files" echo "$cmd" >"yum_provides.$1.OUT" # eval is needed to strip away ''s; cant remove them above and just use # $cmd, that would perform globbing on '*' @@ -194,53 +196,56 @@ download_packages() { for pkg in $packages; do echo "Download $i/$num_packages: $pkg" echo "Download $i/$num_packages: $pkg" >>yumdownloader.OUT - # we can't handle packages from non Fedora repos, so we look and download only + # We can't handle packages from non Fedora repos, so we look and download only # from Fedora repos which makes it faster yumdownloader --disablerepo="*" --enablerepo="fedora-debuginfo*" --enablerepo="updates-debuginfo*" --quiet $pkg >>yumdownloader.OUT 2>&1 err=$? echo "exitcode:$err" >>yumdownloader.OUT echo >>yumdownloader.OUT test $err = 0 || { echo "Download of $pkg failed!"; sleep 1; } - : $((i++)) - done - - for file in *.rpm; do - # Happens if no .rpm's were downloaded (yumdownloader problem) - # In this case, $f is the literal "*.rpm" string - test -f "$file" || error_msg_and_die "not a rpm file: '$file'" - echo "Unpacking: $file" - echo "Processing: $file" >>unpack.OUT - rpm2cpio <"$file" 2>>unpack.OUT | cpio -id >>unpack.OUT 2>&1 -#TODO: error check? - done - - # Copy debuginfo files to cachedir - if test x"$cachedir" != x"" && test -d "$cachedir"; then - for build_id in $build_ids; do - build_id1=${build_id:0:2} - build_id2=${build_id:2} - - file="usr/lib/debug/.build-id/$build_id1/$build_id2.debug" - - # Do not copy it if it can be found in any of $debuginfodirs - test -f "/$file" && continue - if test x"$cachedir" != x""; then - for d in $debuginfodirs; do - test -f "$d/$file" && continue 2 + # Process and delete the *.rpm file just downloaded + # We do it right after download: some users have smallish disks... + for file in *.rpm; do + # Happens if no .rpm's were downloaded (yumdownloader problem) + # In this case, $f is the literal "*.rpm" string + test -f "$file" || { echo "No rpm file downloaded"; continue; } + echo "Unpacking: $file" + echo "Processing: $file" >>unpack.OUT + rpm2cpio <"$file" >"unpacked.cpio" 2>>unpack.OUT || error_msg_and_die "Can't convert '$file' to cpio" + rm "$file" + cpio -id <"unpacked.cpio" >>unpack.OUT 2>&1 || error_msg_and_die "Can't unpack '$file' cpio archive" + rm "unpacked.cpio" + # Copy debuginfo files to cachedir + if test x"$cachedir" != x"" && test -d "$cachedir"; then + # For every needed debuginfo, check whether we have it + for build_id in $build_ids; do + build_id1=${build_id:0:2} + build_id2=${build_id:2} + file="usr/lib/debug/.build-id/$build_id1/$build_id2.debug" + # Do not copy it if it can be found in any of $debuginfodirs + test -f "/$file" && continue + if test x"$cachedir" != x""; then + for d in $debuginfodirs; do + test -f "$d/$file" && continue 2 + done + fi + if test -f "$file"; then + # File is one of those we just installed, cache it + mkdir -p "$cachedir/usr/lib/debug/.build-id/$build_id1" + # Note: this does not preserve symlinks. This is intentional + $debug && echo Copying "$file" to "$cachedir/$file" >&2 + echo "Caching debuginfo: $file" + cp --remove-destination "$file" "$cachedir/$file" || error_msg_and_die "Can't copy $file (disk full?)" + continue + fi done fi - - if test -f "$file"; then - # File is one of those we just installed, cache it. - mkdir -p "$cachedir/usr/lib/debug/.build-id/$build_id1" - # Note: this does not preserve symlinks. This is intentional - $debug && echo Copying "$file" to "$cachedir/$file" >&2 - cp --remove-destination "$file" "$cachedir/$file" -#TODO: error check? - continue - fi + # Delete remaining files unpacked from .cpio + # which we didn't need after all + rm -r etc bin sbin usr var opt 2>/dev/null done - fi + : $((i++)) + done } |