ref: refs/heads/master
commit 6a7e86daad4703a8335b9d2bd00d6cd1e4a0b4e4
Author: Michael Andres
Date: Wed Oct 7 14:05:57 2009 +0200
Try to send statistics even if the target is not initialized when downloading.
---
zypp/media/MediaAria2c.cc | 2 +-
zypp/media/MediaCurl.cc | 18 ++++++------------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/zypp/media/MediaAria2c.cc b/zypp/media/MediaAria2c.cc
index 9c48874..b7edd9c 100644
--- a/zypp/media/MediaAria2c.cc
+++ b/zypp/media/MediaAria2c.cc
@@ -193,7 +193,7 @@ const char *const MediaAria2c::agentString()
"ZYpp %s (%s) %s"
, VERSION
, MediaAria2c::_aria2cVersion.c_str()
- , target ? target->targetDistribution().c_str() : ""
+ , Target::targetDistribution( Pathname()/*guess root*/ ).c_str()
)
);
return _value.c_str();
diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc
index 229f01f..ee6e211 100644
--- a/zypp/media/MediaCurl.cc
+++ b/zypp/media/MediaCurl.cc
@@ -317,13 +317,11 @@ static const char *const anonymousIdHeader()
// we need to add the release and identifier to the
// agent string.
// The target could be not initialized, and then this information
- // is not available.
- Target_Ptr target = zypp::getZYpp()->getTarget();
-
+ // is guessed.
static const std::string _value(
str::trim( str::form(
"X-ZYpp-AnonymousId: %s",
- target ? target->anonymousUniqueId().c_str() : "" ) )
+ Target::anonymousUniqueId( Pathname()/*guess root*/ ).c_str() ) )
);
return _value.c_str();
}
@@ -337,13 +335,11 @@ static const char *const distributionFlavorHeader()
// we need to add the release and identifier to the
// agent string.
// The target could be not initialized, and then this information
- // is not available.
- Target_Ptr target = zypp::getZYpp()->getTarget();
-
+ // is guessed.
static const std::string _value(
str::trim( str::form(
"X-ZYpp-DistributionFlavor: %s",
- target ? target->distributionFlavor().c_str() : "" ) )
+ Target::distributionFlavor( Pathname()/*guess root*/ ).c_str() ) )
);
return _value.c_str();
}
@@ -357,15 +353,13 @@ static const char *const agentString()
// we need to add the release and identifier to the
// agent string.
// The target could be not initialized, and then this information
- // is not available.
- Target_Ptr target = zypp::getZYpp()->getTarget();
-
+ // is guessed.
static const std::string _value(
str::form(
"ZYpp %s (curl %s) %s"
, VERSION
, curl_version_info(CURLVERSION_NOW)->version
- , target ? target->targetDistribution().c_str() : ""
+ , Target::targetDistribution( Pathname()/*guess root*/ ).c_str()
)
);
return _value.c_str();
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org