tutti i miei sbagli, versione 7 marzo 2012 al xpug mi
DESCRIPTION
Gli errori e le lezioni che ho imparato dallo sviluppo di un progetto Open SourceTRANSCRIPT
![Page 1: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/1.jpg)
Tutti i miei sbagli Gli errori di un Wannabe Open Source Developer
Andrea Francia
Thursday, March 8, 12
![Page 2: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/2.jpg)
Contenuti
Il progettoGli Sbagli• Generic Naming Issue• Using Bash for functional
testing• Feedback• License• Project hostingUna cosa giustaConclusioniApplausi
Thursday, March 8, 12
![Page 3: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/3.jpg)
trash-cli$ trash foo
$ list-trash
2012-03-02 19:43:44 /Users/andrea/foo
$ touch foo; trash foo
$ list-trash
2012-03-02 19:43:44 /Users/andrea/foo
2012-03-02 19:44:04 /Users/andrea/foo
$ restore-trash
0 2012-03-02 19:43:44 /Users/andrea/foo
1 2012-03-02 19:44:04 /Users/andrea/foo
What file to restore [0..1]:0
Thursday, March 8, 12
![Page 4: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/4.jpg)
Generic Naming Issue
Thursday, March 8, 12
![Page 5: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/5.jpg)
Comandi del pacchettotrash Butta un file
empty-trash Svuota tutto il cestino
list-trash Elenca il contenuto
restore-trash Recupera un file
Thursday, March 8, 12
![Page 6: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/6.jpg)
Debian
Thursday, March 8, 12
![Page 7: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/7.jpg)
Fedora
Thursday, March 8, 12
![Page 8: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/8.jpg)
trashlist-trashrestore-trashempty-trash
Debian
FedoraQArejected
OK
Thursday, March 8, 12
![Page 9: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/9.jpg)
Command name changes
trashlist-trashrestore-trashempty-trash
trash-puttrash-listtrash-restoretrash-empty
Thursday, March 8, 12
![Page 10: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/10.jpg)
Risultato
Debian --> vecchi nomiUpstream --> nomi nuoviFedora --> Niente!!! (perdita di interesse dal package maintainer)
Thursday, March 8, 12
![Page 11: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/11.jpg)
Lessons Learned
Non cambiare mai il nome dei comandiNon cedere alle pressioni dei revisori (tanto cambiano)
More at: https://github.com/andreafrancia/trash-cli/blob/master/docs/about-the-generic-naming-issue.txt
Thursday, March 8, 12
![Page 12: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/12.jpg)
Using Bash for functional testing
Thursday, March 8, 12
![Page 13: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/13.jpg)
shunit
Thursday, March 8, 12
![Page 14: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/14.jpg)
Results
Very slow testsUnreadable failure messagesComplex fixture set upTwo test suites (bash+python)
Thursday, March 8, 12
![Page 15: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/15.jpg)
Lessons LearnedTest di Integrazione? Ok, servono ma meglio che siano pochi.Test Funzionali? Meglio che siano omogenei con i test di unitàPer la bash non sono necessarie librerie/framework di test
Thursday, March 8, 12
![Page 16: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/16.jpg)
Bash for Testing(1)
#!/bin/bashset -‐o errexitset -‐o nounset
Thursday, March 8, 12
![Page 17: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/17.jpg)
Bash for Testing(2)
touch footrash-‐put foo
# foo should have been deletedtest ! -‐f foo
Thursday, March 8, 12
![Page 18: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/18.jpg)
Bash for Testing(3)
diff <(trash-‐list) -‐ << EXPECTED_RESULT2012-‐03-‐02 19:43:44 /Users/andrea/foo2012-‐03-‐02 19:44:04 /Users/andrea/fooEXPECTED_RESULT
Thursday, March 8, 12
![Page 19: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/19.jpg)
License
Thursday, March 8, 12
![Page 20: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/20.jpg)
GPL v2+
Thursday, March 8, 12
![Page 21: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/21.jpg)
Lessons Learned
Thursday, March 8, 12
![Page 22: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/22.jpg)
Lessons Learned (1)
Licenze già fatte sono comode ma vanno capite
Thursday, March 8, 12
![Page 23: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/23.jpg)
Lessons Learned (2)
Il papiro all’inizio del file é una rottura
Thursday, March 8, 12
![Page 24: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/24.jpg)
#!/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)
Papiro della GPL
Thursday, March 8, 12
![Page 25: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/25.jpg)
Lessons learned (3)
A volte conviene usare licenze più semplici
Thursday, March 8, 12
![Page 26: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/26.jpg)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
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/
Thursday, March 8, 12
![Page 27: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/27.jpg)
Code Hosting Services
Thursday, March 8, 12
![Page 28: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/28.jpg)
sourceforge.net
✉
Thursday, March 8, 12
![Page 29: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/29.jpg)
Lessons LearnedAutomatable release supportFeedback barrierSi può sempre cambiare
sf.netbitbucket
google code GitHub ?
Thursday, March 8, 12
![Page 30: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/30.jpg)
Internals: TrashDir
Thursday, March 8, 12
![Page 31: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/31.jpg)
KDE Gnome
cli XFCE
TrashDir
Thursday, March 8, 12
![Page 32: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/32.jpg)
How it works
~/.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
$ trash-‐put pippo.txt
Thursday, March 8, 12
![Page 33: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/33.jpg)
How it works
~/.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
$ touch pippo.txt; trash-‐put pippo.txt # again$ touch pippo.txt; trash-‐put pippo.txt # again$ touch pippo.txt; trash-‐put pippo.txt # again
Thursday, March 8, 12
![Page 34: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/34.jpg)
KDE Gnome
cliXFCE
TrashDir
Thursday, March 8, 12
![Page 35: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/35.jpg)
Thursday, March 8, 12
![Page 36: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/36.jpg)
pippo.txtpippo.txt
Thursday, March 8, 12
![Page 37: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/37.jpg)
open(3)#include <sys/stat.h> #include <fcntl.h> int open(const char *path, int oflag, ... ); ^ O_EXCL | O_CREAT -‐’
Thursday, March 8, 12
![Page 38: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/38.jpg)
os.openimport 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)
Thursday, March 8, 12
![Page 39: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/39.jpg)
Conclusioni
Thursday, March 8, 12
![Page 40: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/40.jpg)
Lezioni miste (1)
Utenti: va bene ascoltarli ma la vision la devi avere tu (WONTFIX, parallelo)Promozione per distro: Non vale la pena se poi non lo aggiornano
Thursday, March 8, 12
![Page 41: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/41.jpg)
Lezioni miste (2)
Code Review? Utilissime, basta chiedere in lista.Occhio alle librerie e ai framework (OptionParser, Unipath)
Thursday, March 8, 12
![Page 42: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/42.jpg)
Lezioni miste (3)
Tempo a disposizione? Peggio che al lavoro!
Alta coesione e basso accoppiamento e test veloci sono indispensabili
Thursday, March 8, 12
![Page 43: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/43.jpg)
Lezioni miste (4)È vero che Git sembra più complicato di Subversion?Però
è più facile integrare le patch degli altri meno conflitti inesistenticommit localinon si incasina se sposti una directorycapisce da solo se hai rinominato un file
Thursday, March 8, 12
![Page 44: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/44.jpg)
Lezioni miste (5)
Collaboration tools (wiki, blog , mailing-list)➡Cominciano ad essere usati solo dopo
quando c’e’ veramente tanto interesse➡Si può aspettare a farli.
Thursday, March 8, 12
![Page 45: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/45.jpg)
Branches
Thursday, March 8, 12
![Page 46: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/46.jpg)
Lezione più grande
Thursday, March 8, 12
![Page 47: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/47.jpg)
Come lo farei ora?Beer/Pizza LicenseGitGitHubOutside In TDDNo Wiki, solo .txt tra i sorgentiNessun push promozionale
Thursday, March 8, 12
![Page 49: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/49.jpg)
Altre cose
Thursday, March 8, 12
![Page 50: Tutti i miei sbagli, versione 7 Marzo 2012 al XPUG mi](https://reader034.vdocuments.mx/reader034/viewer/2022051616/553b7c7f550346a43f8b471f/html5/thumbnails/50.jpg)
Altro
Singleton LoggerTroppa docs sulla wiki
Thursday, March 8, 12