• [^] # Re: Upstream

    Posté par . En réponse au journal apti 0.5 : frontend à aptitude. Évalué à 3.

    Probablement parce que ça a commencé comme un petit projet. Beaucoup de monde développe des surcouche a apt/aptitude, par exemple moi j'ai mon apt-search :

    #!/bin/zsh
    autoload -U colors
    colors
    function install-ask () {
     echo "Voulez vous installer 1ドル ? (y/n)"
     read rep
     if [[ "$rep" = 'y' ]]; then
    sudo apt-get install "1ドル"
     fi
    }
    pkgs=() # list of unstalled packages
    integer match=0 # 1 if a package not installed with same name
    # We parse the list of packages find
    readonly old_IFS=$IFS
    IFS='
    '
    for line in ${(oSI:N:)$(apt-cache search "$@")#lib} ; do
    pkg="${line%% *}"
     if [[ -n ${(M)$(dpkg -s "${pkg}" 2> /dev/null)#Status: install ok installed} ]]; then
    col='red'
     else
     # The package is not installed
     pkgs=($pkgs $pkg)
     [[ ${pkg} = "$*" ]] && match=1
     col='green'
     fi
    echo "$fg[$col]${line/ - /$reset_color $fg[blue]}$reset_color"
    done
    IFS=$old_IFS
    # Propositions
    if [[ "${#pkgs}" -eq 1 ]]; then
    install-ask "${pkgs[1]}"
    elif [[ $match -eq 1 ]]; then
    install-ask "$*"
    fi

    Tous les contenus que j'écris ici sont sous licence CC0 (j'abandonne autant que possible mes droits d'auteur sur mes écrits)