-
Notifications
You must be signed in to change notification settings - Fork 2
/
Notes.txt
524 lines (431 loc) · 23.6 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<!--@+leo-ver=5-thin-->
<!--@+node:maphew.20121011215813.1567: * @file Notes.txt-->
<!--@@language md-->
On deck: Get ready for release.
- Make sure every advertised function either works or exits gracefully.
- As each function is touched, update the docstring.
<!--@+others-->
<!--@+node:maphew.20141123173815.3: ** Maintaining Compatibility-->
**Basic process for checking that apt is working properly with Setup.exe**
Install a minimal osgeo4w using each of Osgeo4w-setup-x86.exe and apt.exe,
then compare resultant folders with Winmerge (or whatever).
<!--@+node:maphew.20141123173815.4: *3* 2014-Nov-23 discrepancies-->
<!--@+node:maphew.20141123173815.5: *4* ./bin-->
./bin/
setup.bat
setup-test.bat
Inconsequential: Paths are different, but that's 'cause they're in diffent folders.
Long term: suggest to upstream to use %~dp0 so the batch files are portable.
<!--@+node:maphew.20141123173815.6: *4* ./etc/setup/installed.db-->
./etc/setup/installed.db
Inconsequential: line order different, reflecting install order.
<!--@+node:maphew.20141123173815.7: *4* ./etc/setup/setup.rc-->
APT
./etc/setup/
last-cache
last-mirror
setup.ini
reboot
SETUP
./etc/setup/
setup.rc
timestamp
This one is significant. Setup has moved multiple settings into a single .rc file. Also uses a timestamp of last mirror setup.ini check.
https://github.com/maphew/apt/issues/18
<!--@+node:maphew.20141128231605.3: *5* setup.rc-->
mirrors-lst
http://download.osgeo.org/osgeo4w/;OSGeo;USA;California
window-placement
44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,151,1,0,0,185,0,0,0,175,4,0,0,118,2,0,0
last-mode
Advanced
last-mirror
http://download.osgeo.org/osgeo4w/
net-method
Direct
last-cache
C:\Users\Matt\Downloads
last-menu-name
OSGeo4W_default
<!--@+node:maphew.20141123173815.8: *4* Downloads cache-->
APT
./var/cache/setup/http%3...
SETUP
%USERPROFILE%/Downloads/http%3...
Not as important as setup.rc, but still a good idea to change the apt default to same standard download location.
SETUP-CACHE
D:\osgeo\setup-cache\
.\http%3a%2f%2fdownload.osgeo.org%2fosgeo4w%2f\x86
setup.ini
APT-CACHE
D:\osgeo\Osgeo4w-apt\var\cache\setup\
http%3a%2f%2fdownload.osgeo.org%2fosgeo4w%2fsetup.ini.bz2
Setup is storing the .ini uncompressed, in the downloads folder, and not in ./etc/setup/.
This difference could be a problem. Apt depends on .ini always being present, and uses it on every invocation in order to build the dictionary of packages and their associated metdata. We could just repoint the default location to Downloads, and thereby use the Setup copy but I'm not comfortable with that idea. The Downloads folders could be altered at any time, by any number of other programs or user intervention. To which apt could just always download a new version if .ini doesn't exist; just doesn't smell right though.
For the time being I'm keeping apt as is, with perhaps a time-stamp check to see if Downloads .ini is newer.
<!--@+node:maphew.20141123173815.9: *4* ./var/log-->
SETUP
./var/log
setup.log
setup.full
Apt doesn't log anything. I haven't added anything for this, as whenever I want to log something I just use console pipe redirect (`apt install ... > apt-install.log`). I think it would be good to log operations by default, but am not going to work on it for awhile. There's a good chance Click or whatever will give us this kind of feature for free or close to it.
<!--@+node:maphew.20141123173815.10: *4* ./-->
OSGeo4W.ico
Binary files are different
This one is weird. They should be diffrent identical.
...unless there are different .ico files in different packages and last installed wins?
<!--@+node:maphew.20140905201312.1893: ** Research-->
new magic bullet discovered: click
@url http://click.pocoo.org/3/quickstart
Just discovered a 2nd copy of original cyg-apt:
http://lilypond.org/cygwin/cyg-apt-gub
investigate what if any diff from one I started with.
<!--@+node:maphew.20121113004545.1578: *3* a2-->
2013-Jan-21
Next thing I'd like to do is make it easier to test install of packages, either by passing a particular tarball on the command line or by pointing to an alternate local cache directory. I think the tarball route might be easier.
--------------
I've done pretty good so far, using the a2 wrapper to slowly go over apt and piece by piece move procedural code into functions, and still keep both programs working. I'm nearing the end of the easy stuff though, and now the mass of globals in a2 are starting to get in the way.
The problem of the moment is that check for the O4W root takes place before plac, so all that nice help formatting goes right out the window, yet *not* doing the check means we get a key error when processing the globals:
B:\code\maphew\apt>a2
Traceback (most recent call last):
File "a2.py", line 11, in <module>
apt.OSGEO4W_ROOT = os.environ['OSGEO4W_ROOT']
File "B:\o4w\\apps\Python27\lib\os.py", line 423, in __getitem__
return self.data[key.upper()]
KeyError: 'OSGEO4W_ROOT'
sigh.
This may mean the end of moving apt furniture about. We've tidied things up, there's some organization, but to go any further means ripping some walls out and moving structural elements. It could all come crashing down next, but hey! that's why we're using version control with smart and easy merging and branching, right?
(now if only I knew how to use it! :)
<!--@+node:maphew.20141005121657.7064: ** Todo-->
<!--@+node:maphew.20141010024515.2076: *3* Setup.ini has new fields-->
New fields in setup.ini which we aren't capturing or doing anything with yet:
arch: x86
setup-timestamp: 1412665633
(There are also [prev] and "source:", for wich there is some legacy code. I'm doubtful that it does anything useful though.)
<!--@+node:maphew.20130122175214.1530: ** bugs-->
<!--@+node:maphew.20141002090256.2028: *3* Access denied to .pyd-->
We should exit with a graceful error in the case where Apt is trying to upgrade
the python in active use.
preparing to replace python-core 2.7.4-2
Traceback (most recent call last):
File "b:\code\maphew\apt\apt.py", line 1203, in <module>
__main__.__dict__[command] (packages)
File "b:\code\maphew\apt\apt.py", line 407, in upgrade
install (packages)
File "b:\code\maphew\apt\apt.py", line 202, in install
install_next(missing.keys (), set([]), set([]))
File "b:\code\maphew\apt\apt.py", line 227, in install_next
do_uninstall (packagename)
File "b:\code\maphew\apt\apt.py", line 551, in do_uninstall
os.remove (file)
WindowsError: [Error 5] Access is denied: 'B:\\o4w\\apps\\Python27\\DLLs\\bz2.pyd'
<!--@+node:maphew.20141006093411.2071: *3* ...\Scripts\apt.exe broken-->
After installing apt to python Scripts folder using `pip install --editable .` apt errors out. And then after changing setup.py as per thread[0] it breaks differently, because it's absolutely right, there is no main(). So I think this means in order to work completely we have to create a main wrapper around (at least) `< <run the commands>>`.
This might mean waiting until after I can figure out the argparse etc. conundrum. Or, maybe solving this will make the conundrum easier to solve(?)
[0] https://mail.python.org/pipermail/distutils-sig/2007-July/007809.html
b:\>apt
Traceback (most recent call last):
File "B:\o4w\apps\Python27\Scripts\apt-script.py", line 9, in <module>
load_entry_point('AptInstaller==0.3', 'console_scripts', 'apt')()
TypeError: 'module' object is not callable
b:\>apt
Traceback (most recent call last):
File "B:\o4w\apps\Python27\Scripts\apt-script.py", line 9, in <module>
load_entry_point('AptInstaller==0.3', 'console_scripts', 'apt')()
File "build\bdist.win32\egg\pkg_resources.py", line 357, in load_entry_point
"""Does the package's distribution contain the named metadata?"""
File "build\bdist.win32\egg\pkg_resources.py", line 2394, in load_entry_point
File "build\bdist.win32\egg\pkg_resources.py", line 2113, in load
return location
ImportError: <module 'apt' from 'b:\code\maphew\apt\apt.py'> has no 'main' attribute
<!--@+node:maphew.20130122175214.1532: *3* fixed-->
<!--@+node:maphew.20141028132242.2: *4* Parent SHA-1 not present in Gitrepo-->
"Parent SHA-1 not present in Gitrepo"
got this error when I tried to push today's changes from TortoiseHg Workbench to Github. Finally resolved by cloning new repo with Hg from Github and then merging into that from local messed up copy. I think SourceTree may have messed up the repo because it doesn't know which to use, git or hg. Going to stay from SourceTree as much as possible.
hg clone --verbose git+ssh://[email protected]:maphew/apt.git B:\code\apt-clone
pushd b:\code\apt-clone
hg pull b:\code\apt
hg merge
Command line examples given, but I did most from Workbench.
Also see
https://bitbucket.org/durin42/hg-git/issue/75/parent-sha-1-not-present-in-gitrepo
<!--@+node:maphew.20141002090256.2026: *4* IOError: invalid data stream-->
B:\o4w>python b:\code\maphew\apt\apt.py update
...100% Traceback (most recent call last):
File "b:\code\maphew\apt\apt.py", line 1190, in <module>
update ()
File "b:\code\maphew\apt\apt.py", line 396, in update
uncompressedData = bz2.BZ2File(archive).read()
IOError: invalid data stream
After which etc\setup\setup.ini no longer exists.
Fix with
copy etc\setup\setup.bak etc\setup\setup.ini
hunch: has something to with mirror settings, .../x86/...
<!--@+node:maphew.20130122175214.1531: *4* a2 install bad-pkg-name-->
todo: Have apt report nicely when the packagename is not recognized
B:\code\maphew\apt>a2 install iconvcurl
---------- running apt install iconvcurl
Traceback (most recent call last):
File "a2.py", line 84, in <module>
for out in plac.call(main): print(out)
File "b:\o4w\apps\Python27\lib\site-packages\plac_core.py", line 309, in call
cmd, result = parser_from(obj).consume(arglist)
File "b:\o4w\apps\Python27\lib\site-packages\plac_core.py", line 195, in consu
me
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "a2.py", line 47, in install
apt.install(packages)
File "B:\code\maphew\apt\apt.py", line 190, in install
missing.update (dict (map (lambda x: (x, 0), get_missing (packagename))))
File "B:\code\maphew\apt\apt.py", line 652, in get_missing
reqs = get_requires (packagename)
File "B:\code\maphew\apt\apt.py", line 738, in get_requires
no_package ('warning')
File "B:\code\maphew\apt\apt.py", line 913, in no_package
sys.stderr.write ("%s: %s not in [%s]\n" % (s, packagename, distname))
NameError: global name 'packagename' is not defined
<!--@+node:maphew.20141002090256.2027: *4* TypeError: exceptions must be...-->
B:\o4w>apt-dev install python-shapely
...
b282b1a891031cb7d2f4da52ce9f7607 python-shapely-1.2.18-1.tar.bz2 - remote
9f6e3f15254db968fa3014bb62e7d0a3 python-shapely-1.2.18-1.tar.bz2 - local
Traceback (most recent call last):
File "B:\o4w\bin\apt-dev.py", line 1150, in <module>
__main__.__dict__[command] ()
File "B:\o4w\bin\apt-dev.py", line 160, in install
download ()
File "B:\o4w\bin\apt-dev.py", line 119, in download
md5 ()
File "B:\o4w\bin\apt-dev.py", line 238, in md5
raise 'file md5 does not match for ' + ball
TypeError: exceptions must be old-style classes or derived from BaseException, not str
<!--@+node:maphew.20140905022205.1895: *4* Too many apts-->
B:\code\apt\r183\gis\o4w_extras\bin\apt.py
B:\code\apt\r262\apt\apt.py
B:\code\apt\r262\gis\o4w_extras\bin\apt.py
B:\code\apt-hg\apt.py
B:\code\maphew\apt\apt.py
B:\code\maphew\gis\o4w_extras\bin\apt.py
B:\code\o4w\apt\apt.py
B:\Projects\o4w\matt_release\apt\bin\apt.py
This, is ridiculous. I don't know where to begin looking to catch up to myself, what to keep, what to throw away. It is the perfect exemplar for source code version control (management), yet I *am* using SCM in all 8 these -- just not the _same_ one for each...
Gak. what a mess.
By date of commit messages, `maphew-apt` is most current (Spring 2013).
apt-r### are largely experimental and near duplicates. I seem to recall something about them being an attempt to sort out and fix a broken branching operation. (Fall 2012) DELETED
apt-hg is Osgeo4w, using hg-subversion plugin. So most out of date (but matching current .exe release). RENAMED to `o4w-apt-hg`.
<!--@+node:maphew.20141005121657.7065: *4* Restore docstrings-->
Currently the docstrings of all functions which are not Commands are hidden behind remarks (#).
This is because currently docstrings are used to drive the console help screen. It's too much to have _all_ functions listed there.
Ultimately we want to have all functions properly documented, using docstrings, and print only commands to the help screen.
Writing this, I remember now that this was one of the original drivers for attempting to learn argparse, clint, plac, docopt... in the first place!
----
2014-Oct-05
For now usage message is hard coded. This is to allow full fledged docstrings in all functions, which in turn will help with refactoring.
Many times I'm stymied in my short bursts of reworking Apt because I don't remember or understand what a given function is supposed to do or how it operates. Better docstrings as I go will help with this.
Next step is rewrite usage() so that it:
a) has shortlist of Commands (instead of all functions)
b) only shows first x characters of docstring (and then help() is used for the whole docstring).
<!--@+node:maphew.20141005143559.6904: *5* print docstrings for all-->
<!--@@language python-->
'''Print the docstrings for all functions with defined docstrings'''
<!--@+at-->
<!--
This was the original method in cyg-apt for
displaying usage help. Clever, but not flexible enough for us here.
https://code.google.com/p/maphew/source/browse/other/cyg-apt.py#78
-->
<!--@@c-->
d = __main__.__dict__
commands = filter (lambda x:
type (d[x]) == type (usage) and d[x].__doc__, d)
sys.stdout.writelines (map (lambda x:
" %s - %s\n" % (x, d[x].__doc__), sorted (commands)))
<!--@+node:maphew.20121011215813.1569: ** Expected test results-->
<!--@+node:maphew.20141031121809.3: *3* apt requires-->
B:\code\apt>apt requires python
----- "python" requires the following to work -----
msvcrt
python-core
python-help
python-tcltk
python-testsuite
python-tools
setup
shell
sqlite3
<!--@+node:maphew.20141029173246.5: *3* apt remove-->
B:\code\apt>apt remove szip six
szip
removing szip 2.1-1
removed: B:\o4w\include\ricehdf.h
removed: B:\o4w\include\SZconfig.h
removed: B:\o4w\include\szip_adpt.h
removed: B:\o4w\include\szlib.h
removed: B:\o4w\share\cmake\SZIP\SZIP-config-version.cmake
removed: B:\o4w\share\cmake\SZIP\SZIP-config.cmake
removed: B:\o4w\share\cmake\SZIP\SZIP-targets-release.cmake
removed: B:\o4w\share\cmake\SZIP\SZIP-targets.cmake
removed: B:\o4w\share\COPYING
removed: B:\o4w\share\HISTORY.txt
removed: B:\o4w\share\INSTALL
removed: B:\o4w\share\README
removed: B:\o4w\share\RELEASE.txt
removed: B:\o4w\lib\szip.lib
removed: B:\o4w\bin\szip.dll
six
removing six 1.6.1-1
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\EGG-INFO\dep
endency_links.txt
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\EGG-INFO\not
-zip-safe
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\EGG-INFO\PKG
-INFO
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\EGG-INFO\SOU
RCES.txt
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\EGG-INFO\top
_level.txt
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\six.py
removed: B:\o4w\apps\python27\lib\site-packages\six-1.6.1-py2.7.egg\six.pyc
removed: B:\o4w\apps\python27\lib\site-packages\six.pth
<!--@+node:maphew.20141029173246.4: *3* apt missing-->
B:\code\apt>apt missing libtiff-devel
libtiff-devel
<!--@+node:maphew.20141029173246.3: *3* apt md5-->
B:\code\apt>apt md5 shell iconv gdal
remote: c38f03d2b7160f891fc36ec776ca4685 shell-1.0.0-13.tar.bz2
local: c38f03d2b7160f891fc36ec776ca4685 shell-1.0.0-13.tar.bz2
remote: b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2
local: b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2
remote: 2fa14222f8d67dd9b670412fe2f600f5 gdal-1.11.1-1.tar.bz2
local: *** gdal's .bz2 not found ***
<!--@+node:maphew.20121113004545.1562: *3* apt setup-->
B:\code\maphew\apt>apt setup
Root dir not found, creating d:/temp/o4w_2012-nov-11
creating d:/temp/o4w_2012-nov-11/etc/setup/
creating d:/temp/o4w_2012-nov-11/etc/setup//installed.db
getting d:/temp/o4w_2012-nov-11/etc/setup//setup.ini
...100%
<!--@+node:maphew.20121113004545.1561: *3* a2 setup-->
B:\code\maphew\apt>a2 setup path\as\param\not\yet\working
Error retreiving installed package info. Has "apt setup" been run yet?
---------- running apt setup
Root dir not found, creating d:\temp\o4w_2012-nov-11
creating d:\temp\o4w_2012-nov-11/etc/setup/
creating d:\temp\o4w_2012-nov-11/etc/setup//installed.db
getting d:\temp\o4w_2012-nov-11/etc/setup//setup.ini
...100% ----------setup
<!--@+node:maphew.20121011215813.1573: *3* apt update-->
B:\code\maphew\apt>apt update
...100%
<!--@+node:maphew.20121011215813.1574: *3* a2 update-->
B:\code\maphew\apt>a2 update
---------- running apt update None
...100% ----------Update finished
<!--@+node:maphew.20121011215813.1568: *3* apt install iconv curl-->
B:\code\maphew\apt>apt install iconv curl
to install:
iconv curl
iconv = d:/temp/o4w-cache/setup/http%3a%2f%2fdownload.osgeo.org%2fosgeo4w/./rele
ase/iconv/iconv-1.9.1-1.tar.bz2
b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2 - remote
b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2 - local
curl = d:/temp/o4w-cache/setup/http%3a%2f%2fdownload.osgeo.org%2fosgeo4w/./relea
se/curl/curl-7.15.1-2.tar.bz2
97327843d4f00ec70bd08739336083c9 curl-7.15.1-2.tar.bz2 - remote
97327843d4f00ec70bd08739336083c9 curl-7.15.1-2.tar.bz2 - local
installing iconv 1.9.1-1
installing curl 7.15.1-2
<!--@+node:maphew.20121011215813.1571: *3* a2 install iconv curl-->
B:\code\maphew\apt>a2 install iconv curl
---------- running apt install iconv curl
to install:
iconv curl
iconv = d:/temp/o4w-cache/setup/http%3a%2f%2fdownload.osgeo.org%2fosgeo4w/./rele
ase/iconv/iconv-1.9.1-1.tar.bz2
b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2 - remote
b9f7db00b8fd33a5fe821788b1029791 iconv-1.9.1-1.tar.bz2 - local
curl = d:/temp/o4w-cache/setup/http%3a%2f%2fdownload.osgeo.org%2fosgeo4w/./relea
se/curl/curl-7.15.1-2.tar.bz2
97327843d4f00ec70bd08739336083c9 curl-7.15.1-2.tar.bz2 - remote
97327843d4f00ec70bd08739336083c9 curl-7.15.1-2.tar.bz2 - local
installing iconv 1.9.1-1
installing curl 7.15.1-2
---------- Install complete
<!--@+node:maphew.20121011215813.1570: *3* apt remove iconv curl-->
B:\code\maphew\apt>apt remove iconv curl
iconv
removing iconv 1.9.1-1
removed: O:\bin\iconv.dll
removed: O:\include\iconv.h
removed: O:\lib\iconv.lib
curl
removing curl 7.15.1-2
removed: O:\bin\curl.exe
removed: O:\bin\libcurl.dll
removed: O:\bin\zlib1.dll
removed: O:\include\curl\curl.h
removed: O:\include\curl\curlver.h
removed: O:\include\curl\easy.h
removed: O:\include\curl\mprintf.h
removed: O:\include\curl\multi.h
removed: O:\include\curl\stdcheaders.h
removed: O:\include\curl\types.h
removed: O:\lib\libcurl_imp.lib
<!--@+node:maphew.20121011215813.1572: *3* a2 remove iconv curl-->
B:\code\maphew\apt>a2 remove iconv curl
---------- running apt remove iconv curl
iconv
removing iconv 1.9.1-1
removed: O:\bin\iconv.dll
removed: O:\include\iconv.h
removed: O:\lib\iconv.lib
curl
removing curl 7.15.1-2
removed: O:\bin\curl.exe
removed: O:\bin\libcurl.dll
removed: O:\bin\zlib1.dll
removed: O:\include\curl\curl.h
removed: O:\include\curl\curlver.h
removed: O:\include\curl\easy.h
removed: O:\include\curl\mprintf.h
removed: O:\include\curl\multi.h
removed: O:\include\curl\stdcheaders.h
removed: O:\include\curl\types.h
removed: O:\lib\libcurl_imp.lib
---------- Remove complete
<!--@+node:maphew.20141030225015.5: ** Snippets-->
<!--@@language python-->
# convert a bare string to single item list
if type(pkg) is str:
pkg = [pkg]
<!--@+at `isinstance(pkg, basestring)` seems to be the official way, but it's very noisy compared to above. However above will not do anything if `pkg` is any other kind of object. That should be okay with apt (famous last words?)-->
<!--
We got in this circumsance by allowing all functions to take multiple inputs. Perhaps it cleaner in long run to enforce all functions to assume single input. Or enforce always passing as a list.
Needs more thinking.
http://stackoverflow.com/questions/922774/check-if-input-is-a-list-tuple-of-strings-or-a-single-string
http://stackoverflow.com/questions/6710834/iterating-over-list-or-single-element-in-python
http://stackoverflow.com/questions/836387/how-can-i-tell-if-a-python-variable-is-a-string-or-a-list
-->
<!--@@c-->
<!--@+node:maphew.20141105221003.3: ** 2014-->
<!--@+node:maphew.20141102234146.3: *3* Nov-02-->
Oh. I've just spent many hours over the last few days recreating something that already exists: a dict of setup.ini. I am disappointed at the wasted effort, but at the same time glad. You see I learned things by recreating that I wouldn't have understood by just blindly using the existing code.
It also points to a problem with the presentation or structure of what's there now: I didn't see it -- even though my very own comment from many moons ago says "a dict of setup.ini". There is a bug here, not in the code, but in it's accessibility, in it's (re)discoverability.
So, what do I need to do to ensure I don't do this again? How can I help my memory and understanding of what all these little bits and pieces do, without have to step through and reparse the code line by line in each new round?
<!--@+node:maphew.20141105221003.4: *3* Nov-05-->
I realised something in the midst of insomnia this morning: 90% of apt is just "get info". There are a few primary functions -- setup, update, install, remove, update -- **everything** else is "show me info about ____.
Would it be nicer and easier to just run `apt info gdal` and see the whole kit and kaboodle at once? We could, I think, tweak that so `apt info.version gdal` reported just version in those instances we don't want to parse through all the noise.
Though I suppose it should be `apt info --version gdal` to be more in line with other command line tools. 'twould also allow chaining, `apt info --version --url gdal`.
<!--@+node:maphew.20141122223321.3: *3* Nov-22-->
A stand alone apt.exe
---------------------
Seem to have lost all my notes on creating apt.exe, so here goes again.
Oh. that's why no notes, it's just `pyinstaller --onefile apt.py`
<!--@-others-->
The biggest thing learned from the "a2" experiment is that we can import apt as
a module and then experiment in the wrapper. Leaving the original pretty much as
is and still functional.
Plac was very useful in coming to this understanding but I think it's too niche
to base my efforts on going forward. Click may well end up in the discard heap
in the same way, but what other useful things will I learn in the attempt?
<!--@-leo-->