updated "resize pupsave" in Xdialog

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#21 Post by SFR »

Ah, it's the old problem with decimal separator. :roll:
And again I forgot about it, sorry. :oops:
bc uses only dot, but printf (bash builtin) distinguishes between dot and comma, accordingly to country settings.
Try this, /usr/bin/printf seems to behave better:

Code: Select all

"$Size01" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size01/1024")) $LOC322)" \
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#22 Post by ASRI éducation »

SFR wrote:

Code: Select all

"$Size01" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size01/1024")) $LOC322)" \
Yes !!!

Code: Select all

#### Main GUI
echo "Main GUI"
Xdialog --title "$AppTitle $AppVersion" --left --wrap --help "$HelpMsg"  \
--menu "$LOC250" 0 85 9 \
"$Size01" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size01/1024")) $LOC322)" \
"$Size02" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size02/1024")) $LOC322)" \
"$Size03" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size03/1024")) $LOC322)" \
"$Size04" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size04/1024")) $LOC322)" \
"$Size05" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size05/1024")) $LOC322)" \
"$Size06" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size06/1024")) $LOC322)" \
"$Size07" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size07/1024")) $LOC322)" \
"$Size08" "$LOC317     ($(/usr/bin/printf '%.2f' $(bc -l <<< "$Size08/1024")) $LOC322)"  2> /tmp/reply2
Thank for your help, I will soon be able to offer a version 0.1.3.
Before that, the file location 'en' must be validated.
Attachments
decimal_ok.jpg
(28.65 KiB) Downloaded 691 times
Pelo

ça usine, forte activité sur Puppy cet été !

#23 Post by Pelo »

Taille maximum utilisable : le système sait combien d'espace disponible reste sur la partition choisie. Si on met plus que ce que l'on a, il serait bien qu'il le dise de suite. Is'nt it ?

Bla bla : sur les clés USBs, il m'est arrivé de créer une sauvegarde trop grosse pour ce qu'il me restait de place. Bien sûr, on devrait vérifier avant, mais on ne pense pas à tout.
Pendant que vous battez le fer, il serait sans doute possible d'y adjoindre un garde-fou, si vous savez faire, ce dont je ne doute point. Merci messieurs.

Je suis content de la voie prise par nos puppistophiles en ce moment.
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#24 Post by SFR »

ASRI, we got a problem...

I just found out, doing something else, that although /usr/bin/printf works ok in Lupu, but not in Slacko.
The one from Lupu turned out to be a coreutils (full) version, whereas in Slacko it's a part of busybox and it behaves in the same, nasty way as bash builtin.

Perhaps it'd be better to resign from bc and use, for instance, dc, which respects regional settings and therefore always cooperates fine with printf:

Code: Select all

"$Size01" "$LOC317     ($(printf '%.2f' $(dc $Size01 1024 / p)) $LOC322)" \
The above works for me in Slacko & Lupu with both dot & comma as decimal separator.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#25 Post by don570 »

Barry Kauler updated his version of bc about half a year ago.

Did Slacko not do the same??

When I checked bc a couple of years ago I found that
multiplication and division could only be done in a particular way
because of old version of bc.

Check Advanced bash manual for examples.

http://208.109.22.214/puppy/viewtopic.p ... e532eefe31
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#26 Post by SFR »

don570 wrote:Barry Kauler updated his version of bc about half a year ago.

Did Slacko not do the same??
I just checked and both Slacko-5.5 and Precise-5.6 have the very same version of 'bc':

Code: Select all

# bc --version
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
It seems to be the latest available release: ftp://alpha.gnu.org/gnu/bc/.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

Re: ça usine, forte activité sur Puppy cet été !

#27 Post by ASRI éducation »

Pelo wrote:Taille maximum utilisable : le système sait combien d'espace disponible reste sur la partition choisie. Si on met plus que ce que l'on a, il serait bien qu'il le dise de suite. Is'nt it ?
Ce sera intégré dans la prochaine version.
Cordialement,
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

resizepfile-0.1.3

#28 Post by ASRI éducation »

resizepfile-0.1.3
- best display size in GB (SFR)
- added test free space on host partition
- change translation (use gettext method)
Attachments
resizepfile-0.1.3_20130626.pet
md5 9a284cd4d965693f29b8479176f88ffc
(8.23 KiB) Downloaded 611 times
resizepfile_size_error-en.png
(10.12 KiB) Downloaded 510 times
resizepfile_help_gui-en.png
(23.59 KiB) Downloaded 506 times
resizepfile_main_gui-en.png
(19.79 KiB) Downloaded 504 times
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#29 Post by don570 »

line 59 of version 0.1.2 needs to be changed to restrict the width of
Xdialog infobox

change

Code: Select all

--infobox "$LOC200" 0 0 60000
to...

Code: Select all

--infobox "$LOC200" 0 100 60000
___________________________________________
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#30 Post by ASRI éducation »

don570 wrote:line 59 of version 0.1.2 needs to be changed to restrict the width of
Xdialog infobox

change

Code: Select all

--infobox "$LOC200" 0 0 60000
to...

Code: Select all

--infobox "$LOC200" 0 100 60000
___________________________________________
Thank you for the info.
This will be done as soon as the next version.
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#31 Post by ASRI éducation »

resizepfile-0.1.3

Message for users/translators/contributors/developers.

"Before proposing other local (currently only English is available), I would get the approval of the english version (native version).
If you are ok to test, it will be appreciated.
Sincerely,"
Pelo

free space available on the disk

#32 Post by Pelo »

Would it be possible to inform of free space available on the disk, here sdb1, to make the increase fitting in the free space available ?
USB sticks are quite tiny.
From my own i have 2 Gb free on SDB1, and 57MB still available in the save file. The information to add in the xdialog is that there is 2 GB free for increasing. ASRI will add it (promised).
Au revoir.
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

Re: free space available on the disk

#33 Post by ASRI éducation »

Pelo wrote:Would it be possible to inform of free space available on the disk, here sdb1, to make the increase fitting in the free space available ?
USB sticks are quite tiny.
From my own i have 2 Gb free on SDB1, and 57MB still available in the save file. The information to add in the xdialog is that there is 2 GB free for increasing. ASRI will add it (promised).
Salut à toi Pelo !
Je réponds en français, car en anglais ma réponse risque d'être approximative.

Si j'ai bien compris, tu demandes s'il est possible d'indiquer l'espace disponible sur la partition d'accueil.
Si c'est ça, c'est déjà fait et normalement ça fonctionne (j'avoue ne pas avoir testé avec un périphérique USB, mais normalement cela n'est pas différent d'un ddur classique.

Si tu me demandes de n'afficher dans le GUI principal que la liste des tailles disponibles, j'avoue que j'y ai pensé mais que je ne me suis pas lancé dans cette aventure. Cela doit être possible, mais ça ne va pas être simple. Néanmoins, je suis ok pour essayer (je vais commencer dès ce soir).

Cordialement,
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#34 Post by ASRI éducation »

resizepfile-0.1.4
- fix infobox size (Don570)
- added local fr
- main gui : added information 'compatible sizes'
Attachments
resizepfile_main_gui-en.png
(99.07 KiB) Downloaded 1143 times
resizepfile-0.1.4_20130630.pet
md5 caf32e049bc8ab6f69913697d8adcb33
(10.38 KiB) Downloaded 626 times
Last edited by ASRI éducation on Thu 04 Jul 2013, 17:46, edited 1 time in total.
Pelo

10 sur 10 : parfait

#35 Post by Pelo »

impeccable, on sait de combien on peut agrandir. mci coop. je suis sur mon balcon.a+ chers puppistophyles. wonderful, free size is known, we can adjust resizing consequently. ASri is not the teacher but the Master.
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#36 Post by Argolance »

Bonjour,
Thank you: this is a nice job! :D

Cordialement.
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

resizepfile-0.1.4

#37 Post by ASRI éducation »

resizepfile-0.1.4
I am looking for translators.
Currently, the script is proposed only with language en-fr (gettext method).
Pelo

Resize Pupsave : en français, avec espace restant disponible

#38 Post by Pelo »

La version de ASRi francisée qui indique la taille restant disponible pour augmenter mes sauvegardes (tonneaux, image JejY) : J'avais oublié. Je remonte le post en surface, car toujours valide, mais bien plus, toujours utile.
Attachments
resize.jpg
(78.6 KiB) Downloaded 274 times
User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

Spanish locales

#39 Post by nilsonmorales »

Good work!!
Attachments
resizepfile.sh.mo_es.tar.gz
Locales en español para resizepfile.sh
(2.36 KiB) Downloaded 266 times
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]
Post Reply