Subida a Gitea

This commit is contained in:
luisgulo 2023-06-02 17:12:19 +02:00
commit def71ab339
10 changed files with 237 additions and 0 deletions

2
.directory Normal file
View file

@ -0,0 +1,2 @@
[Desktop Entry]
Icon=./.icon.png

17
.gitignore vendored Normal file
View file

@ -0,0 +1,17 @@
#---- Gambas files to ignore (v5)
*.gambas
.lock
*~
core
core.*
vgcore
vgcore.*
.kdbg*
.*.prof
.lang/*.pot
.gambas/*
.settings
.startup
.list
.info
#----

16
.hidden/CHANGELOG Normal file
View file

@ -0,0 +1,16 @@
* Sun Aug 15 2021 luisgulo <luisgulo@soloconlinux.org.es> 1.0.10
- Se muestra version exacta de Debian que se actualiza
* Fri May 01 2020 luisgulo <luisgulo@soloconlinux.org.es> 1.0.9
- Correccion mensaje y tiempo del aviso de ficheros a actualizar
* Fri May 01 2020 luisgulo <luisgulo@soloconlinux.org.es> 1.0.8
- Se avisa de numero de paquetes a actualizar
* Sat Apr 11 2020 luisgulo <luisgulo@soloconlinux.org.es> 1.0.6
- Se incluye solucion a subidas de releases en repositorios
- Se ajusta control delproceso en segundo plano y animación
* Sun Apr 05 2020 luisgulo <luisgulo@soloconlinux.org.es> 1.0.5
- Lanzamiento inicial

BIN
.icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

28
.project Normal file
View file

@ -0,0 +1,28 @@
# Gambas Project File 3.0
Title=Actualiza
Startup=FMain
Icon=Actualiza-icono.png
Version=1.0.10
Component=gb.image
Component=gb.gui
Component=gb.form
Description="Actualizador Debian (SoloConLinux)"
Authors="luisgulo@soloconlinux.org.es"
TabSize=2
Language=es_ES
SourcePath=/home/luisgulo/ProyectosGAMBAS/SOURCEs
Maintainer=luisgulo
Vendor=SoloConLinux
Address=luisgulo@soloconlinux.org.es
Url=https://repositorio.soloconlinux.org.es
License=General Public License
PackageName=actualiza-1.0.10
CreateEachDirectory=1
Packager=1
Systems=debian
Menus=debian:"Applications/System/Administration"
Categories=debian:"System"
Groups=debian:"admin"
ExtraDependencies=debian:"ruby-notify\t\t"
WebSite=https://repositorio.soloconlinux.org.es
CreateMenu=1

146
.src/FMain.class Normal file
View file

@ -0,0 +1,146 @@
' Gambas class file
Public Clave As String
Public hProceso As Process
Public txtSistema As String
Public Function Actualiza()
Wait 0.1
txtAviso.Text = "Actualizando repositorio..."
txtAviso.Refresh
'Shell "sudo apt-get update" Wait
hProceso = Shell "sudo apt -y update"
Do While hProceso.State = Process.Running
Select Case txtGIRA.Text
Case "|"
txtGIRA.Text = "/"
Case "/"
txtGIRA.Text = "-"
Case "-"
txtGIRA.Text = "\\"
Case "\\"
txtGIRA.Text = "|"
Case Else
txtGIRA.Text = "|"
End Select
Wait 0.1
Loop
'Contar cuantos actualiza
Dim Contador As String
Shell "echo -ne $(apt list --upgradable -q 2>/dev/null|grep -i 'actualizable'|wc -l)" To Contador
If Not (Contador = "0")
Shell "notify-send -t 6000 'Se van a actualizar " & Contador & " programas\nEspere a que finalice'"
Endif
txtAviso.Text = "Actualizando Debian..."
txtAviso.Refresh
hproceso = Shell "sudo apt -y upgrade"
Do While hProceso.State = Process.Running
Select Case txtGIRA.Text
Case "|"
txtGIRA.Text = "/"
Case "/"
txtGIRA.Text = "-"
Case "-"
txtGIRA.Text = "\\"
Case "\\"
txtGIRA.Text = "|"
Case Else
txtGIRA.Text = "|"
End Select
Wait 0.1
Loop
txtGIRA.Text = ""
txtAviso.Text = "¡SISTEMA ACTUALIZADO!"
txtAviso.Refresh
Shell "notify-send -t 3000 '" & txtSistema & "\nSistema Operativo actualizado'" Wait
Quit
End
Public Function ActualizaSudo()
Dim Salida As String
Clave = InputBox("Indique clave de root:", "Contraseña")
Shell "echo -ne $(echo '" & Clave & "' | su -l root -s '/bin/sh' -c 'clear;whoami'|tail -1)" To Salida
If Right(Salida, 4) = "root"
Wait 0.1
txtAviso.Text = "Actualizando repositorio..."
txtAviso.Refresh
'Shell "echo " & Clave & " | su -l root -c 'apt-get update'" Wait
hProceso = Shell "echo " & Clave & " | su -l root -c 'apt -y update'"
Do While hProceso.State = Process.Running
Select Case txtGIRA.Text
Case "|"
txtGIRA.Text = "/"
Case "/"
txtGIRA.Text = "-"
Case "-"
txtGIRA.Text = "\\"
Case "\\"
txtGIRA.Text = "|"
Case Else
txtGIRA.Text = "|"
End Select
Wait 0.1
Loop
'Contar cuantos actualiza
Dim Contador As String
Shell "echo -ne $(apt list --upgradable -q 2>/dev/null|grep -i 'actualizable'|wc -l)" To Contador
If Not (Contador = "0")
Shell "notify-send -t 6000 'Se van a actualizar " & Contador & " programas\nEspere a que finalice'"
Endif
txtAviso.Text = "Actualizando Debian..."
txtAviso.Refresh
Wait 0.1
'Shell "echo " & Clave & " | su -l root -c 'apt-get -y upgrade'" Wait
hProceso = Shell "echo " & Clave & " | su -l root -c 'apt -y upgrade'"
Do While hProceso.State = Process.Running
Select Case txtGIRA.Text
Case "|"
txtGIRA.Text = "/"
Case "/"
txtGIRA.Text = "-"
Case "-"
txtGIRA.Text = "\\"
Case "\\"
txtGIRA.Text = "|"
Case Else
txtGIRA.Text = "|"
End Select
Wait 0.1
Loop
txtGIRA.Text = ""
txtAviso.Text = "¡SISTEMA ACTUALIZADO!"
txtAviso.Refresh
Wait 0.1
' Depende del programa: ruby-notify
Shell "notify-send -t 3000 '" & txtSistema & "\nSistema Operativo actualizado'" Wait
Else
Shell "notify-send -t 3000 'La contraseña no es válida\nNo se ha podido actualizar'" Wait
Endif
Quit
End
Public Sub Form_Open()
System.Shell = "/bin/bash"
Me.x = 10
Me.Y = 10
Me.Show
Wait 0.1
Me.Refresh
Wait 0.1
''Shell "lsb_release -d|awk -F 'Linux' '{print $2}'" To txtSistema
Shell "lsb_release -d|awk -F 'Description:\t' '{print $2}'" To txtSistema
''txtSistema = Upper(txtSistema)
CompruebaRoot()
End
Public Function CompruebaRoot()
Dim Devuelve As String
Shell "echo -ne $(sudo whoami)" To Devuelve
If Devuelve = "root"
Actualiza()
Else
ActualizaSudo()
Endif
End

24
.src/FMain.form Normal file
View file

@ -0,0 +1,24 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,30,15)
Text = ("Actualizador")
Icon = Picture["Actualiza-icono.png"]
Resizable = False
{ picLOGO PictureBox
MoveScaled(1,1,8,8)
Picture = Picture["actualizar_debian.png"]
Stretch = True
}
{ txtAviso Label
MoveScaled(1,10,27,4)
Text = ("Actualizando repositorio") & "..."
}
{ txtGIRA Label
MoveScaled(20,1,8,8)
Font = Font["Bold,22"]
Foreground = Color.DarkRed
Text = ("|")
Alignment = Align.Center
}
}

BIN
Actualiza-icono.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# Actualiza
Aplicacion grafica en Gambas para actualizar Debian (y derivados)
Luisgulo (soloconlinux.org.es)

BIN
actualizar_debian.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB