diff --git a/Dockerfile b/Dockerfile index 3d65c55..45cdc25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM archlinux -ENV TERM='xterm' +ENV TERM='xterm-256color' RUN install -d /usr/bin/ RUN install -d /usr/share/koffe RUN install -d /finalimage diff --git a/README.md b/README.md index aa86a4d..10cec5d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you're using another distrbution create a chroot system (using the bootstrap ## Then to run it: -`docker run -v $PWD:/finalimage --privileged --rm koffe --pacs=base,linux` +`docker run -t -v $PWD:/finalimage --privileged --rm koffe --pacs=base,linux` Note: On Windows, replace $PWD with an absolute path on your host, something like `c:\\Foo\\bar\\` # Converting a standard Arch USB to koffe without any other OS (internet required): diff --git a/koffe b/koffe index 950cec3..45528a2 100755 --- a/koffe +++ b/koffe @@ -2,8 +2,27 @@ x=1 pts=/usr/share/koffe/ pathto=$PWD +reset="\e[0m" +green="\e[0;32m" optdep=0 +quiet=0 pactree_command="pactree -su " +pacout=/dev/stdout +clearcomm='clear ; outapp' +outapp(){ + for outapp in $prog + do + if [[ $outapp == $app ]]; + then + echo -ne "${green}$outapp${reset} " + else + echo -ne "$outapp " + fi + done + echo + echo "----------------------------" + echo +} if [ $1 ]; then for argument in $@ @@ -62,6 +81,13 @@ then optdep=1 pactree_command="pactree -suo " fi + if [[ $argument == "-v" ]]; + then + verbose=1 + pacout=/dev/stdout + clearcomm="echo" + fi + done fi if [ $(whoami) != root ]; @@ -87,7 +113,9 @@ fi if [ $(whoami) == root ]; then #updating the database is required for pacman to resolve the latest links to packages - pacman -Suy + echo "Running 'pacman -Syu'" + pacman -Suy > $pacoutput + clear mkdir /tmp/koffe/ mkdir /tmp/koffe/l/ mkdir /tmp/koffe/n/ @@ -108,11 +136,13 @@ then prog=$(whiptail --inputbox "Please enter all the programs to be included in the installer separated by a space, you can also include package groups like gnome or xorg or AUR packages" 0 0 4 3>&1 1>&2 2>&3 3>&-) fi prog="$prog libnewt" + + for app in $prog do + clear + outapp PACAUR=0 - clear - echo $app variable=$(pacman -Sg $app) if [[ $variable == '' ]]; then @@ -130,7 +160,8 @@ then pactree -su $app > /tmp/koffe/wout_opt prog="$prog $(grep -Fxvf /tmp/koffe/wout_opt /tmp/koffe/with_opt | cut -d ':' -f 1 | cut -d '>' -f 1 | tr '\n' ' ')" fi - wget -nc -i /tmp/koffe/l/$app -P /tmp/koffe/rootfs/airootfs/root/pkg/ + wget -q --show-progress -nc -i /tmp/koffe/l/$app -P /tmp/koffe/rootfs/airootfs/root/pkg/ + $clearcomm fi if [[ $aurornot == "error" ]]; @@ -159,7 +190,8 @@ then done pacman -Spdd --noconfirm - < /tmp/koffe/grtree > /tmp/koffe/grlinks - wget -nc -i /tmp/koffe/grlinks -P /tmp/koffe/rootfs/airootfs/root/pkg/ + wget -q --show-progress -nc -i /tmp/koffe/grlinks -P /tmp/koffe/rootfs/airootfs/root/pkg/ + $clearcomm fi if [[ $PACAUR == 1 ]]; then @@ -180,7 +212,8 @@ then then pactree -su $depend > /tmp/koffe/n/$depend pacman -Spdd --noconfirm - < /tmp/koffe/n/$depend > /tmp/koffe/l/$depend - wget -nc -i /tmp/koffe/l/$depend -P /tmp/koffe/rootfs/airootfs/root/pkg/ + wget -q --show-progress -nc -i /tmp/koffe/l/$depend -P /tmp/koffe/rootfs/airootfs/root/pkg/ + $clearcomm fi if [[ $aurdep_aur == "error" ]]; then @@ -189,6 +222,7 @@ then cd /tmp/koffe/aurbg/$depend sudo -u nobody makepkg --noconfirm --skippgpcheck cp /tmp/koffe/aurbg/$depend/*.pkg.tar.zst /tmp/koffe/rootfs/airootfs/root/pkg + $clearcomm fi done declare -a bbm