1 |
commit: d5ed2a39f1ba4c9c67e0ec79ec18986d37a198c1 |
2 |
Author: kewl fft <kewl <AT> alto <DOT> eu <DOT> org> |
3 |
AuthorDate: Wed Oct 3 18:37:44 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 6 01:24:19 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d5ed2a39 |
7 |
|
8 |
etc-update: combined use of /etc/os-release ID and ID_LIKE |
9 |
|
10 |
Closes: https://github.com/gentoo/portage/pull/372 |
11 |
Signed-off-by: Kewl Fft xrjy <AT> nygb.rh.bet (rot13) |
12 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
13 |
|
14 |
bin/etc-update | 12 ++++++------ |
15 |
1 file changed, 6 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/bin/etc-update b/bin/etc-update |
18 |
index f0aaca1e6..3951ec674 100755 |
19 |
--- a/bin/etc-update |
20 |
+++ b/bin/etc-update |
21 |
@@ -32,13 +32,13 @@ get_config() { |
22 |
"${PORTAGE_CONFIGROOT}"etc/etc-update.conf) |
23 |
} |
24 |
|
25 |
-OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g') |
26 |
+OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE}:") |
27 |
|
28 |
-case $OS_RELEASE_ID in |
29 |
- suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;; |
30 |
- fedora|rhel) OS_FAMILY='rpm' ;; |
31 |
- arch|archarm|arch32|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';; |
32 |
- *) OS_FAMILY='gentoo' ;; |
33 |
+case ${OS_RELEASE_POSSIBLE_IDS} in |
34 |
+ *:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';; |
35 |
+ *:fedora:*|*:rhel:*) OS_FAMILY='rpm';; |
36 |
+ *:arch:*|*:manjaro:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';; |
37 |
+ *) OS_FAMILY='gentoo';; |
38 |
esac |
39 |
|
40 |
if [[ $OS_FAMILY == 'gentoo' ]]; then |