From: DongHun Kwak Date: Tue, 1 Nov 2016 01:30:39 +0000 (+0900) Subject: Imported Upstream version 14.30.1 X-Git-Tag: upstream/16.3.1~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df0780a22057d1d3ec1532f44ca9596a91dacfa3;p=platform%2Fupstream%2Flibzypp.git Imported Upstream version 14.30.1 Change-Id: I46561d8f46640225df2269c40cb3440c7ab3ac0d Signed-off-by: DongHun Kwak --- diff --git a/VERSION.cmake b/VERSION.cmake index 2fc3a31..52455af 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "30") SET(LIBZYPP_MINOR "30") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "1") # -# LAST RELEASED: 14.30.0 (30) +# LAST RELEASED: 14.30.1 (30) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/doc/autoinclude/PatternPackages.doc b/doc/autoinclude/PatternPackages.doc new file mode 100644 index 0000000..9fc2e0d --- /dev/null +++ b/doc/autoinclude/PatternPackages.doc @@ -0,0 +1,66 @@ +/** + +\page zypp-pattern-packages Code 12 Pattern Packages + +\author Michael Andres + +
+ +\section zypp-pattern-packages_intro Intro + +Since Code12 (SLES-12) we utilizes a new method of defining patterns, as opposed to the older XML-based patterns files. A pattern and it's dependencies are now represented by an rpm package and the few pattern specific properties are provided by the package. No extra XML-file is needed. + +By convention a patterns package for a \c pattern:FOO is named \c patterns-*-FOO and is must provide \c pattern() \c = \c apparmor. The pattens content is expressed by dependencies to other packages and patterns-packages. + +The list of provides used for the new pattern pseudo-package autogeneration: + +\code + Provides: pattern-category() = STRING + Provides: pattern-category(de) = STRING + (... other languages ...) + Provides: pattern-includes() = STRING + Provides: pattern-extends() = STRING + Provides: pattern-icon() = STRING + Provides: pattern-order() = STRING + Provides: pattern-visible() + + STRING must be url-hexencoded so that it does not contain any characters + that rpm provides can't have. E.g.: + ' ' => %20 + ',' => %2C + '-' => %2D +\endcode + +\code +patterns-sles-Minimal-12-37.1.x86_64.rpm + PROVIDES { + pattern() == Minimal + pattern-icon() == pattern-basis + pattern-order() == 1099 + pattern-visible() + pattern-category() == Base%20Technologies + pattern-category(ar) == %D8%A7%D9%84%D8%AA%D9%83%D9%86%D9%88%D9%84%D9%88%D8%AC%D9%8A%D8%A7%D8%AA%20%D8%A7%D9%84%D8%A3%D8%B3%D8%A7%D8%B3%D9%8A%D8%A9 + pattern-category(ca) == Tecnologies%20de%20base + pattern-category(cs) == Z%C3%A1kladn%C3%AD%20technologie + pattern-category(da) == Basisteknologier + pattern-category(de) == Basistechnologien + ... +} + REQUIRES { + systemd + coreutils + insserv + aaa_base + ... +} + RECOMMENDS (22){ + grub2 + rpcbind + nfs-client + rsyslog + ... +} +\endcode + + +*/ diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 346aabc..ec29e41 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -19,12 +19,13 @@ %define force_gcc_46 0 Name: @PACKAGE@ -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Summary: Package, Patch, Pattern, and Product Management -License: GPL-2.0+ -Group: System/Packages Version: @VERSION@ Release: 0 +License: GPL-2.0+ +Url: git://gitorious.org/opensuse/libzypp.git +Summary: Package, Patch, Pattern, and Product Management +Group: System/Packages +BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{version}.tar.bz2 Source1: %{name}-rpmlintrc Provides: yast2-packagemanager @@ -145,6 +146,10 @@ Authors: Ladislav Slezak %package devel +Summary: Package, Patch, Pattern, and Product Management - developers files +Group: Development/Libraries/C and C++ +Provides: yast2-packagemanager-devel +Obsoletes: yast2-packagemanager-devel Requires: boost-devel Requires: bzip2 Requires: glibc-devel @@ -178,25 +183,19 @@ Requires: libcurl-devel >= %{min_curl_version} %else Requires: libsolv-devel %endif + +%description devel +Package, Patch, Pattern, and Product Management - developers files + +%package devel-doc Summary: Package, Patch, Pattern, and Product Management - developers files -Group: System/Packages +Group: Documentation/HTML Provides: yast2-packagemanager-devel Obsoletes: yast2-packagemanager-devel -%description -n libzypp-devel +%description devel-doc Package, Patch, Pattern, and Product Management - developers files -Authors: --------- - Michael Andres - Jiri Srain - Stefan Schubert - Duncan Mac-Vicar - Klaus Kaempf - Marius Tomaschewski - Stanislav Visnovsky - Ladislav Slezak - %prep %setup -q @@ -371,9 +370,12 @@ rm -rf "$RPM_BUILD_ROOT" %files devel %defattr(-,root,root) %{_libdir}/libzypp.so -%{_docdir}/%{name} %{_includedir}/zypp %{_datadir}/cmake/Modules/* %{_libdir}/pkgconfig/libzypp.pc +%files devel-doc +%defattr(-,root,root) +%{_docdir}/%{name} + %changelog diff --git a/package/libzypp.changes b/package/libzypp.changes index 5860f40..0b2e2f5 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Mon Oct 27 11:38:00 CET 2014 - ma@suse.de + +- doc: add hint to code 12 pattern packages +- MediaCurl: Fix URL path concatenation (bnc#901590) +- Move doxygen html doc to libzypp-devel-doc (bnc#901691) +- Remove non-breaking spaces from changes file +- Control lifetime of downloaded mirrorlist +- version 14.30.1 (30) + +------------------------------------------------------------------- +Thu Oct 16 11:03:11 CEST 2014 - ma@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- Wed Oct 15 15:07:09 CEST 2014 - ma@suse.de - Store baseurls in list as order expresses preference @@ -89,7 +104,7 @@ Tue Sep 16 10:45:39 CEST 2014 - ma@suse.de - DiskUsageCounter: Set growonly on detetcted snapshotting btrfs partitions (bnc#896176) - DiskUsageCounter: Allow MountPoint to store fstype -- DiskUsageCounter: Support setting 'growonly' partition hint +- DiskUsageCounter: Support setting 'growonly' partition hint (bnc#896176) - version 14.29.0 (29) @@ -112,7 +127,7 @@ Fri Aug 29 14:46:25 CEST 2014 - ma@suse.de - PackageProvider: consider toplevel cache if --root or --pkg-cachedir is used. -- Cleanup orpahned cache dirs only at zypp.conf default locations +- Cleanup orpahned cache dirs only at zypp.conf default locations (bnc#891515) - Remove orphaned package caches on refresh (bnc#888919) - version 14.27.2 (27) @@ -191,7 +206,7 @@ Wed May 28 13:41:22 CEST 2014 - ma@suse.de ------------------------------------------------------------------- Tue May 27 16:31:21 CEST 2014 - ma@suse.de -- Let ServiceRefresh en-/disable repos with respect to previous state +- Let ServiceRefresh en-/disable repos with respect to previous state and user modifications. - RepoindexFileReader: support variable substitution - Parse optional autorefresh attribute from repoindex.xml @@ -208,7 +223,7 @@ Wed May 14 13:52:38 CEST 2014 - ma@suse.de ------------------------------------------------------------------- Thu May 8 18:54:25 CEST 2014 - ma@suse.de -- KeyRingReport: New infoVerify callback showing the trusted key +- KeyRingReport: New infoVerify callback showing the trusted key that will be used for verification. - version 14.19.0 (19) @@ -284,7 +299,7 @@ Wed Feb 26 15:06:06 CET 2014 - ma@suse.de ------------------------------------------------------------------- Tue Feb 25 13:42:13 CET 2014 - ma@suse.de -- Remove duplicate code detecting known kinds and move it to +- Remove duplicate code detecting known kinds and move it to ResKind::explicitBuiltin. - version 14.16.0 (16) @@ -385,7 +400,7 @@ Tue Jan 14 18:38:49 CET 2014 - ma@suse.de - Improve ProgressData reporting. - Allow xml::escape directly dumping to a stream. -- Add support for repo authentication using SSL client certificates +- Add support for repo authentication using SSL client certificates (bnc#683914) - Enhance Queue to perform COW - fix documentation @@ -413,9 +428,9 @@ Thu Dec 12 18:01:18 CET 2013 - ma@suse.de ------------------------------------------------------------------- Wed Dec 4 12:54:30 UTC 2013 - jreidinger@suse.com -- Drop package-manager script as it is already deprecated and +- Drop package-manager script as it is already deprecated and packagekit usage in desktop invalidates it. If someone really - need it, then place it to proper top level package which can + need it, then place it to proper top level package which can decide what GUI is proper for given task. ------------------------------------------------------------------- @@ -423,7 +438,7 @@ Wed Nov 20 16:32:30 CET 2013 - ma@suse.de - Extend commit plugin to send the transaction list (Fate#316203) - Add base/Json.h: JSON encoder for e.g. sending data to plugins -- Re-evaluate dropped packages list on upgrade, even if product +- Re-evaluate dropped packages list on upgrade, even if product remains unchanged (bnc#849251). - Add ppc64le architecture - Add m68k architecture @@ -8009,7 +8024,7 @@ Fri Aug 11 17:01:33 CEST 2006 - dmacvicar@suse.de - forward port 3924:3939 - Add explicit finish callbacks for subtasks during ProvidePackage -  to avoid UI confusion. + to avoid UI confusion. - rev3957 ------------------------------------------------------------------- @@ -8100,7 +8115,7 @@ Tue Jul 18 17:42:45 CEST 2006 - dmacvicar@suse.de Tue Jul 18 12:56:17 CEST 2006 - dmacvicar@suse.de - Digest: Don't read the stream character wise but reading blocks, -  as advised by matz profiling. + as advised by matz profiling. - r3819 ------------------------------------------------------------------- @@ -8293,7 +8308,7 @@ Wed Jun 7 01:00:05 CEST 2006 - dmacvicar@suse.de - Fixes unneeded file download, and add download callbacks (still need yast side) #181204 and #160206 - Fix stalle tmpdir due to cyclic references, using a master -  TmpDir for zypp. # 178292 + TmpDir for zypp. # 178292 ------------------------------------------------------------------- Wed Jun 7 00:02:18 CEST 2006 - ma@suse.de @@ -8396,11 +8411,11 @@ Wed May 24 15:30:32 CEST 2006 - dmacvicar@suse.de - dont pass root on init but before. - implement rpm db modification timestamp -  not used yet + not used yet - move Helix source to testsuite out of the solver so we can use it for target, storage tests - add Source_Ref::timestamp(), default to now() -  in order to implement smart sync of sources by zmd + in order to implement smart sync of sources by zmd - don't parse desc and summary twice - fix a segfault with tranlated text - fix broken size tag introduced in rev 3427 @@ -8613,7 +8628,7 @@ Wed May 3 17:40:45 CEST 2006 - dmacvicar@suse.de Wed May 3 15:34:00 CEST 2006 - dmacvicar@suse.de - use --no-default-keyring to avoid creating a -  default gpg dir in / (#171055) + default gpg dir in / (#171055) - rev 3335 ------------------------------------------------------------------- diff --git a/po/zypp-po.tar.bz2 b/po/zypp-po.tar.bz2 index 7f4d400..0a89111 100644 Binary files a/po/zypp-po.tar.bz2 and b/po/zypp-po.tar.bz2 differ diff --git a/tests/zypp/RepoInfo_test.cc b/tests/zypp/RepoInfo_test.cc index 55ca91c..232e238 100644 --- a/tests/zypp/RepoInfo_test.cc +++ b/tests/zypp/RepoInfo_test.cc @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(repoinfo_test) ri.setMirrorListUrl(weburl); - BOOST_CHECK(ri.url().asString() == "ftp://ftp-stud.hs-esslingen.de/pub/fedora/linux/updates/13/x86_64/"); + BOOST_CHECK(ri.url().asString() == "http://ftp-stud.hs-esslingen.de/pub/fedora/linux/updates/13/x86_64/"); ostringstream ostr; ri.dumpAsIniOn(ostr); diff --git a/zypp/PathInfo.cc b/zypp/PathInfo.cc index fed07df..4334c4e 100644 --- a/zypp/PathInfo.cc +++ b/zypp/PathInfo.cc @@ -18,7 +18,7 @@ #include #include -#include "zypp/base/Logger.h" +#include "zypp/base/LogTools.h" #include "zypp/base/String.h" #include "zypp/base/IOStream.h" #include "zypp/base/StrMatcher.h" @@ -641,6 +641,9 @@ namespace zypp } ); } + std::ostream & operator<<( std::ostream & str, const DirContent & obj ) + { return dumpRange( str, obj.begin(), obj.end() ); } + /////////////////////////////////////////////////////////////////// // is_empty_dir /////////////////////////////////////////////////////////////////// diff --git a/zypp/PathInfo.h b/zypp/PathInfo.h index 8209bad..4a59492 100644 --- a/zypp/PathInfo.h +++ b/zypp/PathInfo.h @@ -540,9 +540,14 @@ namespace zypp bool operator==( const DirEntry &rhs ) const; }; + inline std::ostream & operator<<( std::ostream & str, const DirEntry & obj ) + { return str << '[' << obj.type << "] " << obj.name; } + /** Returned by readdir. */ typedef std::list DirContent; + std::ostream & operator<<( std::ostream & str, const DirContent & obj ); + /** * Return content of directory via retlist. If dots is false * entries starting with '.' are not reported. "." and ".." diff --git a/zypp/RepoInfo.cc b/zypp/RepoInfo.cc index a8dcaa0..fa5626a 100644 --- a/zypp/RepoInfo.cc +++ b/zypp/RepoInfo.cc @@ -12,7 +12,7 @@ #include #include -#include "zypp/base/Logger.h" +#include "zypp/base/LogTools.h" #include "zypp/base/DefaultIntegral.h" #include "zypp/parser/xml/XmlEscape.h" @@ -80,10 +80,8 @@ namespace zypp { emptybaseurls = true; DBG << "MetadataPath: " << metadatapath << endl; - const std::vector & rmurls( ( metadatapath.empty() - ? repo::RepoMirrorList( getmirrorListUrl() ) - : repo::RepoMirrorList( getmirrorListUrl(), metadatapath ) ).getUrls() ); - _baseUrls.insert( _baseUrls.end(), rmurls.begin(), rmurls.end() ); + repo::RepoMirrorList rmurls( getmirrorListUrl(), metadatapath ); + _baseUrls.insert( _baseUrls.end(), rmurls.getUrls().begin(), rmurls.getUrls().end() ); } return _baseUrls; } diff --git a/zypp/base/LogTools.h b/zypp/base/LogTools.h index b73013c..0e9b9cf 100644 --- a/zypp/base/LogTools.h +++ b/zypp/base/LogTools.h @@ -120,8 +120,8 @@ namespace zypp std::ostream & operator<<( std::ostream & str, const std::vector<_Tp> & obj ) { return dumpRange( str, obj.begin(), obj.end() ); } - template - std::ostream & operator<<( std::ostream & str, const std::set<_Tp> & obj ) + template + std::ostream & operator<<( std::ostream & str, const std::set<_Tp,_Cmp,_Alloc> & obj ) { return dumpRange( str, obj.begin(), obj.end() ); } template diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc index 444bfc7..d77be2c 100644 --- a/zypp/media/MediaCurl.cc +++ b/zypp/media/MediaCurl.cc @@ -838,27 +838,15 @@ void MediaCurl::releaseFrom( const std::string & ejectDev ) Url MediaCurl::getFileUrl( const Pathname & filename_r ) const { - std::string path( _url.getPathName() ); // Simply extend the URLs pathname. An 'absolute' URL path - // is achieved by encoding the 2nd '/' in the URL: - // URL: ftp://user@server -> ~user - // URL: ftp://user@server/ -> ~user - // URL: ftp://user@server// -> / + // is achieved by encoding the leading '/' in an URL path: + // URL: ftp://user@server -> ~user + // URL: ftp://user@server/ -> ~user + // URL: ftp://user@server// -> ~user + // URL: ftp://user@server/%2F -> / // ^- this '/' is just a separator - if ( path.empty() || path == "/" ) // empty URL path; the '/' is just a separator - { - path = filename_r.absolutename().asString(); - } - else if ( *path.rbegin() == '/' ) - { - path += filename_r.absolutename().asString().substr(1); - } - else - { - path += filename_r.absolutename().asString(); - } Url newurl( _url ); - newurl.setPathName( path ); + newurl.setPathName( ( Pathname("./"+_url.getPathName()) / filename_r ).asString().substr(1) ); return newurl; } diff --git a/zypp/repo/RepoMirrorList.cc b/zypp/repo/RepoMirrorList.cc index ed8c81e..ad44f25 100644 --- a/zypp/repo/RepoMirrorList.cc +++ b/zypp/repo/RepoMirrorList.cc @@ -32,15 +32,37 @@ namespace zypp /////////////////////////////////////////////////////////////////// namespace { - /** Provide mirrorlist in a local file */ - Pathname RepoMirrorListProvide( const Url & url_r ) + /////////////////////////////////////////////////////////////////// + /// \class RepoMirrorListTempProvider + /// \brief Provide access to downloaded mirror list (in temp space) + /// \ingroup g_RAII + /// + /// Tempspace (and mirror list) are deleted when provider goes out + /// of scope. + struct RepoMirrorListTempProvider { - Url abs_url( url_r ); - abs_url.setPathName( "/" ); - abs_url.setQueryParam( "mediahandler", "curl" ); - MediaSetAccess access( abs_url ); - return access.provideFile( url_r.getPathName() ); - } + RepoMirrorListTempProvider() + {} + RepoMirrorListTempProvider( const Pathname & localfile_r ) + : _localfile( localfile_r ) + {} + RepoMirrorListTempProvider( const Url & url_r ) + { + Url abs_url( url_r ); + abs_url.setPathName( "/" ); + abs_url.setQueryParam( "mediahandler", "curl" ); + _access.reset( new MediaSetAccess( abs_url ) ); + _localfile = _access->provideFile( url_r.getPathName() ); + } + + const Pathname & localfile() const + { return _localfile; } + + private: + shared_ptr _access; + Pathname _localfile; + }; + /////////////////////////////////////////////////////////////////// inline std::vector RepoMirrorListParseXML( const Pathname &tmpfile ) { @@ -65,6 +87,8 @@ namespace zypp /** Parse a local mirrorlist \a listfile_r and return usable URLs */ inline std::vector RepoMirrorListParse( const Url & url_r, const Pathname & listfile_r ) { + USR << url_r << " " << listfile_r << endl; + std::vector mirrorurls; if ( url_r.asString().find( "/metalink" ) != string::npos ) mirrorurls = RepoMirrorListParseXML( listfile_r ); @@ -99,11 +123,18 @@ namespace zypp { if ( url_r.getScheme() == "file" ) { - // no cache for local mirrorlist + // never cache for local mirrorlist _urls = RepoMirrorListParse( url_r, url_r.getPathName() ); } + else if ( ! PathInfo( metadatapath_r).isDir() ) + { + // no cachedir + RepoMirrorListTempProvider provider( url_r ); // RAII: lifetime of any downloaded files + _urls = RepoMirrorListParse( url_r, provider.localfile() ); + } else { + // have cachedir Pathname cachefile( metadatapath_r ); if ( url_r.asString().find( "/metalink" ) != string::npos ) cachefile /= "mirrorlist.xml"; @@ -114,12 +145,12 @@ namespace zypp if ( !cacheinfo.isFile() || cacheinfo.mtime() < time(NULL) - (long) ZConfig::instance().repo_refresh_delay() * 60 ) { DBG << "Getting MirrorList from URL: " << url_r << endl; - Pathname localfile( RepoMirrorListProvide( url_r ) ); + RepoMirrorListTempProvider provider( url_r ); // RAII: lifetime of downloaded file // Create directory, if not existing DBG << "Copy MirrorList file to " << cachefile << endl; zypp::filesystem::assert_dir( metadatapath_r ); - zypp::filesystem::hardlinkCopy( localfile, cachefile ); + zypp::filesystem::hardlinkCopy( provider.localfile(), cachefile ); } _urls = RepoMirrorListParse( url_r, cachefile ); @@ -131,15 +162,6 @@ namespace zypp } } - RepoMirrorList::RepoMirrorList( const Url & url_r ) - { - DBG << "Getting MirrorList from URL: " << url_r << endl; - Pathname localfile( url_r.getScheme() == "file" - ? url_r.getPathName() - : RepoMirrorListProvide( url_r ) ); - _urls = RepoMirrorListParse( url_r, localfile ); - } - ///////////////////////////////////////////////////////////////// } // namespace repo /////////////////////////////////////////////////////////////////// diff --git a/zypp/repo/RepoMirrorList.h b/zypp/repo/RepoMirrorList.h index 85b2852..e6ad1fd 100644 --- a/zypp/repo/RepoMirrorList.h +++ b/zypp/repo/RepoMirrorList.h @@ -21,16 +21,17 @@ namespace zypp class RepoMirrorList { public: - RepoMirrorList( const Url & url_r ); - RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r ); + RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r = Pathname() ); const std::vector & getUrls() const { return _urls; } + std::vector & getUrls() + { return _urls; } + private: std::vector _urls; }; - } // ns repo } // ns zypp