Skip to contentSkip to conversation

modules: statistics: handle recipes without maintainers

PATCH RESEND In review [email protected] 2 participants 7 messages Aug 16, 2020 – Aug 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/5 modules: statistics: handle recipes without maintainers

Even though a recipe might not have a MAINTAINER set, one still might want to upgrade it.

This makes it possible to upgrade said kind of recipes and still keep the stats meaningful by displaying one for all maintainerless recipes.

---
- RESEND because I was not subscribed to the ML with this address already,
- please ignore, resent only for archive purposes on the ML, this patch has been merged already

 modules/statistics.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
modules/statistics.py +5 -3
index 323d042..77db151 100644
@@ -71,8 +71,10 @@ class Statistics(object):
                 stat_msg += "    * " + status + ": " + str(list_len) + "\n"
 
                 for pkg, new_ver, maintainer in self.upgrade_stats[status]:
-                    stat_msg += "        " + pkg + ", " + new_ver + ", " + \
-                                maintainer + "\n"
+                    stat_msg += "        " + pkg + ", " + new_ver
+                    if maintainer:
+                        stat_msg += ", " + maintainer
+                    stat_msg += "\n"
 
         if self.total_attempted == 0:
             percent_succeded = 0
@@ -93,7 +95,7 @@ class Statistics(object):
         for m in self.maintainers:
             attempted = self.succeeded[m] + self.failed[m]
             stat_msg += "    %s: attempted=%d succeeded=%d(%.2f%%) failed=%d(%.2f%%)\n" % \
-                        (m.split("@")[0], attempted, self.succeeded[m],
+                        (m.split("@")[0] if m else "Maintainerless", attempted, self.succeeded[m],
                         self.succeeded[m] * 100.0 / attempted,
                         self.failed[m],
                         self.failed[m] * 100.0 / attempted)
Signature · 1 line
2.26.2
#1 lore raw

PATCH RESEND 2/5 upgrade-helper.conf: update comments and default values

A few comments were misleading or incomplete and some defaults were incorrect.

---
- RESEND because I was not subscribed to the ML with this address already,
- please ignore, resent only for archive purposes on the ML, this patch has been merged already

 upgrade-helper.conf | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)
upgrade-helper.conf +25 -12
index e926300..5696564 100644
@@ -9,7 +9,7 @@
 # Lines starting with the '#' character are commented out and in some cases the
 # default values are provided as comments to show people example syntax. Enabling
 # the option is a question of removing the # character and making any change to the
-# variable as required.
+# variable as required. For boolean settings, anything not 'yes' is treated as 'no'.
 
 [maintainer_override]
 # e-mail message for recipe upgrades will go to john.doe instead of jane.doe, etc
@@ -22,10 +22,12 @@
 # If you are running AUH locally, you do not need to set this up, as AUH
 # saves everything to BUILDDIR/upgrade-helper/<timestamp>, and does not attempt
 # to send email messages (unless explicitly asked with -e command line option).
+# If no port is specified, port 25 is assumed.
 #smtp=smtp.my-server.com:25
 
-# from whom should the e-mails be sent.
-#[email protected]
+# from whom should the e-mails be sent (mandatory if --send-emails is passed).
+# Also sets the email address of the author of automated commits.
+#[email protected]
 
 # If enabled, emails for all recipe upgrades will go to john.doe, 
 # except when recipes are owned by specific maintainer_override entries above.
@@ -34,7 +36,8 @@
 # who should be CCd with all upgrade emails (optional)
 #[email protected]
 
-# who should get the status mail with statistics, at the end (optional)
+# who should get the status mail with statistics, at the end (mandatory if
+# --send-emails is passed)
 #[email protected]
 
 # Only recipes belonging to maintainers in whitelist will be attempted
@@ -43,7 +46,8 @@
 # will attempt when it is run with 'all' option.
 #[email protected] [email protected] [email protected]
 
-# recipes in blacklist will be skipped
+# recipes in blacklist will be skipped (applies only when 'all' or no recipe is
+# passed; does not apply when layer_mode is enabled).
 #blacklist=python glibc gcc
 
 # specify the directory where work (patches) will be saved 
@@ -55,11 +59,11 @@
 
 # clean sstate directory before upgrading
 # Generally not necessary, as bitbake can handle this automatically.
-#clean_sstate=yes
+#clean_sstate=no
 
 # clean tmp directory before upgrading
 # Generally not necessary as bitbake can handle this automatically.
-#clean_tmp=yes
+#clean_tmp=no
 
 # Machines to test build with.
 # Append _libc-name to test with alternative C library implementations
@@ -71,11 +75,15 @@
 # AUH has a reasonable default for this, so you do not need to set your own,
 # at least initially.
 #
-#machines=qemux86 qemux86_musl qemux86-64 qemuarm qemumips qemuppc
+# Does not apply when layer_mode is enabled.
+#machines=qemux86 qemux86-64 qemuarm qemumips qemuppc qemux86_musl
 
 # Enables buildhistory feature; this is useful as it produces information
 # about what has changed in the resulting packages, compared to previous version
-#buildhistory=yes
+#
+# Requires 'buildhistory' to be present in INHERIT and BUILDHISTORY_COMMIT to be set
+# in your conf/local.conf.
+#buildhistory=no
 
 # When AUH has built an upgraded recipe it then creates a commit with the upgrade.
 # This setting specifies whether to also revert the commit. Possible values are:
@@ -92,16 +100,21 @@
 
 # If enabled, build and boots a test image, and runs integration tests on it
 # If upgraded packages have ptest support those are run as well
-#testimage=no
 #
+# Requires 'testimage' in INHERIT in your conf/local.conf and 'ptest' in your
+# distro's DISTRO_FEATURES.
+#testimage=no
+
 # This can be used to change the name of the test image.
 #
-#testimage_name=image-custom # defaults to core-image-sato
+#testimage_name=core-image-sato
 
 # This can be used to upgrade recipes in a specific layer,
 # for example meta-intel, instead of upgrading oe-core recipes.
 #
-#layer_mode=False
+# When layer_mode is enabled, layer_name, layer_dir and layer_machines are
+# mandatory. 'blacklist' setting does not apply when in layer_mode.
+#layer_mode=no
 #layer_name=meta-intel
 #layer_dir=DIR/meta-intel
 #layer_machines=intel-core2-32 intel-corei7-64 intel-quark
Signature · 1 line
2.26.2
#2 lore raw

PATCH RESEND 3/5 upgradehelper.py: merge dict.get() followed by if into dict.get with a default

In reply to [email protected]

---
- RESEND because I was not subscribed to the ML with this address already,
- please ignore, resent only for archive purposes on the ML, this patch has been merged already

 upgradehelper.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
upgradehelper.py +1 -3
index c2480f1..7ed7af4 100755
@@ -201,9 +201,7 @@ class Updater(object):
         self.uh_dir = os.path.join(build_dir, "upgrade-helper")
         if not os.path.exists(self.uh_dir):
             os.mkdir(self.uh_dir)
-        self.uh_base_work_dir = settings.get('workdir', '')
-        if not self.uh_base_work_dir:
-            self.uh_base_work_dir = self.uh_dir
+        self.uh_base_work_dir = settings.get('workdir', self.uh_dir)
         if self.opts['layer_mode'] == 'yes':
             self.uh_base_work_dir = os.path.join(self.uh_base_work_dir,
                     self.opts['layer_name'])
Signature · 1 line
2.26.2
#3 lore raw

PATCH RESEND 4/5 README: update mailing list address

In reply to [email protected]

---
- RESEND because I was not subscribed to the ML with this address already,
- please ignore, resent only for archive purposes on the ML, this patch has been merged already

 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
README +1 -1
index cb9f87e..ed34140 100644
@@ -110,7 +110,7 @@ The latest version of the code can always be found here:
   http://git.yoctoproject.org/cgit/cgit.cgi/auto-upgrade-helper/
 
 Contributions are welcome. Please send patches / pull requests to
[email protected] with '[auh]' in the subject also CC the
[email protected] with '[auh]' in the subject also CC the
 current maintainer: Alex Kanavin <[email protected]>.
 
 License
Signature · 1 line
2.26.2
#4 lore raw

PATCH RESEND 5/5 consistent naming for upgradehelper.py

In reply to [email protected]

Rename upgradehelper.py into upgrade-helper.py since the conf file and the git repo are named with a dash to separate "upgrade" and "helper".

The documentation in the README and upgradehelper.py were also already using upgrade-helper.py instead of upgradehelper.py.

For all those reasons, let's be consistent and rename the python script.

---
- RESEND because I was not subscribed to the ML with this address already,

 upgradehelper.py => upgrade-helper.py | 0
 weeklyjob.sh                          | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename upgradehelper.py => upgrade-helper.py (100%)
upgrade-helper.py renamed from upgradehelper.py +0 -0
similarity index 100%
rename from upgradehelper.py
rename to upgrade-helper.py
weeklyjob.sh +1 -1
index 412685e..94598a2 100755
@@ -20,7 +20,7 @@ git fetch origin
 git checkout -B tmp-auh-upgrades origin/master
 
 source $poky_dir/oe-init-build-env $build_dir
-$auh_dir/upgradehelper.py -e all
+$auh_dir/upgrade-helper.py -e all
 
 # clean up to avoid the disk filling up
 rm -rf $build_dir/tmp/
Signature · 1 line
2.26.2
#5 lore raw

Re: [yocto] [auh] [PATCH RESEND 5/5] consistent naming for upgradehelper.py

Thanks, I have added this to AUH repo too now; I assume there are no changes in the re-sent patchset otherwise?

Alex

Quoted 41 lines · Quentin Schulz

Rename upgradehelper.py into upgrade-helper.py since the conf file and the git
repo are named with a dash to separate "upgrade" and "helper".

The documentation in the README and upgradehelper.py were also already using
upgrade-helper.py instead of upgradehelper.py.

For all those reasons, let's be consistent and rename the python script.

---
- RESEND because I was not subscribed to the ML with this address already,

 upgradehelper.py => upgrade-helper.py | 0
 weeklyjob.sh                          | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename upgradehelper.py => upgrade-helper.py (100%)
upgrade-helper.py renamed from upgradehelper.py +0 -0
similarity index 100%
rename from upgradehelper.py
rename to upgrade-helper.py
weeklyjob.sh +1 -2
index 412685e..94598a2 100755
@@ -20,7 +20,7 @@ git fetch origin
 git checkout -B tmp-auh-upgrades origin/master
 
 source $poky_dir/oe-init-build-env $build_dir
-$auh_dir/upgradehelper.py -e all
+$auh_dir/upgrade-helper.py -e all
 
 # clean up to avoid the disk filling up
 rm -rf $build_dir/tmp/
--

2.26.2

#6 lore raw

Re: [yocto] [auh] [PATCH RESEND 5/5] consistent naming for upgradehelper.py

Quoted 3 lines · Alexander Kanavin

Thanks, I have added this to AUH repo too now; I assume there are no changes in the re-sent patchset otherwise?

No change in any of the patches that I've resent.

Quentin