Tutti i miei sbagli       Andrea Francia        andrea@andreafrancia.it – http://andreafrancia.itSaturday, March 24, 12   ...
Tutti i miei sbagli                         Errori di un wannabe Open Source Developer                                    ...
Il progetto                         Gli errori           Contenuti     Qualcosa di giusto                         Conclusi...
trash-cli                         https://github.com/andreafrancia/trash-cli                                             4...
Open Source                             GPLv2                               5     @andreafrancia   #trash-cliSaturday, Mar...
Linux                           6     @andreafrancia   #trash-cliSaturday, March 24, 12                                   ...
$ trash                         7   @andreafrancia   #trash-cliSaturday, March 24, 12                                     7
$ trash ./foo                             8   @andreafrancia   #trash-cliSaturday, March 24, 12                           ...
$ list-trash            2012-03-02 19:43:44 /Users/andrea/foo                               9      @andreafrancia   #trash...
$ trash a_dir/foo             $ trash another_dir/foo                           10   @andreafrancia   #trash-cliSaturday, ...
$ list-trash            2012-03-02 19:43:44 /home/andrea/foo            2012-03-02 19:50:04 /home/andrea/a_dir/…          ...
$ restore-trash         0 2012-03-02 19:43:44 /home/andrea/foo         1 2012-03-02 19:50:04 /home/andrea/a_d…         2 2...
$ empty-trash                         13   @andreafrancia   #trash-cliSaturday, March 24, 12                              ...
KDE                XFCE                         Gnome                            14   @andreafrancia   #trash-cliSaturday,...
Generic Naming Issue                          15   @andreafrancia   #trash-cliSaturday, March 24, 12                      ...
Protagonisti                              16   @andreafrancia   #trash-cliSaturday, March 24, 12                          ...
I nomi dei comandi               $ trash               $ list-trash               $ empty-trash               $ restore-tr...
Come funziona Fedora                                  18   @andreafrancia   #trash-cliSaturday, March 24, 12              ...
Un revisore di Fedora                         19   @andreafrancia   #trash-cliSaturday, March 24, 12                      ...
Distribuzioni                         Come funzionano?                                        20   @andreafrancia   #trash...
Distribuzioni                         Come funzionano?                                        21   @andreafrancia   #trash...
2X Absolute AbulÉdu AgiliaLinux Alinex aLinux Alpine ALT Ankur Bangla AnNyung antiX APODIO aptosid      Arch ArchBang Arch...
2X Absolute AbulÉdu AgiliaLinux Alinex aLinux Alpine ALT Ankur Bangla AnNyung antiX APODIO aptosid      Arch ArchBang Arch...
Debian                                       Fedora                                  24    @andreafrancia   #trash-cliSatu...
Debian                           25     @andreafrancia   #trash-cliSaturday, March 24, 12                                 ...
26   @andreafrancia   #trash-cliSaturday, March 24, 12                                      26
27   @andreafrancia   #trash-cliSaturday, March 24, 12                                      27
28   @andreafrancia   #trash-cliSaturday, March 24, 12                                      28
Fedora                           29     @andreafrancia   #trash-cliSaturday, March 24, 12                                 ...
Fedora                           30     @andreafrancia   #trash-cliSaturday, March 24, 12                                 ...
Nota                         A quei tempi il progetto si chiamava solo                         “trash” (come il comando)  ...
Reviewer“            The name of this package is also a bit             too generic, though not that much.Saturday, March ...
Reviewer“            Could upstream change it to be less             generic?       https:/Saturday, March 24, 12         ...
Developer“            Ok I’ll change to trash-cli.Saturday, March 24, 12                                34      @andreafra...
Reviewer“            [Ok...but...] The name of the             command should also be trash-             cli.    https:/Sa...
Developer“            The name of the main command is             trash without "-cli".Saturday, March 24, 12             ...
Developer“        The command is used is this way:       $ trash this-file      That means: "trash this-file in the      t...
Developer“            You are already using the             Command Line Interface.Saturday, March 24, 12                 ...
Developer“            In my opinion each command name             should reflect what the command             does.Saturda...
Reviewer“            As far as possible.Saturday, March 24, 12                            40     @andreafrancia           ...
Developer (and others)“            There are other programs with             generic names already             included!!S...
samba-common                         net                         profiles                         rpcclient               ...
Postgresql                         createdb                         createlang                         createuser        d...
The Player Project       Free Software tools for robot and sensor applications            $ repoquery -f /usr/bin/player  ...
Reviewer & others“            Precedent mistakes are not a             good reason to let other             generic names ...
... after some months                    and discussions ...                           46   @andreafrancia   #trash-cliSat...
Developer“                           .... OKSaturday, March 24, 12                              47      @andreafrancia    ...
Command names changed                    trash                trash-put                    list-trash                    r...
Command names changed                    trash                trash-put                    list-trash           trash-list...
Results                         Debian --> vecchi nomi                         Upstream --> nomi nuovi                    ...
Adesso ...                         lo includono?                               51   @andreafrancia   #trash-cliSaturday, M...
No!                          52   @andreafrancia   #trash-cliSaturday, March 24, 12                                       52
Il packager s’era                              stufato!                                 53   @andreafrancia   #trash-cliSa...
Results                         Debian --> vecchi nomi                         Upstream --> nomi nuovi                    ...
La beffa ...                              55   @andreafrancia   #trash-cliSaturday, March 24, 12                          ...
Dopo qualche mese ...                              56   @andreafrancia   #trash-cliSaturday, March 24, 12                 ...
... un altro packager...                            57   @andreafrancia   #trash-cliSaturday, March 24, 12                ...
... ri-propone trash-                 cli (con i vecchi nomi),                            e ...                           ...
... un altro revisore ...                              59   @andreafrancia   #trash-cliSaturday, March 24, 12             ...
... Accetta!                              60   @andreafrancia   #trash-cliSaturday, March 24, 12                          ...
Lessons Learned                         Non cambiare mai il nome dei comandi                         Non cedere alle press...
Acceptance Tests                                62   @andreafrancia   #trash-cliSaturday, March 24, 12                    ...
Acceptance Test                         È un test che verifica                         una feature.                       ...
Developer Test                         È un test che serve allo                         sviluppatore.                     ...
Usi dei Developer Test                         validare il codice                         supporto al design (con TDD)    ...
Developer Tests                         A volte sono chiamati: Unit Tests                                          66     ...
67   @andreafrancia   #trash-cliSaturday, March 24, 12                                      67
Come ho affrontato                            il problema                                 68   @andreafrancia   #trash-cli...
“                        Avere i test é bello...                                                            ”             ...
“                        Come li scrivo?                                                       ”                          ...
“              Developer Test --> in python                                                   ”                           ...
“                  Acceptance Test --> ?????                                                      ”                       ...
“             devo testare a livello utente                                                   ”                           ...
“                        l’utente usa la Bash                                                         ”                   ...
“              gli script in Bash sono facili                                                     ”                       ...
“                 esiste già un framework di                         test per Bash                                        ...
shunit                            77    @andreafrancia   #trash-cliSaturday, March 24, 12                                 ...
“                               IDEA:                         li scrivo in Bash!                                          ...
Era un buona idea?                                 79   @andreafrancia   #trash-cliSaturday, March 24, 12                 ...
80   @andreafrancia   #trash-cliSaturday, March 24, 12                                      80
Risultati                             81   @andreafrancia   #trash-cliSaturday, March 24, 12                              ...
Bash Tests are                            slooow!                               82   @andreafrancia   #trash-cliSaturday, ...
Little information in                    failure messages                            83   @andreafrancia   #trash-cliSatur...
Complex set-up                               84   @andreafrancia   #trash-cliSaturday, March 24, 12                       ...
Complex test set-up (1)                •$PATH tricks                                    85   @andreafrancia   #trash-cliSa...
Complex test set-up (2)                •Test volume creation                               86   @andreafrancia   #trash-cl...
Two test suites                         accetance test (in bash)                         developer test (python)          ...
Lessons Learned                                88   @andreafrancia   #trash-cliSaturday, March 24, 12                     ...
Test                         Se sono lenti                         Allora non li usi                                 89   ...
Test                         Se                         allora non li usi                                 90   @andreafran...
Test                         Se                         Allora li usi                               91    @andreafrancia  ...
Quindi                           Meglio se tutti                         omogenei (e.g. tutto                             ...
Bash Tests?                         Ok, ma pochi.                               93   @andreafrancia   #trash-cliSaturday, ...
shUnit non serve a                               niente                             Si può fare tutto in bash             ...
Testing with Bash                                 95   @andreafrancia   #trash-cliSaturday, March 24, 12                  ...
#!/bin/bash                  set,-o,errexit                           96   @andreafrancia   #trash-cliSaturday, March 24, ...
#!/bin/bash            set,-o,errexit,            set,-o,nounset                         97   @andreafrancia   #trash-cliS...
it_should_delete_the_argument.bash              #!/bin/bash              set,-o,errexit              set,-o,nounset       ...
Checking output of a                              command     #,comparing,output,of,a,command     diff,<(trash-list),-,<<,...
Licenza                            100   @andreafrancia   #trash-cliSaturday, March 24, 12                                ...
“                        Quale licenza?                                                       ”                           ...
“                        GPL                                                 ”                          102   @andreafranc...
GPL v2+            This program is free software; you can            redistribute it and/or modify it under            the...
or (at your option) any later       version.                         104   @andreafrancia   #trash-cliSaturday, March 24, ...
Lessons Learned                                105   @andreafrancia   #trash-cliSaturday, March 24, 12                    ...
Licenze già fatte?                         Comode ma vanno capite.                                   106   @andreafrancia ...
Il papiro all’inizio del file é                    una rottura                                   107   @andreafrancia   #t...
Papiro della GPL     #!/usr/bin/python     # list-trash: list trashed files     #     # Copyright (C) 2007,2008 Andrea Fra...
Esistono licenze più semplici!                               109   @andreafrancia   #trash-cliSaturday, March 24, 12      ...
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE                    Version 2, December 2004 Copyright (C) 2004 Sam...
Code Hosting                           Services                              111   @andreafrancia   #trash-cliSaturday, Ma...
sourceforge.net                                112   @andreafrancia   #trash-cliSaturday, March 24, 12                    ...
Lessons Learned                                113   @andreafrancia   #trash-cliSaturday, March 24, 12                    ...
Lessons Learned                         Il ser vizo di release é importante                                           113 ...
Lessons Learned                         Il ser vizo di release é importante                         Feedback barrier      ...
Lessons Learned                         Il ser vizo di release é importante                         Feedback barrier      ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Lessons Learned                          Il ser vizo di release é importante                          Feedback barrier    ...
Una scelta                         azzeccata: Python                                 114   @andreafrancia   #trash-cliSatu...
Internals : TrashDir                                  115   @andreafrancia   #trash-cliSaturday, March 24, 12             ...
TrashDir: dove sono                         nascosti i file cestinati                                     116   @andreafra...
How it works                              117   @andreafrancia   #trash-cliSaturday, March 24, 12                         ...
Gnome                            KDE                                  TrashDir                trash-cli                   ...
How it works      $,trash-put,pippo.txt      ~/.local/share/Trash/,,,,,,,,,,,,+---------------------------------+      ,,,...
How it works      $,touch,pippo.txt;,trash-put,pippo.txt,,,,,#,again      $,touch,pippo.txt;,trash-put,pippo.txt,,,,,#,aga...
Gnome                          KDE                                TrashDir                         cli                    ...
122   @andreafrancia   #trash-cliSaturday, March 24, 12                                   122
pippo.txt                               pippo.txt                         123        @andreafrancia   #trash-cliSaturday, ...
open(3)      #include,<sys/stat.h>,,,,,,,,,,,,,,,,,,,,,,,,,,,      #include,<fcntl.h>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,      ,...
os.open      import,os      fd,=,os.open(dest,,os.O_RDWR,,|,      ,,,,,,,,,,,,,,,,,,,os.O_CREAT,|      ,,,,,,,,,,,,,,,,,,,...
Conclusioni                              126   @andreafrancia   #trash-cliSaturday, March 24, 12                          ...
Come lo farei ora?                                 127   @andreafrancia   #trash-cliSaturday, March 24, 12                ...
Beer/Pizza License                                 128   @andreafrancia   #trash-cliSaturday, March 24, 12                ...
Git                         129   @andreafrancia   #trash-cliSaturday, March 24, 12                                   129
GitHub                           130    @andreafrancia   #trash-cliSaturday, March 24, 12                                 ...
No Wiki, solo .txt nei i                              sorgenti                                    131   @andreafrancia   #...
No mailing list.                                132   @andreafrancia   #trash-cliSaturday, March 24, 12                   ...
Nessuno sforzo per                     l’inclusione in distribuzioni                                  133   @andreafrancia...
Ma qualcuno lo usa?                                  134   @andreafrancia   #trash-cliSaturday, March 24, 12              ...
Distribuzioni                         Debian (e Ubuntu)                         Fedora                         Arch Linux ...
Altri progetti               LXDE usa trash-cli come libreria                    (*) LXDE: Light weight X11 Desktop Enviro...
http://qa.debian.org/popcon-graph.php?packages=trash-cli                                  137       @andreafrancia   #tras...
Grazie                              Andrea Francia                          http://andreafrancia.it                       ...
Grazie                              Andrea Francia                          http://andreafrancia.it                       ...
Upcoming SlideShare
Loading in …5
×

Tutti i miei sbagli (Errori di un wannabe Open Source Developer)

5,317 views

Published on

É vero che sbagliare é un buon modo per imparare, ma é ancora meglio
imparare dagli errori degli altri.

Sara` presentata una carrellata di tutti gli errori che ho fatto durante lo
sviluppo del progetto Open Source `trash-cli`. Errori di tutti i tipi:
manageriali, architetturali, di design e di metodologia.

Versione Codemotion Mar 24, 2012

Published in: Technology, News & Politics
  • Be the first to comment

Tutti i miei sbagli (Errori di un wannabe Open Source Developer)

  1. 1. Tutti i miei sbagli Andrea Francia andrea@andreafrancia.it – http://andreafrancia.itSaturday, March 24, 12 1
  2. 2. Tutti i miei sbagli Errori di un wannabe Open Source Developer Andrea Francia 2 @andreafrancia #trash-cliSaturday, March 24, 12 2
  3. 3. Il progetto Gli errori Contenuti Qualcosa di giusto Conclusioni Applausi 3 @andreafrancia #trash-cliSaturday, March 24, 12 3
  4. 4. trash-cli https://github.com/andreafrancia/trash-cli 4 @andreafrancia #trash-cliSaturday, March 24, 12 4
  5. 5. Open Source GPLv2 5 @andreafrancia #trash-cliSaturday, March 24, 12 5
  6. 6. Linux 6 @andreafrancia #trash-cliSaturday, March 24, 12 6
  7. 7. $ trash 7 @andreafrancia #trash-cliSaturday, March 24, 12 7
  8. 8. $ trash ./foo 8 @andreafrancia #trash-cliSaturday, March 24, 12 8
  9. 9. $ list-trash 2012-03-02 19:43:44 /Users/andrea/foo 9 @andreafrancia #trash-cliSaturday, March 24, 12 9
  10. 10. $ trash a_dir/foo $ trash another_dir/foo 10 @andreafrancia #trash-cliSaturday, March 24, 12 10
  11. 11. $ list-trash 2012-03-02 19:43:44 /home/andrea/foo 2012-03-02 19:50:04 /home/andrea/a_dir/… 2012-03-02 19:50:05 /home/andrea/anothe… 11 @andreafrancia #trash-cliSaturday, March 24, 12 11
  12. 12. $ restore-trash 0 2012-03-02 19:43:44 /home/andrea/foo 1 2012-03-02 19:50:04 /home/andrea/a_d… 2 2012-03-02 19:50:05 /home/andrea/ano… File to restore? [0..2]: 12 @andreafrancia #trash-cliSaturday, March 24, 12 12
  13. 13. $ empty-trash 13 @andreafrancia #trash-cliSaturday, March 24, 12 13
  14. 14. KDE XFCE Gnome 14 @andreafrancia #trash-cliSaturday, March 24, 12 14
  15. 15. Generic Naming Issue 15 @andreafrancia #trash-cliSaturday, March 24, 12 15
  16. 16. Protagonisti 16 @andreafrancia #trash-cliSaturday, March 24, 12 16
  17. 17. I nomi dei comandi $ trash $ list-trash $ empty-trash $ restore-trash 17 @andreafrancia #trash-cliSaturday, March 24, 12 17
  18. 18. Come funziona Fedora 18 @andreafrancia #trash-cliSaturday, March 24, 12 18
  19. 19. Un revisore di Fedora 19 @andreafrancia #trash-cliSaturday, March 24, 12 19
  20. 20. Distribuzioni Come funzionano? 20 @andreafrancia #trash-cliSaturday, March 24, 12 20
  21. 21. Distribuzioni Come funzionano? 21 @andreafrancia #trash-cliSaturday, March 24, 12 21
  22. 22. 2X Absolute AbulÉdu AgiliaLinux Alinex aLinux Alpine ALT Ankur Bangla AnNyung antiX APODIO aptosid Arch ArchBang ArcheOS AriOS Ark ArtistX Asianux Astaro AsteriskNOW Asturix Aurora AUSTRUMI AV Linux BackBox BackTrack Baltix Bardinux Bayanihan BeakOS Berry BigLinux Bio-Linux blackPanther BLAG BlankOn Bodhi BOSS BRLix Burapha CAELinux CAINE Caixa Mágica Calculate Canaima Caos Càtix CCux CDlinux CensorNet CentOS Chakra ClearOS Clonezilla Comfusion Commodore Connochaet Coyote CrunchBang CRUX CTKArch Debian DebXPde Deepin DEFT DesktopBSD Devil DigAnTel DoudouLinux Draco DragonFly Dragora Dreamlinux Dream Studio dyne:bolic EasyPeasy Edubuntu Ekaaty Elastix elementary Endian Epidemic Estrella Roja ESUN Evinux ExTiX Fedora Fermi Finnix Foresight FreeBSD FreeNAS Frenzy Frugalware Fuduntu FuguIta Funtoo Fusion GeeXboX Gentoo Gentoox GhostBSD Gibraltar GnackTrack GParted Greenie Grml Guadalinex Hacao Haiku Hanthana Helix IDMS Imagineos Inquisitor Insigne IPCop IPFire Jibbed JoLinux Joli OS K12Linux kademar KahelOS KANOTIX Karoshi Kiwi Knoppel KNOPPIX KnoSciences Kongoni Kororaa Kubuntu Kwort Leeenux Legacy LFS LinHES Linpus LinuxConsole Linux-EduCD linuX-gamers LinuxTLE Linvo Liquid Lemur Litrix LliureX LPS Lubuntu Lunar m0n0wall Macpup Madbox Mageia Magic Mandriva Mangaka Matriux MAX MEPIS MidnightBSD MiniNo MINIX Mint Miracle MirOS MoLinux Momonga Monomaxos moonOS Musix Myrinix Mythbuntu Natures NetBSD Netrunner NetSecL Nexenta NexentaStor NST NuTyX Ojuba OLPC Omoikane O-Net OpenBSD Openfiler OpenIndiana openmamba OpenMediaVault openSUSE Openwall Open Xange Ophcrack Oracle Otakux Overclockix PAIPIX paldo PapugLinux Parabola Pardus Parsix Parted Magic PC-BSD PCLinuxOS Pear PelicanHPC Pentoo Peppermint pfSense Phayoune Pinguy Plamo PLD Plop Porteus Poseidon pQui Privatix Proxmox PUIAS Puppy Puredyne PureOS Qimo Qomo Quirky Red Flag Red Hat Redo redWall Resulinux RIPLinuX Rocks Cluster ROSA Runtu Sabayon Sabily SalineOS Salix SAMity Satux SchilliX Scientific Securepoint Semplice siduction Skolelinux Slackware SliTaz SME Ser ver SmoothWall SMS Snowlinux SoL Solaris Sorcerer Source Mage STD StressLinux SuliX SuperGamer Super OS SuperX Suriyan SUSE Swift Syllable SystemRescue T2 Tails Tango Studio TFM Thinstation Tiny Core TinyMe Toorox Toutou Trinity Trisquel trixbox Tuquito Turbolinux TurnKey UberStudent Ubuntu Ubuntu DP Ubuntu Rescue Ubuntu Studio UHU-Linux Ulteo Ultimate Unity Untangle UPR Userful UTUTO Vector VENENUX Vine Vinux VLOS VMKnoppix VortexBox Vyatta wattOS Webconverger Wifislax xPUD Xubuntu Yellow Dog Ylmf Yoper Zentyal Zenwalk Zeroshell ZevenOS Zorin From of http://distrowatch.com/ 22 @andreafrancia #trash-cliSaturday, March 24, 12 22
  23. 23. 2X Absolute AbulÉdu AgiliaLinux Alinex aLinux Alpine ALT Ankur Bangla AnNyung antiX APODIO aptosid Arch ArchBang ArcheOS AriOS Ark ArtistX Asianux Astaro AsteriskNOW Asturix Aurora AUSTRUMI AV Linux BackBox BackTrack Baltix Bardinux Bayanihan BeakOS Berry BigLinux Bio-Linux blackPanther BLAG BlankOn Bodhi BOSS BRLix Burapha CAELinux CAINE Caixa Mágica Calculate Canaima Caos Càtix CCux CDlinux CensorNet CentOS Chakra ClearOS Clonezilla Comfusion Commodore Connochaet Coyote CrunchBang CRUX CTKArch Debian DebXPde Deepin DEFT DesktopBSD Devil DigAnTel DoudouLinux Draco DragonFly Dragora Dreamlinux Dream Studio dyne:bolic EasyPeasy Edubuntu Ekaaty Elastix elementary Endian Epidemic Estrella Roja ESUN Evinux ExTiX Fedora Fermi Finnix Foresight FreeBSD FreeNAS Frenzy Frugalware Fuduntu FuguIta Funtoo Fusion GeeXboX Gentoo Gentoox GhostBSD Gibraltar GnackTrack GParted Greenie Grml Guadalinex Hacao Haiku Hanthana Helix IDMS Imagineos Inquisitor Insigne IPCop IPFire Jibbed JoLinux Joli OS K12Linux kademar KahelOS KANOTIX Karoshi Kiwi Knoppel KNOPPIX KnoSciences Kongoni Kororaa Kubuntu Kwort Leeenux Legacy LFS LinHES Linpus LinuxConsole Linux-EduCD linuX-gamers LinuxTLE Linvo Liquid Lemur Litrix LliureX LPS Lubuntu Lunar m0n0wall Macpup Madbox Mageia Magic Mandriva Mangaka Matriux MAX MEPIS MidnightBSD MiniNo MINIX Mint Miracle MirOS MoLinux Momonga Monomaxos moonOS Musix Myrinix Mythbuntu Natures NetBSD Netrunner NetSecL Nexenta NexentaStor NST NuTyX Ojuba OLPC Omoikane O-Net OpenBSD Openfiler OpenIndiana openmamba OpenMediaVault openSUSE Openwall Open Xange Ophcrack Oracle Otakux Overclockix PAIPIX paldo PapugLinux Parabola Pardus Parsix Parted Magic PC-BSD PCLinuxOS Pear PelicanHPC Pentoo Peppermint pfSense Phayoune Pinguy Plamo PLD Plop Porteus Poseidon pQui Privatix Proxmox PUIAS Puppy Puredyne PureOS Qimo Qomo Quirky Red Flag Red Hat Redo redWall Resulinux RIPLinuX Rocks Cluster ROSA Runtu Sabayon Sabily SalineOS Salix SAMity Satux SchilliX Scientific Securepoint Semplice siduction Skolelinux Slackware SliTaz SME Ser ver SmoothWall SMS Snowlinux SoL Solaris Sorcerer Source Mage STD StressLinux SuliX SuperGamer Super OS SuperX Suriyan SUSE Swift Syllable SystemRescue T2 Tails Tango Studio TFM Thinstation Tiny Core TinyMe Toorox Toutou Trinity Trisquel trixbox Tuquito Turbolinux TurnKey UberStudent Ubuntu Ubuntu DP Ubuntu Rescue Ubuntu Studio UHU-Linux Ulteo Ultimate Unity Untangle UPR Userful UTUTO Vector VENENUX Vine Vinux VLOS VMKnoppix VortexBox Vyatta wattOS Webconverger Wifislax xPUD Xubuntu Yellow Dog Ylmf Yoper Zentyal Zenwalk Zeroshell ZevenOS Zorin See on http://distrowatch.com/ 23 @andreafrancia #trash-cliSaturday, March 24, 12 23
  24. 24. Debian Fedora 24 @andreafrancia #trash-cliSaturday, March 24, 12 24
  25. 25. Debian 25 @andreafrancia #trash-cliSaturday, March 24, 12 25
  26. 26. 26 @andreafrancia #trash-cliSaturday, March 24, 12 26
  27. 27. 27 @andreafrancia #trash-cliSaturday, March 24, 12 27
  28. 28. 28 @andreafrancia #trash-cliSaturday, March 24, 12 28
  29. 29. Fedora 29 @andreafrancia #trash-cliSaturday, March 24, 12 29
  30. 30. Fedora 30 @andreafrancia #trash-cliSaturday, March 24, 12 30
  31. 31. Nota A quei tempi il progetto si chiamava solo “trash” (come il comando) 31 @andreafrancia #trash-cliSaturday, March 24, 12 31
  32. 32. Reviewer“ The name of this package is also a bit too generic, though not that much.Saturday, March 24, 12 32 @andreafrancia ” #trash-cli 32
  33. 33. Reviewer“ Could upstream change it to be less generic? https:/Saturday, March 24, 12 33 ” /bugzilla.redhat.com/show_bug.cgi?id=448122#c1 @andreafrancia #trash-cli 33
  34. 34. Developer“ Ok I’ll change to trash-cli.Saturday, March 24, 12 34 @andreafrancia ” #trash-cli 34
  35. 35. Reviewer“ [Ok...but...] The name of the command should also be trash- cli. https:/Saturday, March 24, 12 35 ” /bugzilla.redhat.com/show_bug.cgi?id=448122#c6 @andreafrancia #trash-cli 35
  36. 36. Developer“ The name of the main command is trash without "-cli".Saturday, March 24, 12 36 @andreafrancia ” #trash-cli 36
  37. 37. Developer“ The command is used is this way: $ trash this-file That means: "trash this-file in the trashcan", there is no reason to append the "-cli" suffix to the main command.Saturday, March 24, 12 37 @andreafrancia ” #trash-cli 37
  38. 38. Developer“ You are already using the Command Line Interface.Saturday, March 24, 12 38 @andreafrancia ” #trash-cli 38
  39. 39. Developer“ In my opinion each command name should reflect what the command does.Saturday, March 24, 12 39 @andreafrancia ” #trash-cli 39
  40. 40. Reviewer“ As far as possible.Saturday, March 24, 12 40 @andreafrancia ” #trash-cli 40
  41. 41. Developer (and others)“ There are other programs with generic names already included!!Saturday, March 24, 12 41 @andreafrancia ” #trash-cli 41
  42. 42. samba-common net profiles rpcclient testparm 42 @andreafrancia #trash-cliSaturday, March 24, 12 42
  43. 43. Postgresql createdb createlang createuser droplang dropdb dropuser 43 @andreafrancia #trash-cliSaturday, March 24, 12 43
  44. 44. The Player Project Free Software tools for robot and sensor applications $ repoquery -f /usr/bin/player player-0:2.1.1-5.fc10.i386 44 @andreafrancia #trash-cliSaturday, March 24, 12 44
  45. 45. Reviewer & others“ Precedent mistakes are not a good reason to let other generic names enter the distro. https:/ http:/ October/msg00223.htmlSaturday, March 24, 12 45 @andreafrancia ” /bugzilla.redhat.com/show_bug.cgi?id=448122#c17 /www.redhat.com/archives/fedora-devel-list/2008- #trash-cli 45
  46. 46. ... after some months and discussions ... 46 @andreafrancia #trash-cliSaturday, March 24, 12 46
  47. 47. Developer“ .... OKSaturday, March 24, 12 47 @andreafrancia ” #trash-cli 47
  48. 48. Command names changed trash trash-put list-trash restore-trash empty-trash 48 @andreafrancia #trash-cliSaturday, March 24, 12 48
  49. 49. Command names changed trash trash-put list-trash trash-list restore-trash trash-restore empty-trash trash-empty 49 @andreafrancia #trash-cliSaturday, March 24, 12 49
  50. 50. Results Debian --> vecchi nomi Upstream --> nomi nuovi 50 @andreafrancia #trash-cliSaturday, March 24, 12 50
  51. 51. Adesso ... lo includono? 51 @andreafrancia #trash-cliSaturday, March 24, 12 51
  52. 52. No! 52 @andreafrancia #trash-cliSaturday, March 24, 12 52
  53. 53. Il packager s’era stufato! 53 @andreafrancia #trash-cliSaturday, March 24, 12 53
  54. 54. Results Debian --> vecchi nomi Upstream --> nomi nuovi Fedora --> niente! 54 @andreafrancia #trash-cliSaturday, March 24, 12 54
  55. 55. La beffa ... 55 @andreafrancia #trash-cliSaturday, March 24, 12 55
  56. 56. Dopo qualche mese ... 56 @andreafrancia #trash-cliSaturday, March 24, 12 56
  57. 57. ... un altro packager... 57 @andreafrancia #trash-cliSaturday, March 24, 12 57
  58. 58. ... ri-propone trash- cli (con i vecchi nomi), e ... 58 @andreafrancia #trash-cliSaturday, March 24, 12 58
  59. 59. ... un altro revisore ... 59 @andreafrancia #trash-cliSaturday, March 24, 12 59
  60. 60. ... Accetta! 60 @andreafrancia #trash-cliSaturday, March 24, 12 60
  61. 61. Lessons Learned Non cambiare mai il nome dei comandi Non cedere alle pressioni dei revisori (tanto cambiano) More at: https://github.com/andreafrancia/trash-cli/blob/ master/docs/about-the-generic-naming-issue.txt 61 @andreafrancia #trash-cliSaturday, March 24, 12 61
  62. 62. Acceptance Tests 62 @andreafrancia #trash-cliSaturday, March 24, 12 62
  63. 63. Acceptance Test È un test che verifica una feature. 63 @andreafrancia #trash-cliSaturday, March 24, 12 63
  64. 64. Developer Test È un test che serve allo sviluppatore. 64 @andreafrancia #trash-cliSaturday, March 24, 12 64
  65. 65. Usi dei Developer Test validare il codice supporto al design (con TDD) rilevare regressioni imparare una libreria documentare l’uso di una libreria .... 65 @andreafrancia #trash-cliSaturday, March 24, 12 65
  66. 66. Developer Tests A volte sono chiamati: Unit Tests 66 @andreafrancia #trash-cliSaturday, March 24, 12 66
  67. 67. 67 @andreafrancia #trash-cliSaturday, March 24, 12 67
  68. 68. Come ho affrontato il problema 68 @andreafrancia #trash-cliSaturday, March 24, 12 68
  69. 69. “ Avere i test é bello... ” 69 @andreafrancia #trash-cliSaturday, March 24, 12 69
  70. 70. “ Come li scrivo? ” 70 @andreafrancia #trash-cliSaturday, March 24, 12 70
  71. 71. “ Developer Test --> in python ” 71 @andreafrancia #trash-cliSaturday, March 24, 12 71
  72. 72. “ Acceptance Test --> ????? ” 72 @andreafrancia #trash-cliSaturday, March 24, 12 72
  73. 73. “ devo testare a livello utente ” 73 @andreafrancia #trash-cliSaturday, March 24, 12 73
  74. 74. “ l’utente usa la Bash ” 74 @andreafrancia #trash-cliSaturday, March 24, 12 74
  75. 75. “ gli script in Bash sono facili ” 75 @andreafrancia #trash-cliSaturday, March 24, 12 75
  76. 76. “ esiste già un framework di test per Bash ” 76 @andreafrancia #trash-cliSaturday, March 24, 12 76
  77. 77. shunit 77 @andreafrancia #trash-cliSaturday, March 24, 12 77
  78. 78. “ IDEA: li scrivo in Bash! ” 78 @andreafrancia #trash-cliSaturday, March 24, 12 78
  79. 79. Era un buona idea? 79 @andreafrancia #trash-cliSaturday, March 24, 12 79
  80. 80. 80 @andreafrancia #trash-cliSaturday, March 24, 12 80
  81. 81. Risultati 81 @andreafrancia #trash-cliSaturday, March 24, 12 81
  82. 82. Bash Tests are slooow! 82 @andreafrancia #trash-cliSaturday, March 24, 12 82
  83. 83. Little information in failure messages 83 @andreafrancia #trash-cliSaturday, March 24, 12 83
  84. 84. Complex set-up 84 @andreafrancia #trash-cliSaturday, March 24, 12 84
  85. 85. Complex test set-up (1) •$PATH tricks 85 @andreafrancia #trash-cliSaturday, March 24, 12 85
  86. 86. Complex test set-up (2) •Test volume creation 86 @andreafrancia #trash-cliSaturday, March 24, 12 86
  87. 87. Two test suites accetance test (in bash) developer test (python) 87 @andreafrancia #trash-cliSaturday, March 24, 12 87
  88. 88. Lessons Learned 88 @andreafrancia #trash-cliSaturday, March 24, 12 88
  89. 89. Test Se sono lenti Allora non li usi 89 @andreafrancia #trash-cliSaturday, March 24, 12 89
  90. 90. Test Se allora non li usi 90 @andreafrancia #trash-cliSaturday, March 24, 12 90
  91. 91. Test Se Allora li usi 91 @andreafrancia #trash-cliSaturday, March 24, 12 91
  92. 92. Quindi Meglio se tutti omogenei (e.g. tutto python) 92 @andreafrancia #trash-cliSaturday, March 24, 12 92
  93. 93. Bash Tests? Ok, ma pochi. 93 @andreafrancia #trash-cliSaturday, March 24, 12 93
  94. 94. shUnit non serve a niente Si può fare tutto in bash 94 @andreafrancia #trash-cliSaturday, March 24, 12 94
  95. 95. Testing with Bash 95 @andreafrancia #trash-cliSaturday, March 24, 12 95
  96. 96. #!/bin/bash set,-o,errexit 96 @andreafrancia #trash-cliSaturday, March 24, 12 96
  97. 97. #!/bin/bash set,-o,errexit, set,-o,nounset 97 @andreafrancia #trash-cliSaturday, March 24, 12 97
  98. 98. it_should_delete_the_argument.bash #!/bin/bash set,-o,errexit set,-o,nounset #,given,a,file,named,foo touch,foo #,when,I,put,the,file,in,the,trash trash-put,foo #,then,the,file,should,have,been,gone test,!,-f,foo 98 @andreafrancia #trash-cliSaturday, March 24, 12 98
  99. 99. Checking output of a command #,comparing,output,of,a,command diff,<(trash-list),-,<<,EXPECTED_OUTPUT 2012-03-02,19:43:44,/Users/andrea/foo 2012-03-02,19:44:04,/Users/andrea/foo EXPECTED_OUTPUT 99 @andreafrancia #trash-cliSaturday, March 24, 12 99
  100. 100. Licenza 100 @andreafrancia #trash-cliSaturday, March 24, 12 100
  101. 101. “ Quale licenza? ” 101 @andreafrancia #trash-cliSaturday, March 24, 12 101
  102. 102. “ GPL ” 102 @andreafrancia #trash-cliSaturday, March 24, 12 102
  103. 103. GPL v2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 103 @andreafrancia #trash-cliSaturday, March 24, 12 103
  104. 104. or (at your option) any later version. 104 @andreafrancia #trash-cliSaturday, March 24, 12 104
  105. 105. Lessons Learned 105 @andreafrancia #trash-cliSaturday, March 24, 12 105
  106. 106. Licenze già fatte? Comode ma vanno capite. 106 @andreafrancia #trash-cliSaturday, March 24, 12 106
  107. 107. Il papiro all’inizio del file é una rottura 107 @andreafrancia #trash-cliSaturday, March 24, 12 107
  108. 108. Papiro della GPL #!/usr/bin/python # list-trash: list trashed files # # Copyright (C) 2007,2008 Andrea Francia Trivolzio(PV) Italy # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. from libtrash import TrashDirectory for trashed_file in TrashDirectory.trashed_files() :     print "%s %s" % (trashed_file.deletion_date, trashed_file.path) 108 @andreafrancia #trash-cliSaturday, March 24, 12 108
  109. 109. Esistono licenze più semplici! 109 @andreafrancia #trash-cliSaturday, March 24, 12 109
  110. 110.             DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE                    Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION  0. You just DO WHAT THE FUCK YOU WANT TO. http://sam.zoy.org/wtfpl/ 110 @andreafrancia #trash-cli Saturday, March 24, 12 110
  111. 111. Code Hosting Services 111 @andreafrancia #trash-cliSaturday, March 24, 12 111
  112. 112. sourceforge.net 112 @andreafrancia #trash-cliSaturday, March 24, 12 112
  113. 113. Lessons Learned 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  114. 114. Lessons Learned Il ser vizo di release é importante 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  115. 115. Lessons Learned Il ser vizo di release é importante Feedback barrier 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  116. 116. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  117. 117. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare sf.net 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  118. 118. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare sf.net google code 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  119. 119. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare bitbucket sf.net google code 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  120. 120. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare bitbucket sf.net google code 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  121. 121. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare bitbucket sf.net google code GitHub 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  122. 122. Lessons Learned Il ser vizo di release é importante Feedback barrier Si può sempre cambiare bitbucket sf.net google code ? GitHub 113 @andreafrancia #trash-cliSaturday, March 24, 12 113
  123. 123. Una scelta azzeccata: Python 114 @andreafrancia #trash-cliSaturday, March 24, 12 114
  124. 124. Internals : TrashDir 115 @andreafrancia #trash-cliSaturday, March 24, 12 115
  125. 125. TrashDir: dove sono nascosti i file cestinati 116 @andreafrancia #trash-cliSaturday, March 24, 12 116
  126. 126. How it works 117 @andreafrancia #trash-cliSaturday, March 24, 12 117
  127. 127. Gnome KDE TrashDir trash-cli XFCE 118 @andreafrancia #trash-cliSaturday, March 24, 12 118
  128. 128. How it works $,trash-put,pippo.txt ~/.local/share/Trash/,,,,,,,,,,,,+---------------------------------+ ,,,,info/,,,,,,,,,,,,,,,,,,,-----|,[Trash,Info],,,,,,,,,,,,,,,,,,,,| ,,,,,,,,pippo.txt.trashinfo,,,,,,|,Path=/tmp/pippo.txt,,,,,,,,,,,,,| ,,,,files/,,,,,,,,,,,,,,,,,,,,,,,|,DeletionDate=2012-02-29T00:13:54| ,,,,,,,,pippo.txt,,,,,,,,,,,,,,,,+---------------------------------+ ,,,,,,,,,,,,,,,,,`. ,,,,,,,,,,,,,,,,,,,`-,original,file,moved,here 119 @andreafrancia #trash-cliSaturday, March 24, 12 119
  129. 129. How it works $,touch,pippo.txt;,trash-put,pippo.txt,,,,,#,again $,touch,pippo.txt;,trash-put,pippo.txt,,,,,#,again $,touch,pippo.txt;,trash-put,pippo.txt,,,,,#,again ~/.local/share/Trash/, ,,,,info/,,,,,,,,,,,,,,,,,, ,,,,,,,,pippo.txt.trashinfo ,,,,,,,,pippo_1.txt.trashinfo ,,,,,,,,pippo_2.txt.trashinfo ,,,,,,,,pippo_3.txt.trashinfo ,,,,files/,,,,,,,,,,,,,,,,, ,,,,,,,,pippo.txt,,,,,,,,,, ,,,,,,,,pippo_1.txt,,,,,,,,,, ,,,,,,,,pippo_2.txt,,,,,,,,,, ,,,,,,,,pippo_3.txt,,,,,,,,,, 120 @andreafrancia #trash-cliSaturday, March 24, 12 120
  130. 130. Gnome KDE TrashDir cli XFCE 121 @andreafrancia #trash-cliSaturday, March 24, 12 121
  131. 131. 122 @andreafrancia #trash-cliSaturday, March 24, 12 122
  132. 132. pippo.txt pippo.txt 123 @andreafrancia #trash-cliSaturday, March 24, 12 123
  133. 133. open(3) #include,<sys/stat.h>,,,,,,,,,,,,,,,,,,,,,,,,,,, #include,<fcntl.h>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, int,open(const,char,*path,,int,oflag,,...,);,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,^,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,O_EXCL,|,O_CREAT,-’, 124 @andreafrancia #trash-cliSaturday, March 24, 12 124
  134. 134. os.open import,os fd,=,os.open(dest,,os.O_RDWR,,|, ,,,,,,,,,,,,,,,,,,,os.O_CREAT,| ,,,,,,,,,,,,,,,,,,,os.O_EXCL,,0600) ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, os.write(fd,,content) os.close(fd) logger.trashinfo_created_as(dest) return,(dest,,trash_id) 125 @andreafrancia #trash-cliSaturday, March 24, 12 125
  135. 135. Conclusioni 126 @andreafrancia #trash-cliSaturday, March 24, 12 126
  136. 136. Come lo farei ora? 127 @andreafrancia #trash-cliSaturday, March 24, 12 127
  137. 137. Beer/Pizza License 128 @andreafrancia #trash-cliSaturday, March 24, 12 128
  138. 138. Git 129 @andreafrancia #trash-cliSaturday, March 24, 12 129
  139. 139. GitHub 130 @andreafrancia #trash-cliSaturday, March 24, 12 130
  140. 140. No Wiki, solo .txt nei i sorgenti 131 @andreafrancia #trash-cliSaturday, March 24, 12 131
  141. 141. No mailing list. 132 @andreafrancia #trash-cliSaturday, March 24, 12 132
  142. 142. Nessuno sforzo per l’inclusione in distribuzioni 133 @andreafrancia #trash-cliSaturday, March 24, 12 133
  143. 143. Ma qualcuno lo usa? 134 @andreafrancia #trash-cliSaturday, March 24, 12 134
  144. 144. Distribuzioni Debian (e Ubuntu) Fedora Arch Linux Foresight Linux OpenSuse ... forse altri 135 @andreafrancia #trash-cliSaturday, March 24, 12 135
  145. 145. Altri progetti LXDE usa trash-cli come libreria (*) LXDE: Light weight X11 Desktop Environment 136 @andreafrancia #trash-cliSaturday, March 24, 12 136
  146. 146. http://qa.debian.org/popcon-graph.php?packages=trash-cli 137 @andreafrancia #trash-cliSaturday, March 24, 12 137
  147. 147. Grazie Andrea Francia http://andreafrancia.it andrea@andreafrancia.it 139 138 @andreafrancia #trash-cliSaturday, March 24, 12 138
  148. 148. Grazie Andrea Francia http://andreafrancia.it andrea@andreafrancia.it Libero da settembre 2012 139 @andreafrancia #trash-cliSaturday, March 24, 12 139

×