From: Duncan Mac-Vicar P Date: Mon, 20 Aug 2007 13:27:31 +0000 (+0000) Subject: - add support for the HASH key. (#300982) X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~255 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=244ca2c6e3383475ee56f724c42beaff83f66841;p=platform%2Fupstream%2Flibzypp.git - add support for the HASH key. (#300982) - Use ContentFileParser in Downloader (instead of implementing the parser again, it has a reason, Downloader was written first) - update testcases and data to cover the new HASH key --- diff --git a/tests/repo/susetags/Downloader_test.cc b/tests/repo/susetags/Downloader_test.cc index e0377ca..6996e64 100644 --- a/tests/repo/susetags/Downloader_test.cc +++ b/tests/repo/susetags/Downloader_test.cc @@ -7,6 +7,7 @@ #include #include +#include "zypp/base/Logger.h" #include "zypp/Url.h" #include "zypp/PathInfo.h" #include "zypp/TmpPath.h" @@ -33,6 +34,8 @@ void susetags_download_test(const string &dir) downloader.download(media,localdir); + MIL << "All files downloaded" << endl; + const char* files[] = { "/suse", @@ -102,8 +105,10 @@ void susetags_gz_download_test(const string &dir) // "/media.1/products.key", "/media.1/media", // "/media.1/products", -// "/media.1/info.txt", -// "/media.1/license.zip", + "/media.1/info.txt", + "/license.tar.gz", + "/control.xml", + "/installation.xml", "/gpg-pubkey-a1912208-446a0899.asc", "/gpg-pubkey-307e3d54-44201d5d.asc", "/gpg-pubkey-9c800aca-40d8063e.asc", diff --git a/tests/repo/susetags/data/stable-x86-subset-gz/content b/tests/repo/susetags/data/stable-x86-subset-gz/content index 86cb1ff..9c02308 100644 --- a/tests/repo/susetags/data/stable-x86-subset-gz/content +++ b/tests/repo/susetags/data/stable-x86-subset-gz/content @@ -35,4 +35,8 @@ KEY SHA1 7025932e6866932f489421990075f3ed312023ea gpg-pubkey-3d25d3d9-36e12d04. KEY SHA1 fd6146cac8c1473c5b52548936de773d5bbd5610 gpg-pubkey-7e2e3b05-44748aba.asc KEY SHA1 cd7adceba1fe5d7ba27b5749718743192d82f802 gpg-pubkey-9c800aca-40d8063e.asc KEY SHA1 7535d79e31ef7b4232e5593bb49d9142978b2e95 gpg-pubkey-a1912208-446a0899.asc +HASH SHA1 172b3cf77268f46e783e78a653902e563cb91e9a license.tar.gz +HASH SHA1 4aa8ded6302e6ec85690a51af6044dffe9b21923 control.xml +HASH SHA1 82f1f17ce74f0cd3fca4813c178196b317fc952d installation.xml +HASH SHA1 68d9b548d61e31e82e8834690e884afa27751287 media.1/info.txt diff --git a/tests/repo/susetags/data/stable-x86-subset-gz/content.asc b/tests/repo/susetags/data/stable-x86-subset-gz/content.asc index 6d0e180..c5ff0d5 100644 --- a/tests/repo/susetags/data/stable-x86-subset-gz/content.asc +++ b/tests/repo/susetags/data/stable-x86-subset-gz/content.asc @@ -1,29 +1,32 @@ -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) -owGdVTuIJFUUHXeVhYJFNhAMn2AguN39/p9F0Zrpmg+202tX9TgbDe9XM+3MVDVd -1cyOGhhqIGhiogxGBoogiGwqJoJgbqBmZgaCiaGvuqfd7lVZWGhe0XXvOe/dc05V -fXD96tqVGx///t03v3wl9h778tq+uWbLovZFvXnxVHx70O8ONzJQjn2RDtOklWtb -l5PzaC8ZpDv9XYBgm0TdnTRbdKbT0NUbFdO7rTSL13tJa1/yWccSBLcpXqLa7fYH -oKEHvZ3d4T64PSnd1NYV2Do12zfB7tRPCuMnhzfBlp+c6uI8GiS93X6WpMNBDxzV -9fhWp3N2dtauppVv2/K0M/EnRVn7qjMikncWp+9sxhtZf3CnKXtd+daspz0Zn0bx -YGO7fVfyA07B5WXEJQcj1iy0WQITKEo9sUfz7nn9YU3sIXX6/yXywN1ushkPe9l6 -HIRqKIMKrw13Bkl6357LwcCLM2PAWNd10O6WCfeq86r2p1HwaW+nGzDjuci3Ftg5 -pnEm6q+n/V6SLTU1DQdzc/6Fe2EOjEJ5axinwFbAaeA88EX4HWytA1+BfATyCTia -glEN3tDg+BQUJ6AwYHwCxvXB+gC8eXSwsdus2etRut0fZ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sMwyyCCXde +iLgYYxzjCG4whY/bM5DFdQoqtdGbTOuEjg2IdgieORFdJQwTVAkkBSVIYSdxkBBv +MJWVEGqr6xQ6CTnxV/bOSEQpT5APwlAcZWBRDGOocgpRrIQ00Spsg6mRQjhaPK6T +ayiVWjL3m+n+hW8ENsQGITCXgXIfRzB+NWdEwcjnxBqFvIqCTsY2Pi98Uup5ZZ3H +CKq1dN5xEgu4t5JxBTVDOvCqwyHEoYotqgao+nef55PkbDpZq49KxIEX1gsaoHUk +WE1lNXqismJ0mAhWMewAGGdFqScTXT2krkC4dMrErsVeVgJJ7KUkNK4knqkOUX/B +EJYCgKl3Y52gxjgLeVKelbXaR29df3areuW4fBe5ce2Hl7c+fe2P7Qfdvx7RVz9P +XvntpW97b4wfgK3PPvzqxdGDax8//OLR77+8//pPZ7daf/74Nw== +=3cih -----END PGP MESSAGE----- diff --git a/tests/repo/susetags/data/stable-x86-subset-gz/control.xml b/tests/repo/susetags/data/stable-x86-subset-gz/control.xml new file mode 100644 index 0000000..096763e --- /dev/null +++ b/tests/repo/susetags/data/stable-x86-subset-gz/control.xml @@ -0,0 +1,793 @@ + + + + + + control + + + true + true + false + never + 95 + true + true + simple + false + true + true + true + true + false + true + false + + + + + /root/ + /root/inst-sys/ + + + + + + false + auto + + + http://download.opensuse.org/YaST/Repos/openSUSE_103_Servers.xml + + + + false + true + 7G + 40 + 5G + 20G + false + false + 15G + 25G + false + + + + false + laptop + ifplugd + + + + language + keyboard + timezone + users + networking + firewall + host + routing + proxy + runlevel + x11 + nis + ldap + printer + add-on + + + + + + + + + + + + installation,demo,autoinstallation + initial + initial + no + + hwinfo + keyboard + mouse + partitions + software + bootloader + timezone + language + runlevel + + + + + + partitions + software_simple + country_simple + + + + + + hwinfo + keyboard + mouse + partitions + software + bootloader + timezone + language + runlevel + + + + + + + + update + initial + normal + no + + update + packages + backup + language + + + + + + update + initial + initial + no + + hwinfo + media + + update + packages + backup + language + keyboard + + + + + + network + continue,normal + yes + + + lan + 20 + + + general + 5 + + + dsl + 30 + + + isdn + 40 + + + modem + 50 + + + remote + 60 + + + firewall + 10 + + + proxy + 70 + + + + + + + hardware + continue + yes + + x11 + printer + sound + tv + bluetooth + + + + + + + + + all + yes + yes + + + installation + initial + + + language + + no + yes + + yes + + true + + + + checkmedia + + + + license + + + + disks_activate + + + + system_analysis + + + + + productsources + yes + + + + add-on + yes + + + + timezone + + yes + + yes + + + + desktop + + + yes + + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + finish + no + + + + + + + + all + yes + yes + + + update + initial + + + language + + no + + yes + + true + + + + checkmedia + + + + license + + + + disks_activate + + + + system_analysis + + + + update_partition + + + upgrade_urls + + + + productsources + yes + + + + add-on + yes + + + yes + + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + finish + no + + + + + + all + + initial + + repair + + + + info + + + + repair + + + + + + + + all + yes + yes + + initial + + screen_shot + + + no + yes + + language + true + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + yes + + + + + + + + all + yes + yes + + initial + + demo + + + no + + language + true + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + + + + continue + update + + all + yes + yes + + + + + rpmcopy + no + no + + + yes + + + + + ask_net_test + no + + + + do_net_test + + + + addon_update_sources + + + + suse_register + + + + ask_online_update + + + + you + + + + restore_settings + + + suseconfig + no + no + + + + release_notes + + + congratulate + + + + + + + continue + installation + + yes + yes + all + + + + yes + + + + + root + no + + + + initialization + no + no + + + + netprobe + no + no + + + + rpmcopy + no + no + + + + hostname + + + + proposal + network + + + + fam + + + + ask_net_test + + + + do_net_test + + + + addon_update_sources + + + + suse_register + + + + ask_online_update + + + + you + + + + extrasources + + + + restore_settings + + + + auth + + + + user + + + suseconfig + no + no + + + + release_notes + + + + proposal + hardware + + + + save_hardware_status + + + congratulate + + + + + + + initial + + autoinstallation + + all + no + no + + + + + autoinit + all + true + + + + autosetup + + + + proposal + initial + no + yes + + + + prepdisk + + + + kickoff + + + + autoimage + + + + rpmcopy + + + + finish + + + + + + + + all + no + no + + continue + autoinstallation + + + + netprobe + + + + autopost + + + + rpmcopy + + + yes + + + + + autoconfigure + + + suseconfig + + + + + diff --git a/tests/repo/susetags/data/stable-x86-subset-gz/installation.xml b/tests/repo/susetags/data/stable-x86-subset-gz/installation.xml new file mode 100644 index 0000000..f71e6b7 --- /dev/null +++ b/tests/repo/susetags/data/stable-x86-subset-gz/installation.xml @@ -0,0 +1,109 @@ + + + + control-ISSLE + + false + + + auto + + + true + + + + + + + + + + product + continue,normal + installation + + yast2-issleconfig + + + + + + + no + no + + normal + installation,normal + + + + sw_single + yes + yes + + + + issleconfig + yes + yes + + + + inst_release_notes + yes + yes + + + inst_congratulate + no + yes + + + + + + + + + no + no + + continue,normal + installation,normal,update + + hostname + root + ca_mgm + + + + yast2-issleconfig + + + + + suseconfig + + + + issleconfig + yes + yes + + + + + + + + diff --git a/tests/repo/susetags/data/stable-x86-subset-gz/license.tar.gz b/tests/repo/susetags/data/stable-x86-subset-gz/license.tar.gz new file mode 100644 index 0000000..ecd631d Binary files /dev/null and b/tests/repo/susetags/data/stable-x86-subset-gz/license.tar.gz differ diff --git a/tests/repo/susetags/data/stable-x86-subset/content b/tests/repo/susetags/data/stable-x86-subset/content index 1bea044..fb211e2 100644 --- a/tests/repo/susetags/data/stable-x86-subset/content +++ b/tests/repo/susetags/data/stable-x86-subset/content @@ -35,4 +35,8 @@ KEY SHA1 7025932e6866932f489421990075f3ed312023ea gpg-pubkey-3d25d3d9-36e12d04. KEY SHA1 fd6146cac8c1473c5b52548936de773d5bbd5610 gpg-pubkey-7e2e3b05-44748aba.asc KEY SHA1 cd7adceba1fe5d7ba27b5749718743192d82f802 gpg-pubkey-9c800aca-40d8063e.asc KEY SHA1 7535d79e31ef7b4232e5593bb49d9142978b2e95 gpg-pubkey-a1912208-446a0899.asc +HASH SHA1 172b3cf77268f46e783e78a653902e563cb91e9a license.tar.gz +HASH SHA1 4aa8ded6302e6ec85690a51af6044dffe9b21923 control.xml +HASH SHA1 82f1f17ce74f0cd3fca4813c178196b317fc952d installation.xml +HASH SHA1 68d9b548d61e31e82e8834690e884afa27751287 media.1/info.txt diff --git a/tests/repo/susetags/data/stable-x86-subset/content.asc b/tests/repo/susetags/data/stable-x86-subset/content.asc index 6d0e180..e4b185a 100644 --- a/tests/repo/susetags/data/stable-x86-subset/content.asc +++ b/tests/repo/susetags/data/stable-x86-subset/content.asc @@ -1,29 +1,32 @@ -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) -owGdVTuIJFUUHXeVhYJFNhAMn2AguN39/p9F0Zrpmg+202tX9TgbDe9XM+3MVDVd -1cyOGhhqIGhiogxGBoogiGwqJoJgbqBmZgaCiaGvuqfd7lVZWGhe0XXvOe/dc05V -fXD96tqVGx///t03v3wl9h778tq+uWbLovZFvXnxVHx70O8ONzJQjn2RDtOklWtb -l5PzaC8ZpDv9XYBgm0TdnTRbdKbT0NUbFdO7rTSL13tJa1/yWccSBLcpXqLa7fYH -oKEHvZ3d4T64PSnd1NYV2Do12zfB7tRPCuMnhzfBlp+c6uI8GiS93X6WpMNBDxzV -9fhWp3N2dtauppVv2/K0M/EnRVn7qjMikncWp+9sxhtZf3CnKXtd+daspz0Zn0bx -YGO7fVfyA07B5WXEJQcj1iy0WQITKEo9sUfz7nn9YU3sIXX6/yXywN1ushkPe9l6 -HIRqKIMKrw13Bkl6357LwcCLM2PAWNd10O6WCfeq86r2p1HwaW+nGzDjuci3Ftg5 -pnEm6q+n/V6SLTU1DQdzc/6Fe2EOjEJ5axinwFbAaeA88EX4HWytA1+BfATyCTia -glEN3tDg+BQUJ6AwYHwCxvXB+gC8eXSwsdus2etRut0fZL14PemBS8ei+b9/9ry8 -PY/frNY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+jHNBSIIvcKoI5Tks4JyKa+vsRU4flA3Qf5akKIJylionFDeKaMUZMTRoCo7SC5zG +a4ytt3WOg8aSxcdqFwyoTGQkJuhGCjIIEMM5boIhnBqlHYXGv8BpiSGUYvCIS4u1 +Maec261se0lKFHXMw3BQqROXUWkGXysFMxj4JfPOkGhA0PHIw9MhNko7b+zfXaHg +1uoQg2QAkNFrIQ22gtgkK4dTijCCUDHMTfVfPp+OG8eT8QoelCCJKJgYnrAPLHmY +JJgBoqpWhA5TyRtBYfpHeVHa8dhWj6THSKSGSQfXwMtKIE2j1ozDSWDlNoH+ShCq +YXgmMYxsgzRHeZo2yuOyVvv4zSvPrFUvGOdvHlcv7369dv/mg2voz8/ev/Ti7R+u +vfyFunb8x88frd133z544eFPv3y49v3ll1595bcf//rkrYd/Aw== +=/aaM -----END PGP MESSAGE----- diff --git a/tests/repo/susetags/data/stable-x86-subset/control.xml b/tests/repo/susetags/data/stable-x86-subset/control.xml new file mode 100644 index 0000000..096763e --- /dev/null +++ b/tests/repo/susetags/data/stable-x86-subset/control.xml @@ -0,0 +1,793 @@ + + + + + + control + + + true + true + false + never + 95 + true + true + simple + false + true + true + true + true + false + true + false + + + + + /root/ + /root/inst-sys/ + + + + + + false + auto + + + http://download.opensuse.org/YaST/Repos/openSUSE_103_Servers.xml + + + + false + true + 7G + 40 + 5G + 20G + false + false + 15G + 25G + false + + + + false + laptop + ifplugd + + + + language + keyboard + timezone + users + networking + firewall + host + routing + proxy + runlevel + x11 + nis + ldap + printer + add-on + + + + + + + + + + + + installation,demo,autoinstallation + initial + initial + no + + hwinfo + keyboard + mouse + partitions + software + bootloader + timezone + language + runlevel + + + + + + partitions + software_simple + country_simple + + + + + + hwinfo + keyboard + mouse + partitions + software + bootloader + timezone + language + runlevel + + + + + + + + update + initial + normal + no + + update + packages + backup + language + + + + + + update + initial + initial + no + + hwinfo + media + + update + packages + backup + language + keyboard + + + + + + network + continue,normal + yes + + + lan + 20 + + + general + 5 + + + dsl + 30 + + + isdn + 40 + + + modem + 50 + + + remote + 60 + + + firewall + 10 + + + proxy + 70 + + + + + + + hardware + continue + yes + + x11 + printer + sound + tv + bluetooth + + + + + + + + + all + yes + yes + + + installation + initial + + + language + + no + yes + + yes + + true + + + + checkmedia + + + + license + + + + disks_activate + + + + system_analysis + + + + + productsources + yes + + + + add-on + yes + + + + timezone + + yes + + yes + + + + desktop + + + yes + + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + finish + no + + + + + + + + all + yes + yes + + + update + initial + + + language + + no + + yes + + true + + + + checkmedia + + + + license + + + + disks_activate + + + + system_analysis + + + + update_partition + + + upgrade_urls + + + + productsources + yes + + + + add-on + yes + + + yes + + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + finish + no + + + + + + all + + initial + + repair + + + + info + + + + repair + + + + + + + + all + yes + yes + + initial + + screen_shot + + + no + yes + + language + true + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + yes + + + + + + + + all + yes + yes + + initial + + demo + + + no + + language + true + + + + proposal + initial + + + + do_resize + false + i386,x86_64,ia64 + + + + prepdisk + + + + kickoff + + + + rpmcopy + no + no + + + + + + + continue + update + + all + yes + yes + + + + + rpmcopy + no + no + + + yes + + + + + ask_net_test + no + + + + do_net_test + + + + addon_update_sources + + + + suse_register + + + + ask_online_update + + + + you + + + + restore_settings + + + suseconfig + no + no + + + + release_notes + + + congratulate + + + + + + + continue + installation + + yes + yes + all + + + + yes + + + + + root + no + + + + initialization + no + no + + + + netprobe + no + no + + + + rpmcopy + no + no + + + + hostname + + + + proposal + network + + + + fam + + + + ask_net_test + + + + do_net_test + + + + addon_update_sources + + + + suse_register + + + + ask_online_update + + + + you + + + + extrasources + + + + restore_settings + + + + auth + + + + user + + + suseconfig + no + no + + + + release_notes + + + + proposal + hardware + + + + save_hardware_status + + + congratulate + + + + + + + initial + + autoinstallation + + all + no + no + + + + + autoinit + all + true + + + + autosetup + + + + proposal + initial + no + yes + + + + prepdisk + + + + kickoff + + + + autoimage + + + + rpmcopy + + + + finish + + + + + + + + all + no + no + + continue + autoinstallation + + + + netprobe + + + + autopost + + + + rpmcopy + + + yes + + + + + autoconfigure + + + suseconfig + + + + + diff --git a/tests/repo/susetags/data/stable-x86-subset/installation.xml b/tests/repo/susetags/data/stable-x86-subset/installation.xml new file mode 100644 index 0000000..f71e6b7 --- /dev/null +++ b/tests/repo/susetags/data/stable-x86-subset/installation.xml @@ -0,0 +1,109 @@ + + + + control-ISSLE + + false + + + auto + + + true + + + + + + + + + + product + continue,normal + installation + + yast2-issleconfig + + + + + + + no + no + + normal + installation,normal + + + + sw_single + yes + yes + + + + issleconfig + yes + yes + + + + inst_release_notes + yes + yes + + + inst_congratulate + no + yes + + + + + + + + + no + no + + continue,normal + installation,normal,update + + hostname + root + ca_mgm + + + + yast2-issleconfig + + + + + suseconfig + + + + issleconfig + yes + yes + + + + + + + + diff --git a/tests/repo/susetags/data/stable-x86-subset/license.tar.gz b/tests/repo/susetags/data/stable-x86-subset/license.tar.gz new file mode 100644 index 0000000..ecd631d Binary files /dev/null and b/tests/repo/susetags/data/stable-x86-subset/license.tar.gz differ diff --git a/zypp/parser/susetags/ContentFileReader.cc b/zypp/parser/susetags/ContentFileReader.cc index 2594b42..13acb78 100644 --- a/zypp/parser/susetags/ContentFileReader.cc +++ b/zypp/parser/susetags/ContentFileReader.cc @@ -473,7 +473,7 @@ namespace zypp { if ( _pimpl->setFileCheckSum( _pimpl->repoindex().signingKeys, value ) ) { - ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [algorithm checksum filename]", *line ) ) ); + ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [KEY algorithm checksum filename]", *line ) ) ); } } else if ( key == "LANGUAGE" ) @@ -496,6 +496,13 @@ namespace zypp ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [algorithm checksum filename]", *line ) ) ); } } + else if ( key == "HASH" ) + { + if ( _pimpl->setFileCheckSum( _pimpl->repoindex().mediaFileChecksums, value ) ) + { + ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [algorithm checksum filename]", *line ) ) ); + } + } else if ( key == "TIMEZONE" ) { _pimpl->repoindex().timezone = value; diff --git a/zypp/parser/susetags/RepoIndex.h b/zypp/parser/susetags/RepoIndex.h index 601e2fc..824ae43 100644 --- a/zypp/parser/susetags/RepoIndex.h +++ b/zypp/parser/susetags/RepoIndex.h @@ -60,6 +60,7 @@ namespace zypp Pathname datadir; FileChecksumMap metaFileChecksums; + FileChecksumMap mediaFileChecksums; FileChecksumMap signingKeys; protected: diff --git a/zypp/repo/susetags/Downloader.cc b/zypp/repo/susetags/Downloader.cc index 5684dea..1f19a2e 100644 --- a/zypp/repo/susetags/Downloader.cc +++ b/zypp/repo/susetags/Downloader.cc @@ -10,11 +10,14 @@ #include "zypp/Locale.h" #include "zypp/ZConfig.h" #include "zypp/repo/MediaInfoDownloader.h" - #include "zypp/repo/susetags/Downloader.h" +#include "zypp/parser/ParseException.h" +#include "zypp/parser/susetags/RepoIndex.h" #include "zypp/base/UserRequestException.h" using namespace std; +using namespace zypp::parser; +using namespace zypp::parser::susetags; namespace zypp { @@ -67,116 +70,125 @@ void Downloader::download( MediaSetAccess &media, this->start( dest_dir, media ); this->reset(); - std::ifstream file((dest_dir + _path + "/content").asString().c_str()); - std::string buffer; Pathname descr_dir; - // FIXME Note this code assumes DESCR comes before as META - string value; - while (file && !file.eof()) + // Content file first to get the repoindex { - getline(file, buffer); - if ( buffer.substr( 0, 5 ) == "DESCR" ) - { - std::vector words; - if ( str::split( buffer, std::back_inserter(words) ) != 2 ) - { - // error - ZYPP_THROW(Exception("bad DESCR line")); - } - descr_dir = words[1]; - } - else if ( buffer.substr( 0, 4 ) == "META" ) + Pathname inputfile( dest_dir + _path + "/content" ); + ContentFileReader content; + content.setRepoIndexConsumer( bind( &Downloader::consumeIndex, this, _1 ) ); + content.parse( inputfile ); + } + if ( ! _repoindex ) + { + ZYPP_THROW( ParseException( (dest_dir+_path).asString() + ": " + "No reository index in content file." ) ); + } + + // Prepare parsing + descr_dir = _repoindex->descrdir; // path below reporoot + //_datadir = _repoIndex->datadir; // path below reporoot + + for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->metaFileChecksums.begin(); + it != _repoindex->metaFileChecksums.end(); + ++it ) + { + // omit unwanted translations + if ( str::hasPrefix( it->first, "packages" ) ) { - std::vector words; - if ( str::split( buffer, std::back_inserter(words) ) != 4 ) - { - // error - ZYPP_THROW(Exception("bad META line")); - } - // omit unwanted translations - if ( str::hasPrefix( words[3], "packages" ) ) + std::string rest( str::stripPrefix( it->first, "packages" ) ); + if ( ! ( rest.empty() + || rest == ".DU" + || rest == ".en" + || rest == ".gz" + || rest == ".DU.gz" + || rest == ".en.gz" ) ) { - std::string rest( str::stripPrefix( words[3], "packages" ) ); - if ( ! ( rest.empty() - || rest == ".DU" - || rest == ".en" - || rest == ".gz" - || rest == ".DU.gz" - || rest == ".en.gz" ) ) + // Not 100% correct as we take each fallback of textLocale + Locale toParse( ZConfig::instance().textLocale() ); + while ( toParse != Locale::noCode ) { - // Not 100% correct as we take each fallback of textLocale - Locale toParse( ZConfig::instance().textLocale() ); - while ( toParse != Locale::noCode ) - { - if ( rest == ("."+toParse.code()) || (rest == ("."+toParse.code()+".gz")) ) - break; - toParse = toParse.fallback(); - } - if ( toParse == Locale::noCode ) - { - // discard - continue; - } + if ( rest == ("."+toParse.code()) || (rest == ("."+toParse.code()+".gz")) ) + break; + toParse = toParse.fallback(); + } + if ( toParse == Locale::noCode ) + { + // discard + continue; } } - else if ( str::endsWith( words[3], ".pat" ) - || str::endsWith( words[3], ".pat.gz" ) ) - { + } + else if ( str::endsWith( it->first, ".pat" ) + || str::endsWith( it->first, ".pat.gz" ) ) + { - // *** see also zypp/parser/susetags/RepoParser.cc *** + // *** see also zypp/parser/susetags/RepoParser.cc *** - // omit unwanted patterns, see https://bugzilla.novell.com/show_bug.cgi?id=298716 - // expect "..pat[.gz]", might contain additional dots - // split at dots, take .pat or .pat.gz into account + // omit unwanted patterns, see https://bugzilla.novell.com/show_bug.cgi?id=298716 + // expect "..pat[.gz]", might contain additional dots + // split at dots, take .pat or .pat.gz into account - std::vector patparts; - unsigned archpos = 2; - // expect "..pat[.gz]", might contain additional dots - unsigned count = str::split( buffer, std::back_inserter(patparts), "." ); - if ( patparts[count-1] == "gz" ) - archpos++; + std::vector patparts; + unsigned archpos = 2; + // expect "..pat[.gz]", might contain additional dots + unsigned count = str::split( it->first, std::back_inserter(patparts), "." ); + if ( patparts[count-1] == "gz" ) + archpos++; - if ( count > archpos ) + if ( count > archpos ) + { + try // might by an invalid architecture { - try // might by an invalid architecture + Arch patarch( patparts[count-archpos] ); + if ( !patarch.compatibleWith( ZConfig::instance().systemArchitecture() ) ) { - Arch patarch( patparts[count-archpos] ); - if ( !patarch.compatibleWith( ZConfig::instance().systemArchitecture() ) ) - { - // discard, if not compatible - MIL << "Discarding pattern " << words[3] << endl; - continue; - } - } - catch ( const Exception & excpt ) - { - WAR << "Pattern file name does not contain recognizable architecture: " << words[3] << endl; - // keep .pat file if it doesn't contain an recognizable arch + // discard, if not compatible + MIL << "Discarding pattern " << it->first << endl; + continue; } } + catch ( const Exception & excpt ) + { + WAR << "Pattern file name does not contain recognizable architecture: " << it->first << endl; + // keep .pat file if it doesn't contain an recognizable arch + } } - OnMediaLocation location( _path + descr_dir + words[3], 1 ); - location.setChecksum( CheckSum( words[1], words[2] ) ); - this->enqueueDigested(location); - } - else if (buffer.substr( 0, 3 ) == "KEY") - { - std::vector words; - if ( str::split( buffer, std::back_inserter(words) ) != 4 ) - { - // error - ZYPP_THROW(Exception("bad KEY line")); - } - OnMediaLocation location( _path + words[3], 1 ); - location.setChecksum( CheckSum( words[1], words[2] ) ); - this->enqueueDigested(location); } + MIL << "adding job " << it->first << endl; + OnMediaLocation location( _path + descr_dir + it->first, 1 ); + location.setChecksum( it->second ); + this->enqueueDigested(location); + } + + for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->signingKeys.begin(); + it != _repoindex->signingKeys.end(); + ++it ) + { + OnMediaLocation location( _path + it->first, 1 ); + location.setChecksum( it->second ); + this->enqueueDigested(location); + } + + // add hashed media files + + for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->mediaFileChecksums.begin(); + it != _repoindex->mediaFileChecksums.end(); + ++it ) + { + OnMediaLocation location( _path + it->first, 1 ); + location.setChecksum( it->second ); + this->enqueueDigested(location); } - file.close(); + this->start( dest_dir, media ); } +void Downloader::consumeIndex( const RepoIndex_Ptr & data_r ) +{ + MIL << "Consuming repo index" << endl; + _repoindex = data_r; +} + }// ns susetags }// ns source } // ns zypp diff --git a/zypp/repo/susetags/Downloader.h b/zypp/repo/susetags/Downloader.h index 384f63b..2092f7f 100644 --- a/zypp/repo/susetags/Downloader.h +++ b/zypp/repo/susetags/Downloader.h @@ -16,6 +16,7 @@ #include "zypp/RepoStatus.h" #include "zypp/MediaSetAccess.h" #include "zypp/repo/Downloader.h" +#include "zypp/parser/susetags/ContentFileReader.h" namespace zypp { @@ -53,8 +54,15 @@ namespace zypp * \short Status of the remote repository */ RepoStatus status( MediaSetAccess &media ); + + /** + * Content file parser consumer + */ + void consumeIndex( const parser::susetags::RepoIndex_Ptr & data_r ); + private: Pathname _path; + parser::susetags::RepoIndex_Ptr _repoindex; }; } // ns susetags