diff options
author | 2010-08-11 13:18:15 +0100 | |
---|---|---|
committer | 2010-08-11 13:19:15 +0100 | |
commit | b0323df4b269bcf8d027252b30701f8fe37f569c (patch) | |
tree | d0eb843cd4e69f40388a95516bb20aff2f683b1a /hooks | |
parent | 78de0f647dfff565df4794afd59e4447abf8deff (diff) | |
download | paludis-b0323df4b269bcf8d027252b30701f8fe37f569c.tar.gz paludis-b0323df4b269bcf8d027252b30701f8fe37f569c.tar.xz |
Update hooks to use cave
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/gnu_info_index.bash | 4 | ||||
-rwxr-xr-x | hooks/installable_cache_regen.bash | 4 | ||||
-rwxr-xr-x | hooks/update_config_protect_list.bash | 27 |
3 files changed, 13 insertions, 22 deletions
diff --git a/hooks/gnu_info_index.bash b/hooks/gnu_info_index.bash index ce9337438..f899ff53d 100755 --- a/hooks/gnu_info_index.bash +++ b/hooks/gnu_info_index.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash # vim: set et sw=4 sts=4 : -# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh +# Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh # # This file is part of the Paludis package manager. Paludis is free software; # you can redistribute it and/or modify it under the terms of the GNU General @@ -31,7 +31,7 @@ einfo_unhooked "Checking whether the GNU info directory needs updating..." export INFOPATH=$(source /etc/profile.env 2>/dev/null ; echo $INFOPATH ) regen_info_dirs= -vdb_loc=$(${PALUDIS_COMMAND} --configuration-variable installed location ) +vdb_loc=$(${CAVE:-cave} print-repository-metadata installed --raw-name location --format '%v' ) for info_path in ${INFOPATH//:/ } ; do info_path="${ROOT%/}/${info_path}" [[ -d "${info_path}" ]] || continue diff --git a/hooks/installable_cache_regen.bash b/hooks/installable_cache_regen.bash index bf5fefcdf..404ecc16f 100755 --- a/hooks/installable_cache_regen.bash +++ b/hooks/installable_cache_regen.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash # vim: set et sw=4 sts=4 : -# Copyright (c) 2006, 2008 Ciaran McCreesh +# Copyright (c) 2006, 2008, 2010 Ciaran McCreesh # # This file is part of the Paludis package manager. Paludis is free software; # you can redistribute it and/or modify it under the terms of the GNU General @@ -21,7 +21,7 @@ source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash echo einfo_unhooked "Regenerating cache for installable repositories..." -${PALUDIS_COMMAND} --regenerate-installable-cache +${CAVE:-cave} fix-cache --installable einfo_unhooked "Done regenerating cache for installable repositories" true diff --git a/hooks/update_config_protect_list.bash b/hooks/update_config_protect_list.bash index 02fb644a7..4d9e639d6 100755 --- a/hooks/update_config_protect_list.bash +++ b/hooks/update_config_protect_list.bash @@ -24,7 +24,7 @@ if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then exit 0 fi -vdb_loc="$(${PALUDIS_COMMAND} --log-level silent --configuration-variable installed location )" +vdb_loc=$(${CAVE:-cave} print-repository-metadata installed --raw-name location --format '%v' ) cfg_protect_list="${vdb_loc}/.cache/all_CONFIG_PROTECT" cfg_protect_mask_list="${vdb_loc}/.cache/all_CONFIG_PROTECT_MASK" @@ -36,26 +36,17 @@ if [[ ! -f "${cfg_protect_list}" || ! -f "${cfg_protect_mask_list}" ]] ; then > "${cfg_protect_list}" > "${cfg_protect_mask_list}" - installed_pkgs=$(${PALUDIS_COMMAND} --log-level silent --list-packages --repository installed |grep "^*" |cut -d" " -f2) - - n=0 - n_end=$(wc -w <<<$installed_pkgs) - for p in ${installed_pkgs} ; do - n=$(( $n + 1 )) - if [[ 0 == $(( n % 20 )) ]] ; then - ewarn " ${n} of ${n_end}" - fi - cfg_protect=$(${PALUDIS_COMMAND} --log-level silent --environment-variable ${p} CONFIG_PROTECT) - for x in ${cfg_protect} ; do - echo "${x}" >> "${cfg_protect_list}" - done + cfg_protect=$(${CAVE:-cave} print-id-metadata --all '*/*'::installed --raw-name CONFIG_PROTECT --format '%v' | xargs -n1 | uniq ) + for x in ${cfg_protect} ; do + echo "${x}" >> "${cfg_protect_list}" + done - cfg_protect_mask=$(${PALUDIS_COMMAND} --log-level silent --environment-variable ${p} CONFIG_PROTECT_MASK) - for x in ${cfg_protect_mask} ; do - echo "${x}" >> "${cfg_protect_mask_list}" - done + cfg_protect_mask=$(${CAVE:-cave} print-id-metadata --all '*/*'::installed --raw-name CONFIG_PROTECT_MASK --format '%v' | xargs -n1 | uniq ) + for x in ${cfg_protect_mask} ; do + echo "${x}" >> "${cfg_protect_mask_list}" done fi + einfo "Updating CONFIG_PROTECT and CONFIG_PROTECT_MASK caches." # Now, update the lists with our current values. |