[dev] Start work on better output

Start work on cleaner output and --verbose flag for current output
dev
Joaquin 3 years ago
parent f3d1d45cce
commit 7c48245b6f
Signed by: puly
GPG Key ID: 9E9299CD96C65EC6
  1. 2
      Dockerfile
  2. 2
      README.md
  3. 46
      koffe

@ -1,5 +1,5 @@
FROM archlinux FROM archlinux
ENV TERM='xterm' ENV TERM='xterm-256color'
RUN install -d /usr/bin/ RUN install -d /usr/bin/
RUN install -d /usr/share/koffe RUN install -d /usr/share/koffe
RUN install -d /finalimage RUN install -d /finalimage

@ -52,7 +52,7 @@ If you're using another distrbution create a chroot system (using the bootstrap
## Then to run it: ## 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\\` 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): # Converting a standard Arch USB to koffe without any other OS (internet required):

46
koffe

@ -2,8 +2,27 @@
x=1 x=1
pts=/usr/share/koffe/ pts=/usr/share/koffe/
pathto=$PWD pathto=$PWD
reset="\e[0m"
green="\e[0;32m"
optdep=0 optdep=0
quiet=0
pactree_command="pactree -su " 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 ]; if [ $1 ];
then then
for argument in $@ for argument in $@
@ -62,6 +81,13 @@ then
optdep=1 optdep=1
pactree_command="pactree -suo " pactree_command="pactree -suo "
fi fi
if [[ $argument == "-v" ]];
then
verbose=1
pacout=/dev/stdout
clearcomm="echo"
fi
done done
fi fi
if [ $(whoami) != root ]; if [ $(whoami) != root ];
@ -87,7 +113,9 @@ fi
if [ $(whoami) == root ]; if [ $(whoami) == root ];
then then
#updating the database is required for pacman to resolve the latest links to packages #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/
mkdir /tmp/koffe/l/ mkdir /tmp/koffe/l/
mkdir /tmp/koffe/n/ 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>&-) 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 fi
prog="$prog libnewt" prog="$prog libnewt"
for app in $prog for app in $prog
do do
PACAUR=0
clear clear
echo $app outapp
PACAUR=0
variable=$(pacman -Sg $app) variable=$(pacman -Sg $app)
if [[ $variable == '' ]]; if [[ $variable == '' ]];
then then
@ -130,7 +160,8 @@ then
pactree -su $app > /tmp/koffe/wout_opt 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' ' ')" prog="$prog $(grep -Fxvf /tmp/koffe/wout_opt /tmp/koffe/with_opt | cut -d ':' -f 1 | cut -d '>' -f 1 | tr '\n' ' ')"
fi 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 fi
if [[ $aurornot == "error" ]]; if [[ $aurornot == "error" ]];
@ -159,7 +190,8 @@ then
done done
pacman -Spdd --noconfirm - < /tmp/koffe/grtree > /tmp/koffe/grlinks 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 fi
if [[ $PACAUR == 1 ]]; if [[ $PACAUR == 1 ]];
then then
@ -180,7 +212,8 @@ then
then then
pactree -su $depend > /tmp/koffe/n/$depend pactree -su $depend > /tmp/koffe/n/$depend
pacman -Spdd --noconfirm - < /tmp/koffe/n/$depend > /tmp/koffe/l/$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 fi
if [[ $aurdep_aur == "error" ]]; if [[ $aurdep_aur == "error" ]];
then then
@ -189,6 +222,7 @@ then
cd /tmp/koffe/aurbg/$depend cd /tmp/koffe/aurbg/$depend
sudo -u nobody makepkg --noconfirm --skippgpcheck sudo -u nobody makepkg --noconfirm --skippgpcheck
cp /tmp/koffe/aurbg/$depend/*.pkg.tar.zst /tmp/koffe/rootfs/airootfs/root/pkg cp /tmp/koffe/aurbg/$depend/*.pkg.tar.zst /tmp/koffe/rootfs/airootfs/root/pkg
$clearcomm
fi fi
done done
declare -a bbm declare -a bbm

Loading…
Cancel
Save