From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7DE281382C5 for ; Thu, 15 Mar 2018 20:44:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D6D3E0636; Thu, 15 Mar 2018 20:43:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4A054E0636 for ; Thu, 15 Mar 2018 20:43:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 267BC335C77 for ; Thu, 15 Mar 2018 20:43:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B9BD5240 for ; Thu, 15 Mar 2018 20:43:55 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1521146610.a47b53bd5ee32ead478848d615778b013fa48e00.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/etc-update X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a47b53bd5ee32ead478848d615778b013fa48e00 X-VCS-Branch: master Date: Thu, 15 Mar 2018 20:43:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ae228cd9-bdfd-492c-a5ec-607b4e6d4467 X-Archives-Hash: 4afbcd8d0a082f9c4daee7614d1ed9b3 commit: a47b53bd5ee32ead478848d615778b013fa48e00 Author: kewl fft alto eu org> AuthorDate: Thu Mar 15 20:17:33 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Mar 15 20:43:30 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a47b53bd etc-update: add Arch Linux support Closes: https://github.com/gentoo/portage/pull/267 bin/etc-update | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bin/etc-update b/bin/etc-update index 7b48be215..7cd880d7c 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -35,11 +35,15 @@ get_config() { OS_RELEASE_ID=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2) case $OS_RELEASE_ID in - suse|opensuse) OS_FAMILY='suse' ;; + suse|opensuse) OS_FAMILY='suse' NEW_EXT='rpmnew';; + arch|manjaro) OS_FAMILY='arch' NEW_EXT='pacnew';; *) OS_FAMILY='gentoo' ;; esac if [[ $OS_FAMILY == 'gentoo' ]]; then + get_basename() { + printf -- '%s\n' "${1:10}" + } get_basename_find_opt() { echo "._cfg????_${1}" } @@ -49,15 +53,18 @@ if [[ $OS_FAMILY == 'gentoo' ]]; then get_live_file() { echo "${rpath}/${rfile:10}" } -elif [[ $OS_FAMILY == 'suse' ]]; then +elif [[ $OS_FAMILY == 'suse' ]] || [[ $OS_FAMILY == 'arch' ]]; then + get_basename() { + printf -- '%s\n' "${1%.${NEW_EXT}}" + } get_basename_find_opt() { - echo "${1}.rpmnew" + printf -- '%s\n' "${1}.${NEW_EXT}" } get_scan_regexp() { echo "s:\(^.*/\)\(.*\)\(\.rpmnew\):\1\2\3$b\1$b\3$b\2:" } get_live_file() { - echo "${cfg_file%.rpmnew}" + printf -- '%s\n' "${cfg_file%.${NEW_EXT}}" } fi @@ -160,7 +167,7 @@ scan() { rm -f "${file}" continue fi - if [[ "${ofile:10}" != "${rfile:10}" ]] || + if [[ $(get_basename "${ofile}") != $(get_basename "${rfile}") ]] || [[ ${opath} != ${rpath} ]] then : $(( ++count )) @@ -176,7 +183,7 @@ scan() { continue fi - if [[ "${ofile:10}" != "${rfile:10}" ]] || + if [[ $(get_basename "${ofile}") != $(get_basename "${rfile}") ]] || [[ ${opath} != ${rpath} ]] then MATCHES=0 @@ -753,6 +760,11 @@ if [[ $OS_FAMILY == 'suse' ]]; then CONFIG_PROTECT='/etc' CONFIG_PROTECT_MASK='' [[ -f /etc/sysconfig/etc-update ]] && . /etc/sysconfig/etc-update +elif [[ $OS_FAMILY == 'arch' ]]; then + PORTAGE_CONFIGROOT='/' + PORTAGE_TMPDIR='/tmp' + CONFIG_PROTECT='/etc /usr/lib /usr/share/config' + CONFIG_PROTECT_MASK='' fi portage_vars=(