Linux Lite 8.0 RC1 has been released - Click here


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Update for lite-software logic
#1

Looking at the way lite-software works:

1- It prevents users from getting to the Install or Remove packages section if there is no Internet connection available.

While users won't be able to install applications if it needs to be downloaded, the user should be able to get to the Install or Remove software section because they should be able to uninstall applications even without internet connection. Also, users can reinstall applications even with no internet connection (from cache) if they have previously installed a specific application.

2- As in #1, if users do not update software sources (basically enforced) when launching Lite Software, they won't be able to get to the Install or Remove software section.

The user should be given the option to decide whether to update software sources or not. Even if users choose not to update software sources at that time, they should be able to reach the Install or Remove software section. Imagine cases such as temporarily Internet connection issues or simply the user wants to uninstall an app not having to wait for software sources updates. It becomes increasingly unfriendly if they happen to launch Lite Software more than once in a short period of time.

3- Dialogs must be more descriptive, in accordance to the task being performed. For instance, telling users to check /var/log/lite-software.log for more information an throwing an error, does not help users when the issue is, in fact, not having an active internet connection.

I will be addressing these issues in my next pool as follows:

1- As soon as Lite Software is launched, there will be a check for internet access. If the internet access fails, the user will not be prompted with updating software sources. Instead, it will be only warned about "not having an active internet connection" and will be directed to Install or Remove software section:

[Image: xNQD2mV.png]

[Image: KQPpMJV.png]

Note that I also removed the "Exit" option from the tasks selection. I think it is unnecessary to have an "Exit" option when there is a "Quit" button on that same dialog box.

2- After launching Lite Software and checking for internet connectivity, if there is internet connection, the user will be given the option to update software sources but it won't be enforced. Instead, the dialog box will recommend to update software sources but even when the user decides not to do so, it will be allowed to continue.

[Image: fcnepJq.png]

If the user opts for not updating software sources at that time, it will be able to proceed to the Install or Remove software section regardless

[Image: KQPpMJV.png]

I will be working on other lite-software dialog boxes later. So far, the options to allow users to get to the Install or Remove software section whether there is internet connection or not and whether the user decides to update software sources or not, is completed.

I added some more information to the Install additional software box as shown below, but I'm not sure if that's too much text or if it is "acceptable":

[Image: r5JXAi0.png]

Thoughts and recommendations about everything here in?







https://unlockforus.com

Sorry for seeming stupid and preferring Linux - I just don't know any better.

[Image: AGxgqJ6.png]
Reply
#2

I really like this, go for it Ralphy! Great stuff.

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#3

Thanks Jerry,

I have a big pull ready for lite-software. I'm just going through the code and cleaning few things up. For example, I'm removing zenity --window-icon from everywhere I see it. The --window-icon parameter isn't meant to set the image displayed in the info/warning/message/question dialogs, but the gtk-window icon. So, --window-icon has been set in few places and that will never load.

https://unlockforus.com

Sorry for seeming stupid and preferring Linux - I just don't know any better.

[Image: AGxgqJ6.png]
Reply
#4

Pull request pushed.

https://unlockforus.com

Sorry for seeming stupid and preferring Linux - I just don't know any better.

[Image: AGxgqJ6.png]
Reply
#5

Thanks Ralphy, merged. Will test when finished with Lite Tweaks.

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#6

Some minor cosmetic changes, nothing major. Tested on both 32bit and 64bit. Are you happy for this to be released?

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#7

Suggest we choose a different website to check connection against instead of linuxliteos.com, eg.

Code:
if eval "sudo -u ${SUDO_USER:-$USER} curl -sk google.com/" >> /dev/null 2>&1; then

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#8

Agreed.

https://unlockforus.com

Sorry for seeming stupid and preferring Linux - I just don't know any better.

[Image: AGxgqJ6.png]
Reply
#9

Cheers.

Sent from my Phone using Tapatalk


Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#10

Ok Jerry,

Here is what I have on my system and what we've been trying to get to github without success:


file /usr/scripts/updates-gui  32 and 64 BIT

Code:
#!/bin/bash
#-----------------------------------------------------------------------------------------
# Name: Linux Lite Updates
# Description: A GUI tool to easily install Updates in Linux Lite.
# Authors: Misko_2083, Jerry Bezencon, gerito1, Ralphy
# Website: https://www.linuxliteos.com
#-----------------------------------------------------------------------------------------

# Kill off any package managers that may be running
if [ "$(pidof synaptic)" ]
then
   killall -9 synaptic
fi

if [ ! -z "$(pgrep gdebi-gtk)" ]
then
   killall -9 gdebi-gtk
fi

# Check Internet access
if eval "sudo -u ${SUDO_USER:-$USER} curl -sk google.com/" >> /dev/null 2>&1; then
  : # pass
else # Prompt ERROR internet connection
    notify-send -t 8000 "Cannot check for updates" "Your computer is not connected to the Internet."
    (zenity --info --width=320 --height=120 --ok-label="Got it!" --title="         Lite Updates - No Internet connection detected..." \
            --text="\n<b>Your computer does not seem to be connected to the internet</b> \n \nLinux Lite cannot check for updates. \nPlease check your Internet connection and try again." --no-wrap)
        exit 0
fi

# Updates log variable
UPDATES=$(mktemp /tmp/updateslist.XXXXXX)

# Linux Lite default dialog icon
ic="/usr/share/icons/zenity-llcc.png"

# Get list of available updated packages then populate them to /tmp/updateslist
zenity --question --width=280 --height=100 --title="          Linux Lite Updates" --window-icon="/usr/share/icons/zenity-llcc.png" \
       --text="\n<b>We will now fetch the Updates list</b>\n\nClick 'No' to exit now or 'Yes' to continue."
   if [ "$?" -eq "0" ];then

    APTUPDATE=$(grep '^deb' -c /etc/apt/sources.list) # Total of repositories registered, this is approximated
    apt-get update 2>&1 | awk -v total=$APTUPDATE '/^Ign|^ Get/{count++;$1=""} FNR { if (total != 0){percentage=int (100*count/total);print (percentage < 90?percentage:90),"\n#",substr($0, 0, 128) }; fflush(stdout)}' \
      | zenity --progress --text="Updating package lists..." --window-icon=$ic --title="Updating Software Sources - please wait..." --percentage=0 --auto-close --width=600

        if [ "${PIPESTATUS[0]}" -ne "0" ]; then
            unset APTUPDATE
            rm $UPDATES
            unset UPDATES
            zenity --error \
            --title="Error" --text="\n$APPNAME Couldn't fetch the package cache information lists."
            exit 1
        fi
unset APTUPDATE

# Creates a list in /tmp/updateslist
apt-get --just-print dist-upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "Name: $1 INSTALLED: $2 AVAILABLE: $3\n"}' | awk '{print NR,":\t"$0}' | tee $UPDATES

# Check if any updates are available, if there are none, script pops up dialog box saying 'No Updates Available', removes /tmp/updateslist.XXXXXX
if [  -z "$(cat $UPDATES)"  ]; then
   rm $UPDATES
   unset UPDATES
    zenity --info --window-icon="/usr/share/icons/zenity-llcc.png"  --width=180 --height=80 --title="     Linux Lite Updates" \
        --text="\nNo updates available."
   exit 0
fi

# Insert text into  /tmp/updateslist.XXXXXX
sed -i -e '1 i\List of available Updates' -e '1 i\Click Update to continue or Cancel to stop the update process\n'  $UPDATES

# Erase existing available info
dpkg --clear-avail
  else
       rm $UPDATES
       unset UPDATES
       exit 0
  fi

# Call the zenity dialog to show update list
zenity --text-info --ok-label="Update" --cancel-label="Cancel" --title="Linux Lite Updates" --width=780 --height=300 --filename="$UPDATES"
      if [ "$?" -eq "0" ];then
      # Continue script if no halt
        INSTALL_ICON="/usr/share/icons/zenity-llcc.png"
        APPNAME="Linux Lite Updates"
                 # Remove tmp file and unset variable
                 rm $UPDATES
                 unset UPDATES
#Begin upgrade
DEBIAN_FRONTEND=noninteractive apt-get  -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade -y  2>&1 | tee /var/log/llupdates.log | awk ' BEGIN { FS=" "; total=1;end_download=0} /upgraded/ {total= $1 + $3;FS="[ :]" } /^Get:[[:digit:]]+/ {printf "#Downloading %s %s %s\n",$7,$(NF-1),$NF;print int(($2 - 1) * 100 / total); fflush(stdout)} /^\(Reading / {if (end_download==0){print 100;fflush(stdout);end_download=1}} /^(Preparing|Unpacking|Selecting|Processing|Setting|Download)/ {print "#", substr($0, 0, 128); fflush(stdout)}' \
    | ( zenity --window-icon=$ic --progress --width=600 --text="Downloading package(s)...\nThis may take a while." --title="Downloading - please wait..." --percentage=0 --auto-close ; zenity --progress --window-icon=$ic --width=600 --text="Installing and configuring packages...\nThis may take a while." --title="Installing - please wait..."  --pulsate --auto-close )

      if [ "${PIPESTATUS[0]}" -ne "0" ]; then
         zenity --error \
         --title="Error" --text="$APPNAME have failed.\n\nRefer to /var/log/llupdates.log\n\nfor more information."
         exit 0
      fi

      # Halt updates script if user selects Cancel
      else
         rm $UPDATES
         unset UPDATES
         zenity --warning --title="         Updates Cancelled" --window-icon="${INSTALL_ICON}" --width=220 --text="\nUpdates have been cancelled."
    sleep 3
    sudo -u ${SUDO_USER:-$USER} notify-send -t 10000 -i /usr/share/icons/Faenza/places/48/distributor-logo-ubuntu.png "Updates Available" "There are updates available for your system. Please run Lite 'Install Updates' again to update."
         exit 0
    fi

PROCEED=$(zenity --question --title="     $APPNAME" --window-icon=/usr/share/icons/zenity-llcc.png --text="\nUpdates have finished installing.\n\nWould you like to view the $APPNAME log?"; echo $?)
if [ ${PROCEED} -eq 1 ]; then
   zenity --info --title="$APPNAME" --window-icon="${INSTALL_ICON}" --text="$APPNAME Complete."
   exit;
else
   zenity --text-info --ok-label="Quit" --cancel-label="Cancel" --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
fi
exit 0

https://unlockforus.com

Sorry for seeming stupid and preferring Linux - I just don't know any better.

[Image: AGxgqJ6.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)