diff options
Diffstat (limited to 'libre-testing/libretools')
-rw-r--r-- | libre-testing/libretools/PKGBUILD | 6 | ||||
-rw-r--r-- | libre-testing/libretools/libretools.install | 29 |
2 files changed, 21 insertions, 14 deletions
diff --git a/libre-testing/libretools/PKGBUILD b/libre-testing/libretools/PKGBUILD index 8f2eb8493..ad293303c 100644 --- a/libre-testing/libretools/PKGBUILD +++ b/libre-testing/libretools/PKGBUILD @@ -9,8 +9,8 @@ pkgdesc="Programs for Parabola development" url="https://projects.parabolagnulinux.org/packages/libretools.git/" license=('GPL3' 'GPL2') -pkgver=20140119 -_libretools_commit=b6e66bce4dadd1a5b9f74a456de3ef5575e648fa +pkgver=20140120 +_libretools_commit=c54c481b5b7a1cb7d4a201fad9450d3abb198742 _devtools_commit=534d2015b45e013b37e1edbb997bd4df27d7b8fd _packages_url=https://projects.parabolagnulinux.org/packages @@ -87,5 +87,5 @@ package_libretools-mips64el() { make install-libretools-mips64el DESTDIR="$pkgdir" } -md5sums=('459bb1e453a8acb4bdcb3dc5e36f9322' +md5sums=('3bd411c0746c96fb8f314a654840c912' 'ec69dffa68829f063224de19bbd55fa9') diff --git a/libre-testing/libretools/libretools.install b/libre-testing/libretools/libretools.install index a451add36..202456fea 100644 --- a/libre-testing/libretools/libretools.install +++ b/libre-testing/libretools/libretools.install @@ -4,10 +4,13 @@ _edit_code=" 'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o _edit_cmnt='#%s # commented out by the libretools post_install script' _add_cmnt='# The following line is added by the libretools post_install script' -_add_code='[[ ! -x /usr/bin/librefetch ]] || DLAGENTS+=({https,libre}"::/usr/bin/librefetch -p \"\$BUILDFILE\" -- %u %o")' +_add_code='DLAGENTS+=({https,libre}"::/usr/bin/librefetch -p $(printf "%q" "$BUILDFILE") -- %u %o")' -# This line was installed by previous versions of this script -_old_code='[[ ! -x /usr/bin/librefetch ]] || DLAGENTS+=("libre::/usr/bin/librefetch -p \"\$BUILDFILE\" %u %o")' +# These lines were installed by previous versions of this script +_old_code=( + '[[ ! -x /usr/bin/librefetch ]] || DLAGENTS+=("libre::/usr/bin/librefetch -p \"\$BUILDFILE\" %u %o")' + '[[ ! -x /usr/bin/librefetch ]] || DLAGENTS+=({https,libre}"::/usr/bin/librefetch -p \"\$BUILDFILE\" -- %u %o")' +) # has_line $line has_line() { grep -Fxq -- "$1" etc/makepkg.conf; } @@ -32,13 +35,14 @@ rep_line() { post_install() { if grep -q 'librefetch' etc/makepkg.conf; then libremessages msg2 "libretools: librefetch is already in /etc/makepkg.conf" - if has_line "$_old_code"; then - libremessages msg2 "libretools: removing old librefetch entry in /etc/makepkg.conf" - del_line "$_old_code" - post_install - else - return 0 - fi + local line del=false + for line in "${_old_code[@]}"; do + if has_line "$line"; then + pre_remove + post_install + return $? + fi + done else libremessages msg2 "libretools: adding librefetch to /etc/makepkg.conf" rep_line "$_edit_code" "$(printf "$_edit_cmnt" '&')" @@ -60,5 +64,8 @@ pre_remove() { del_line "$_add_cmnt" del_line "$_add_code" - del_line "$_old_code" + local line + for line in "${_old_code[@]}"; do + del_line "$line" + done } |