From 62d399951802971b53aa3b8da7a9094629ea3303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 15 Nov 2019 11:32:24 +0100 Subject: [PATCH] meson: add target to update the chromiumos rules There is no change in the file right now, but the download seems to work OK. It's funny that the biggest company in the world cannot provide a download link in plain text. --- hwdb.d/meson.build | 4 ++++ meson.build | 1 + tools/chromiumos/gen_autosuspend_rules.py | 0 tools/meson-autosuspend-update.sh | 7 +++++++ 4 files changed, 12 insertions(+) mode change 100755 => 100644 tools/chromiumos/gen_autosuspend_rules.py create mode 100755 tools/meson-autosuspend-update.sh diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build index 31ee3e7409..1f73a8bbb6 100644 --- a/hwdb.d/meson.build +++ b/hwdb.d/meson.build @@ -47,3 +47,7 @@ endif run_target( 'hwdb-update', command : [hwdb_update_sh, meson.current_source_dir()]) + +run_target( + 'autosuspend-update', + command : [autosuspend_update_sh, project_source_root + '/tools/chromiumos']) diff --git a/meson.build b/meson.build index c27deffa8e..fde351eba3 100644 --- a/meson.build +++ b/meson.build @@ -2930,6 +2930,7 @@ make_directive_index_py = find_program('tools/make-directive-index.py') make_man_index_py = find_program('tools/make-man-index.py') xml_helper_py = find_program('tools/xml_helper.py') hwdb_update_sh = find_program('tools/meson-hwdb-update.sh') +autosuspend_update_sh = find_program('tools/meson-autosuspend-update.sh') subdir('sysctl.d') subdir('sysusers.d') diff --git a/tools/chromiumos/gen_autosuspend_rules.py b/tools/chromiumos/gen_autosuspend_rules.py old mode 100755 new mode 100644 diff --git a/tools/meson-autosuspend-update.sh b/tools/meson-autosuspend-update.sh new file mode 100755 index 0000000000..a4f99eb6b3 --- /dev/null +++ b/tools/meson-autosuspend-update.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +cd "$1" + +(curl -L 'https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/udev/gen_autosuspend_rules.py?format=TEXT'; echo) \ + | base64 -d > gen_autosuspend_rules.py