diff --git a/Makefile b/Makefile index de9da8df3ecae03d972ce3b1e513cd57e995192c..1eea00a34ba5ae7d38a0066fab077e94861a049e 100644 --- a/Makefile +++ b/Makefile @@ -8,4 +8,5 @@ build: python3 setup.py build install: python3 setup.py install - install inary-cli /usr/bin/inary + ln -s /usr/bin/inary-cli /usr/bin/inary || true + install shell-complete/bash-complete.sh /usr/share/bash-completion/completions/inary diff --git a/inary/util.py b/inary/util.py index 055c47c5ab159a4477c13b1b76bb9e459aaa7b47..d30fa6deac9048a34cc490c5e77fc63b458e8b8e 100644 --- a/inary/util.py +++ b/inary/util.py @@ -393,10 +393,11 @@ def mvprintw(x,y,msg=''): printw(msg) def noecho(enabled=True): - if(enabled): - printw("\x1b[?25l") - else: - printw("\x1b[?25h") + if(ctx.get_option('no_color')==False): + if(enabled): + printw("\x1b[?25l") + else: + printw("\x1b[?25h") def attron(attribute): """Attribute enable""" diff --git a/scripts/sulinstrapt b/scripts/sulinstrapt new file mode 100644 index 0000000000000000000000000000000000000000..f84f332ec127bec38a382fcbca082b246d2d29cb --- /dev/null +++ b/scripts/sulinstrapt @@ -0,0 +1,26 @@ +#!/bin/sh +#sulinstrapt betiği ile sulinos chroot oluşturabilirsiniz veya diskinize kurulum yapabilirsiniz + +if [ "$1" == "" ] || [ "$1" == "-*" ] +then + echo "Usage: sulinstrapt [directory]" + exit 0 +fi +sulin="$1" +if [ $UID -ne 0 ] +then + echo "You must be root!" + exit 1 +fi +if [ -d "$sulin" ] +then + echo "$sulin already exist" +fi +if [ -f "$sulin" ] +then + echo "$sulin is a file. You must delete or move." + exit 1 +fi +inary ar sulin https://master.dl.sourceforge.net/project/sulinos/SulinRepository/inary-index.xml -D$sulin +inary it -c system.base -y --ignore-scom -D$sulin +cp -prf $sulin/usr/share/baselayout/* $sulin/etc/ diff --git a/scripts/update-inary-cache b/scripts/update-inary-cache new file mode 100755 index 0000000000000000000000000000000000000000..b8054348558455404f1194b8e56a77d0ea35c79b --- /dev/null +++ b/scripts/update-inary-cache @@ -0,0 +1,16 @@ +#!/bin/bash +if [ $UID -ne 0 ] ; then + echo "You must be root!" + exit 1 +fi +inary dc +inary ur +echo +echo "Listing avaiable..." +inary la --no-color | awk -F ' ' '{print $1}' > /var/cache/inary/avaiable +echo "Listing installed..." +inary li --no-color | awk -F ' ' '{print $1}' > /var/cache/inary/installed +echo "Listing repos..." +ls /var/lib/inary/index/ > /var/cache/inary/repos +echo +echo "Done" diff --git a/setup.py b/setup.py index fba5e22691f12f89f8a8299e5d96c764ce0adf6c..ccb2b1883f265b8607fb7fe1f2fbe00805e0846c 100644 --- a/setup.py +++ b/setup.py @@ -205,6 +205,8 @@ setup(name="inary", scripts=['inary-cli', 'scripts/pspec2po', 'scripts/revdep-rebuild', + 'scripts/sulinstrapt', + 'scripts/update-inary-cache', 'scripts/version-bump'], classifiers=[ 'Development Status :: 5 - Production/Stable', diff --git a/shell-complete/bash-complete.sh b/shell-complete/bash-complete.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7df9eb5fb3e518779c74af13dca8f8b4dd57eb1 --- /dev/null +++ b/shell-complete/bash-complete.sh @@ -0,0 +1,25 @@ +_inary() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="ar bl bi check cm cp dc dt dr em emup er fc graph hs ix info it la lc li ln ln lp lr lu rdb rp ro rr sr sf ur up" + + if [[ ${cur} == * ]] && [ ${prev} == inary ] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + fi + if [[ ${cur} == * ]] && [ ${prev} == it ] ; then + avaiable=$(cat /var/cache/inary/avaiable) + COMPREPLY=( $(compgen -W "${avaiable}" -- ${cur}) ) + fi + if [[ ${cur} == * ]] && [ ${prev} == rm ] ; then + avaiable=$(cat /var/cache/inary/installed) + COMPREPLY=( $(compgen -W "${avaiable}" -- ${cur}) ) + fi + if [[ ${cur} == * ]] && [ ${prev} == rr ] ; then + avaiable=$(cat /var/cache/inary/repos) + COMPREPLY=( $(compgen -W "${avaiable}" -- ${cur}) ) + fi +} +complete -F _inary inary