{"id":462,"date":"2023-06-17T21:00:08","date_gmt":"2023-06-17T21:00:08","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=462"},"modified":"2023-06-25T19:43:02","modified_gmt":"2023-06-25T19:43:02","slug":"week-3-report-automated-gentoo-system-updater","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/17\/week-3-report-automated-gentoo-system-updater\/","title":{"rendered":"Week 3 Report, Automated Gentoo System Updater"},"content":{"rendered":"<p>This article is a summary of all the changes made on <a href=\"https:\/\/wiki.gentoo.org\/wiki\/Google_Summer_of_Code\/2023\/Ideas\/Automated_Gentoo_system_updater\">Automated Gentoo System Updater<\/a><br \/>\nproject during <strong>week 3<\/strong> of GSoC&#8217;23.<\/p>\n<p>Project is hosted on <a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">Github<\/a>.<\/p>\n<h3>Progress on Week 3<\/h3>\n<p>Project finally received some Github stars!<\/p>\n<p>It also has received 2 issues (<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\/7\">#7<\/a> and <a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\/8\">#8<\/a>). In <em>#7<\/em> someone suggested to remove <em>update.sh<\/em> from being installed in the PATH, and only expose gentoo-update as entry point. <em>#8<\/em> was a question if the program will be resolving circular dependencies. I was more than happy to solve\/answer both issues, and hope to see more in near future!<\/p>\n<p>ebuild that I have submitted to GURU repository apparently didn&#8217;t pass some CI tests and generated a bunch of errors which I received by email. Luckily for me, some nice maintainers found and fixed the issues, and those problems are solved now. More details in bugs <a href=\"https:\/\/bugs.gentoo.org\/908307\">908307<\/a> and <a href=\"https:\/\/bugs.gentoo.org\/908308\">908308<\/a>. I also received some recommendations about how to avoid similar issues in future from the GURU&#8217;s IRC chat.<\/p>\n<p>I have further improved the updater program code, here is the changelog:<\/p>\n<ul>\n<li>remove updater.sh from PATH<\/li>\n<li>Read PORTAGE_LOGDIR variable from make.conf and use it to store logs.<br \/>\nBy default it will use <em>\/var\/log\/portage\/gentoo_update<\/em><\/li>\n<li>Before running needrestart, eclean or revdep-rebuild check if it&#8217;s installed, print<br \/>\nerror message if not<\/li>\n<li>Add type hints to Python functions and methods<\/li>\n<li>Change <em>set -e<\/em> to <em>set -euo pipefail<\/em> to improve stability of Bash scripts<\/li>\n<\/ul>\n<p>ebuild also received some improvements. Now it defines 2\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_ebuild\/blob\/main\/gentoo_update-0.1.5.ebuild#LL16C1-L21C2\">USE flags <\/a>that will install optional dependencies.<\/p>\n<p>Lastly, I started coding the parser. Parser&#8217;s end goal is to read the log file created by the updater and to create an easy-to-read report that will briefly describe what changes were made on the system.<\/p>\n<p>Oh, and I finally learned how to post blogs on https:\/\/blogs.gentoo.org\/gsoc, it wasn&#8217;t that<br \/>\nhard after all.<\/p>\n<h3>Challenges<\/h3>\n<p>I found it very hard to debug ebuild issues, the <a href=\"https:\/\/devmanual.gentoo.org\/ebuild-writing\/index.html\">documentation <\/a>is actually very helpful but it&#8217;s also gigantic a takes much time to go through. Thankfully GURU team came through to solve the issues I was having.<\/p>\n<p>Apart from that, I am thinking on ways to automate version bumping the updater in GURU repository.<\/p>\n<p>Here are the steps I am taking now to version bump the ebuild:<\/p>\n<ul>\n<li>Push a tag in the Github repository<\/li>\n<li>Sync GURU overlay<\/li>\n<li>Modify ebuild, usually just version bump, but this week I also added USE flags<\/li>\n<li>Run test with -&gt; <em>ebuild gentoo_update-0.1.5.ebuild test<\/em><\/li>\n<li>Update Manifest if tests were passed -&gt; <em>ebuild gentoo_update-0.1.5.ebuild manifest<\/em><\/li>\n<li>Commit changes to dev branch<\/li>\n<\/ul>\n<p>I think all of these steps can be automated with Github Actions.<\/p>\n<h3>Plans for Week 4<\/h3>\n<p>The first thing to do is to write a post on Gentoo Forums about the updater. This task is already a bit delayed because of technical issues with the updater and the ebuild, but now everything is ready \ud83e\uddbe\ud83d\ude0a<\/p>\n<p>To maximize the usefulness of <em>gentoo_update<\/em> it&#8217;s very important to get some feedback from community as soon as possible, and it will also be nice to have some more Github issues to work on. I&#8217;m planning to post on forums before next Tuesday.<\/p>\n<p>Then, there of course is the parser. I plan to add following features:<\/p>\n<ul>\n<li>Split log into multiple sections, i.e updated programs, what needs restarting etc.<\/li>\n<li>Summarize sections and create a report<\/li>\n<li>If updater exits with error, crate a separate error report<\/li>\n<\/ul>\n<p>If there will be free time left, it would be great to work on Github Actions workflow to automate version bumping the ebuild.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a summary of all the changes made on Automated Gentoo System Updater project during week 3 of GSoC&#8217;23. Project is hosted on Github. Progress on Week 3 Project finally received some Github stars! It also has received &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/17\/week-3-report-automated-gentoo-system-updater\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/462"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":498,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/462\/revisions\/498"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}