Skip to content

Commit

Permalink
Merge branch 'jb51353-update' into 'master'
Browse files Browse the repository at this point in the history
Update libzypp to 17.24.2.

See merge request mer-core/libzypp!30
  • Loading branch information
jusa committed Nov 26, 2020
2 parents 04e9ed8 + 827b172 commit a27422e
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 204 deletions.
23 changes: 0 additions & 23 deletions rpm/0004-Set-unrestricted-auth-curl-option.patch

This file was deleted.

@@ -1,18 +1,22 @@
From 6630721a6fdedb2613e234372a079ca942007072 Thu, 9 Aug 2018 11:36:55 +0200
From ad25aa65aedb488b349218019fd478291af3a7ab Mon Sep 17 00:00:00 2001
From: Juha Kallioinen <juha.kallioinen@jolla.com>
Date: Wed, 6 Nov 2013 14:05:27 +0000
Subject: [PATCH] [libzypp] Enable netrc-optional on libcurl to allow for easier image building in SDK

Subject: [PATCH] Enable netrc-optional on libcurl to allow for easier image
building in SDK

Original patch from: Islam Amer <islam.amer@jollamobile.com>

Signed-off-by: Juha Kallioinen <juha.kallioinen@jolla.com>
---
zypp/media/MediaCurl.cc | 59 ++++++++++++++++++++++++++++++++++++++-----------
zypp/media/MediaCurl.h | 2 +-
2 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc
index 599e145..115e06f 100644
index 2947c31..a647977 100644
--- a/zypp/media/MediaCurl.cc
+++ b/zypp/media/MediaCurl.cc
@@ -984,8 +984,8 @@
@@ -616,8 +616,8 @@ void MediaCurl::getFileCopy( const Pathname & filename , const Pathname & target

Url fileurl(getFileUrl(filename));

Expand All @@ -23,7 +27,7 @@ index 599e145..115e06f 100644
do
{
try
@@ -996,7 +996,7 @@
@@ -628,7 +628,7 @@ void MediaCurl::getFileCopy( const Pathname & filename , const Pathname & target
// retry with proper authentication data
catch (MediaUnauthorizedException & ex_r)
{
Expand All @@ -32,7 +36,7 @@ index 599e145..115e06f 100644
retry = true;
else
{
@@ -1026,8 +1026,8 @@
@@ -658,8 +658,8 @@ void MediaCurl::getFileCopy( const Pathname & filename , const Pathname & target

bool MediaCurl::getDoesFileExist( const Pathname & filename ) const
{
Expand All @@ -43,7 +47,7 @@ index 599e145..115e06f 100644
do
{
try
@@ -1037,7 +1037,7 @@
@@ -669,7 +669,7 @@ bool MediaCurl::getDoesFileExist( const Pathname & filename ) const
// authentication problem, retry with proper authentication data
catch (MediaUnauthorizedException & ex_r)
{
Expand All @@ -52,12 +56,12 @@ index 599e145..115e06f 100644
retry = true;
else
ZYPP_RETHROW(ex_r);
@@ -1693,9 +1693,32 @@
@@ -1346,9 +1346,32 @@ void MediaCurl::resetExpectedFileSize(void *clientp, const ByteCount &expectedFi
}

///////////////////////////////////////////////////////////////////
-
-bool MediaCurl::authenticate(const string & availAuthTypes, bool firstTry) const
-bool MediaCurl::authenticate(const std::string & availAuthTypes, bool firstTry) const
+/*
+ * The authentication is a challenge-response type transaction. We
+ * come here after the challenge has been received and need to send a
Expand All @@ -81,13 +85,13 @@ index 599e145..115e06f 100644
+ * the correct response.
+ *
+ */
+bool MediaCurl::authenticate(const string & availAuthTypes, int numTry, bool &netrcUsed) const
+bool MediaCurl::authenticate(const std::string & availAuthTypes, int numTry, bool &netrcUsed) const
{
+ DBG << "numtry: " << numTry << endl;
//! \todo need a way to pass different CredManagerOptions here
CredentialManager cm(CredManagerOptions(ZConfig::instance().repoManagerRoot()));
CurlAuthData_Ptr credentials;
@@ -1703,21 +1726,29 @@
@@ -1356,21 +1379,29 @@ bool MediaCurl::authenticate(const std::string & availAuthTypes, bool firstTry)
// get stored credentials
AuthData_Ptr cmcred = cm.getCred(_url);

Expand Down Expand Up @@ -122,15 +126,15 @@ index 599e145..115e06f 100644
curlcred->setUsername(_url.getUsername());
// if CM has found some credentials, preset the username from there
else if (cmcred)
@@ -1754,6 +1785,7 @@
@@ -1407,6 +1438,7 @@ bool MediaCurl::authenticate(const std::string & availAuthTypes, bool firstTry)
}
else
{
+ // can be the result of the non-interactive client mode
DBG << "callback answer: cancel" << endl;
}
}
@@ -1792,6 +1824,7 @@
@@ -1445,6 +1477,7 @@ bool MediaCurl::authenticate(const std::string & availAuthTypes, bool firstTry)
return true;
}

Expand All @@ -139,10 +143,10 @@ index 599e145..115e06f 100644
}

diff --git a/zypp/media/MediaCurl.h b/zypp/media/MediaCurl.h
index 48a8dcf..816a4f1 100644
index de3ab5c..44b9add 100644
--- a/zypp/media/MediaCurl.h
+++ b/zypp/media/MediaCurl.h
@@ -158,7 +158,7 @@
@@ -160,7 +160,7 @@ class MediaCurl : public MediaHandler
*/
std::string getAuthHint() const;

Expand All @@ -151,3 +155,6 @@ index 48a8dcf..816a4f1 100644

bool detectDirIndex() const;

--
1.9.1

25 changes: 25 additions & 0 deletions rpm/0005-Disable-docs-building-with-force.patch
@@ -0,0 +1,25 @@
From 86e1f702c8348db64c84e6515004729e110e5e31 Mon Sep 17 00:00:00 2001
From: Niels Breet <niels.breet@jolla.com>
Date: Tue, 27 Oct 2020 17:01:42 +0200
Subject: [PATCH] Disable docs building with force

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3945f8..c548b77 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -319,7 +319,7 @@ ADD_SUBDIRECTORY( zypp )
# do not build devel by default
ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( tools )
-ADD_SUBDIRECTORY( doc )
+# ADD_SUBDIRECTORY( doc )

IF ( ENABLE_BUILD_TRANS )
ADD_SUBDIRECTORY( po )
--
1.9.1

19 changes: 0 additions & 19 deletions rpm/0005-disable-doc.patch

This file was deleted.

65 changes: 65 additions & 0 deletions rpm/0006-Use-rpm-platform-for-architecture-autodetection.patch
@@ -0,0 +1,65 @@
From d55afcc05982769183c5d78e158157065a12d7db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juho=20H=C3=A4m=C3=A4l=C3=A4inen?=
<juho.hamalainen@jolla.com>
Date: Wed, 25 Nov 2020 14:03:30 +0200
Subject: [PATCH] Use rpm platform for architecture autodetection.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If /etc/rpm/platform file exists use the architecture defined. This way
we get correct behavior with for example aarch64 kernel and armv7hl
platform.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@jolla.com>
---
zypp/ZConfig.cc | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

diff --git a/zypp/ZConfig.cc b/zypp/ZConfig.cc
index 3bf1185af..9ebccea51 100644
--- a/zypp/ZConfig.cc
+++ b/zypp/ZConfig.cc
@@ -164,6 +164,39 @@ namespace zypp
architecture = Arch_ppc64p7;
}
#endif
+
+ /* JB#51353 - We need to override architecture when we get certain architectures from uname
+ * which don't match platform. For example aarch64 kernel with armv7hl platform.
+ * This detection mimics what is implemented in kickstart file, writing platform architecture
+ * to /etc/rpm/platform - rpm uses this file to get it right and we use it now as well.
+ * */
+ std::ifstream rpm_platform( "/etc/rpm/platform" );
+
+ if ( rpm_platform )
+ {
+ std::string rpmArch;
+
+ for( iostr::EachLine in( rpm_platform ); in; in.next() )
+ {
+ std::string s = *in;
+ size_t pos = s.find ("-");
+
+ if ( pos != std::string::npos )
+ {
+ rpmArch = s.substr (0, pos);
+ break;
+ }
+ }
+
+ if ( !rpmArch.empty() && rpmArch != architecture.asString() )
+ {
+ MIL << "Uname is '" << architecture
+ << "' but /etc/rpm/platform architecture is '" << rpmArch
+ << "' - use what platform says." << endl;
+ architecture = Arch(rpmArch);
+ }
+ }
+
return architecture;
}

--
2.25.1

0 comments on commit a27422e

Please sign in to comment.