É 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
25. Debian
25 @andreafrancia #trash-cli
Saturday, March 24, 12 25
26. 26 @andreafrancia #trash-cli
Saturday, March 24, 12 26
27. 27 @andreafrancia #trash-cli
Saturday, March 24, 12 27
28. 28 @andreafrancia #trash-cli
Saturday, March 24, 12 28
29. Fedora
29 @andreafrancia #trash-cli
Saturday, March 24, 12 29
30. Fedora
30 @andreafrancia #trash-cli
Saturday, March 24, 12 30
31. Nota
A quei tempi il progetto si chiamava solo
“trash” (come il comando)
31 @andreafrancia #trash-cli
Saturday, March 24, 12 31
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. 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. Developer
“ Ok I’ll change to trash-cli.
Saturday, March 24, 12
34 @andreafrancia
”
#trash-cli
34
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. Developer
“ The name of the main command is
'trash' without "-cli".
Saturday, March 24, 12
36 @andreafrancia
”
#trash-cli
36
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. Developer
“ You are already using the
Command Line Interface.
Saturday, March 24, 12
38 @andreafrancia
”
#trash-cli
38
39. Developer
“ In my opinion each command name
should reflect what the command
does.
Saturday, March 24, 12
39 @andreafrancia
”
#trash-cli
39
40. Reviewer
“ As far as possible.
Saturday, March 24, 12
40 @andreafrancia
”
#trash-cli
40
41. Developer (and others)
“ There are other programs with
generic names already
included!!
Saturday, March 24, 12
41 @andreafrancia
”
#trash-cli
41
42. samba-common
net
profiles
rpcclient
testparm
42 @andreafrancia #trash-cli
Saturday, March 24, 12 42
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-cli
Saturday, March 24, 12 44
45. Reviewer & others
“ Precedent mistakes are not a
good reason to let other
generic names enter the
distro.
https:/
http:/
October/msg00223.html
Saturday, 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. ... after some months
and discussions ...
46 @andreafrancia #trash-cli
Saturday, March 24, 12 46
47. Developer
“ .... OK
Saturday, March 24, 12
47 @andreafrancia
”
#trash-cli
47
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-cli
Saturday, March 24, 12 61
63. Acceptance Test
È un test che verifica
una feature.
63 @andreafrancia #trash-cli
Saturday, March 24, 12 63
64. Developer Test
È un test che serve allo
sviluppatore.
64 @andreafrancia #trash-cli
Saturday, March 24, 12 64
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-cli
Saturday, March 24, 12 65
66. Developer Tests
A volte sono chiamati: Unit Tests
66 @andreafrancia #trash-cli
Saturday, March 24, 12 66
67. 67 @andreafrancia #trash-cli
Saturday, March 24, 12 67
68. Come ho affrontato
il problema
68 @andreafrancia #trash-cli
Saturday, March 24, 12 68
69. “ Avere i test é bello...
”
69 @andreafrancia #trash-cli
Saturday, March 24, 12 69
70. “ Come li scrivo?
”
70 @andreafrancia #trash-cli
Saturday, March 24, 12 70
71. “ Developer Test --> in python
”
71 @andreafrancia #trash-cli
Saturday, March 24, 12 71
72. “ Acceptance Test --> ?????
”
72 @andreafrancia #trash-cli
Saturday, March 24, 12 72
73. “ devo testare a livello utente
”
73 @andreafrancia #trash-cli
Saturday, March 24, 12 73
74. “ l’utente usa la Bash
”
74 @andreafrancia #trash-cli
Saturday, March 24, 12 74
75. “ gli script in Bash sono facili
”
75 @andreafrancia #trash-cli
Saturday, March 24, 12 75
76. “ esiste già un framework di
test per Bash
”
76 @andreafrancia #trash-cli
Saturday, March 24, 12 76
77. shunit
77 @andreafrancia #trash-cli
Saturday, March 24, 12 77
78. “ IDEA:
li scrivo in Bash!
”
78 @andreafrancia #trash-cli
Saturday, March 24, 12 78
79. Era un buona idea?
79 @andreafrancia #trash-cli
Saturday, March 24, 12 79
80. 80 @andreafrancia #trash-cli
Saturday, March 24, 12 80
81. Risultati
81 @andreafrancia #trash-cli
Saturday, March 24, 12 81
82. Bash Tests are
slooow!
82 @andreafrancia #trash-cli
Saturday, March 24, 12 82
83. Little information in
failure messages
83 @andreafrancia #trash-cli
Saturday, March 24, 12 83
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-cli
Saturday, March 24, 12 103
104. or (at your option) any later
version.
104 @andreafrancia #trash-cli
Saturday, March 24, 12 104
106. Licenze già fatte?
Comode ma vanno capite.
106 @andreafrancia #trash-cli
Saturday, March 24, 12 106
107. Il papiro all’inizio del file é
una rottura
107 @andreafrancia #trash-cli
Saturday, March 24, 12 107
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-cli
Saturday, March 24, 12 108
109. Esistono licenze più semplici!
109 @andreafrancia #trash-cli
Saturday, March 24, 12 109
114. Lessons Learned
Il ser vizo di release é importante
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
115. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
116. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
117. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
sf.net
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
118. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
sf.net google
code
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
119. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
bitbucket
sf.net google
code
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
120. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
bitbucket
sf.net google
code
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
121. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
bitbucket
sf.net google
code GitHub
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
122. Lessons Learned
Il ser vizo di release é importante
Feedback barrier
Si può sempre cambiare
bitbucket
sf.net google
code ?
GitHub
113 @andreafrancia #trash-cli
Saturday, March 24, 12 113
123. Una scelta
azzeccata: Python
114 @andreafrancia #trash-cli
Saturday, March 24, 12 114
125. TrashDir: dove sono
nascosti i file cestinati
116 @andreafrancia #trash-cli
Saturday, March 24, 12 116
126. How it works
117 @andreafrancia #trash-cli
Saturday, March 24, 12 117
127. Gnome
KDE
TrashDir
trash-cli
XFCE
118 @andreafrancia #trash-cli
Saturday, March 24, 12 118
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-cli
Saturday, March 24, 12 119
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-cli
Saturday, March 24, 12 120
130. Gnome
KDE
TrashDir
cli
XFCE
121 @andreafrancia #trash-cli
Saturday, March 24, 12 121
131. 122 @andreafrancia #trash-cli
Saturday, March 24, 12 122
138. Git
129 @andreafrancia #trash-cli
Saturday, March 24, 12 129
139. GitHub
130 @andreafrancia #trash-cli
Saturday, March 24, 12 130
140. No Wiki, solo .txt nei i
sorgenti
131 @andreafrancia #trash-cli
Saturday, March 24, 12 131
141. No mailing list.
132 @andreafrancia #trash-cli
Saturday, March 24, 12 132
142. Nessuno sforzo per
l’inclusione in distribuzioni
133 @andreafrancia #trash-cli
Saturday, March 24, 12 133
143. Ma qualcuno lo usa?
134 @andreafrancia #trash-cli
Saturday, March 24, 12 134
144. Distribuzioni
Debian (e Ubuntu)
Fedora
Arch Linux
Foresight Linux
OpenSuse
... forse altri
135 @andreafrancia #trash-cli
Saturday, March 24, 12 135
145. Altri progetti
LXDE usa trash-cli come libreria
(*) LXDE: Light weight X11 Desktop Environment
136 @andreafrancia #trash-cli
Saturday, March 24, 12 136
147. Grazie
Andrea Francia
http://andreafrancia.it
andrea@andreafrancia.it
139
138 @andreafrancia #trash-cli
Saturday, March 24, 12 138
148. Grazie
Andrea Francia
http://andreafrancia.it
andrea@andreafrancia.it
Libero da settembre 2012
139 @andreafrancia #trash-cli
Saturday, March 24, 12 139