-
Notifications
You must be signed in to change notification settings - Fork 4
/
ChangeLog
860 lines (523 loc) · 48.6 KB
/
ChangeLog
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
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
Changelog
--------------------------------------------------------------------------------
Changes apply to trailing revision version: FooVersion has Foo change:
Foo change
FooVersion
--------------------------------------------------------------------------------
Changes for cyg-apt script
Incorrect file
Revision 1
----------
Revision 2
----------
* Added original 2006 version cyg-apt by Jan Nieuwenhuizen from http://lilypond.org/~janneke/software/cyg-apt
Revision 3
* Changed tabs to spaces: tabs were confusing Python and causing spurious indentation complains.
* Import pdb for debugging
* Change the hardcoded mirror and cache locations
official_mirror = 'http://gnu.kookel.org/ftp/cygwin'
cache = ROOT + '/var/cache/setup'
becomes
official_mirror = 'http://mirror.internode.on.net/pub/cygwin/'
cache = ROOT + '/e/home/application_data/cygwin'
* Fix indentation of a line in options parsing in the script lines outside any function at the top.
cache = a
* in get_requires(): only look for dependencies in [curr], not in distname which is the selected version of the selected package. My thinking is that those wanting the previous or testing versions of a package probably don't want previous or testing versions of the projects it depends on: there's no gurantee that there is any synchronisation of current-previous-test between packages, or that a previous version or a testing version of dependency exists.
* in get_filelist (): split the decompression of the filelist file into two lines for easier debugging.
* in find () : removed prepending ROOT to the file to search for. ROOT doesn't seem to be a general cygwin concept and I would like to remove it.
* Changed find () to silently ignore /setup/foo.lst files (containsing installed files for package 'foo') that we would expect to exist from installled.db but aren't actually there. At least with my install some packages were not correctly installed and this file doesn't exist. We should probably warn about these files rather than silently ignore.
Revision 4
----------
Hack in hardcoded Cygwin 1.7 compatibility to cyg-apt. Add temporary fix to package searches: crudely disable regex searches to avoid failing on
packgenames containing control characters.
Added uninstall tests to test-cyg-apt.py and aimed both install and uninstall tests at the product of the newly added mini_mirror : the testpkg packge. Also added tests for postinstall, preremove and postremove scripts.
Added mini_mirror:
Mini mirror builds a Cywin package from scratch and installs it to a remote server. See mini_mirror/README
Revision 10
-----------
cyg-apt: Fixed bogus warnings about missing postinstall and pre
remove scripts during do_install.
Fixed mini_mirror using .bz extension not .bz2, added exclusion of .svn directories when taring up the mini_mirror package build, fix test-cyg-apt.py to match correct built package.
Revision 14
-----------
Move test-cyg-apt.py and mini_mirror to use utilpack for path handling, and added /setup/utilpack: the installer for said utilpack.
mini_mirror now ignores any file with substring "svn" in the path/name when "building" the build clean target.
Added "purge" command as per apt-get to cyg-apt.
Added test for purge and download commands to test-cyg-apt.
Revision 31
-----------
Added testpkg-lib to mini-mirror: an empty package. Set testpkg to be dependant on it, and add tests for commands requires and missing: testpkg-lib must turn up as one of testpkg's requires and cyg-apt must be able to detect if testpkg-lib has been removed.
To better handle multiple packags in mini_mirror setup-2.ini moved to mini_mirror root: all package build reference it. Similarly the build tools were moved off testpkg's src directory to a common directory at the cyg-apt project root: /tools.
cyg-apt:
Added a better error message for md5 command when target package is missing.
test-cyg-apt:
Add tests for md5, requires and missing commands.
Revision 38
------------
Added a new tool setup_ini_diff_make.py to patch setup.ini. Doubt this will be
the final version: keep generalising the tool. Change mini_mirror to use the
new tool. Also use the new patch tool in test-cyg-apt to test
the "cyg-apt new" command: temporarily patch .ini to report availability of
a new (spurious) version of testpkg: 0.0.2-0. Check cyg-apt new reports the
new version and revert the .ini
Change the standard .cyg-apt to point to a local setup-2.ini
Revsion 39
----------
Removed build command: new cyg-apt regards building as out of scope.
Slightly simplified cyg-apt source command: downloads and unpacks a source tarball into the current working directory. Unlike apt-get we don't automatically apply the cygwin patches: the whole business of building cygwin source packages is non-trivial and cyg-apt is making no attempt to deal with them at this point. Potentially the standard application of cygwin-specific diffs could be included.
This pretty much what it did before, but the build step was removed becasue it looked lillypond specific. Also effectively ignore "SRC" variable for the same reason. We might want to put this back in a more generalised form to support downloading source tarballs to directories other than the current one, but his could be overkill.
Added test for the modified cyg-apt source command. The test is very simple and a little hacky: it executes the command, checks the testpkg-0.0.1-0 directory is present and that a marker file is also present: the mini_mirror source package build tree is also checked for the file as a sanity check in case the mini_mirror changes. It's becoming a problem that the "source" package from mini_mirror is just a duplicate of the binary: sufficent for testing but confusing to newcomers!
Also cleaned up other lilly-pond specific comments variables and script lines in cyg-apt, mostly at the top level of the script: EXTRA, MKNETREL, PATCH and some lines from setup() which appeared to be both lillypond and mingw specific. I'm (chrisc) thinking that cyg-apt should focus on complete tested functionality on Cygwin and not worry about MinGW for now, if ever.
Commented out the hardcoded initial values for offical_mirror, mirror, cache and downloads: until this is sorted out I'd prefer cyg-apt breaks if not given a .cyg-apt or command line arguments for mirror and cache.
Revision 41
-----------
Fixed comment on cyg-apt uninstall_want_file_removed(): as it stands any function __doc__ string is reported in the --help as if the function is a command and uninstall_want_file_removed() is not a command.
Fixed cyg-apt url command: wasn't prefixing with mirror url.
Added a test for fixed cyg-apt url command.
Revision 42
-----------
*Added a very basic test for buildrequires:
The same tests as normal requires since there's very little difference in the Cygwin packaging system. I don't think the existing buildrequires code in cyg-apt is quite right: it looks for
external-source in .ini package properties but it doesn't appear there, it appears in setup.hint: needs a fix and a better test. In practice external-source is rarely used.
*Added mini_mirror support for the cyg-apt upgrade test:
mini_mirror now creates a 0.0.2-0 version of testpkg which contains a single additional file as a test marker: /etc/ver2_marker.
* Added a test for upgrade:
installs 0.0.1-0, patches the installed setup-2.ini to indicate 0.0.2-0 as the current version then attempts an upgrade: proper behaviour is the automatic uninstallation of 0.0.1-0 followed by installation of 0.0.2-0. Currently we only check for ver2_marker: a better test would also check for the non-existance of a 0.0.1-0 only file.
* Fiddled with requires inplementation
Use a less confusing list comprehension. I notice the implemenation isn't as efficent as it could be: packages have their requirements merged in to the dictionary multiple times.
* Moved the setup-2.ini used in testing back to /etc/setup-2.ini until I get it sorted out.
* Last commit before culling the top-level script.
Revision 44
-----------
Added a test for cyg-apt update.
Big architectural change to cyg-apt: gathered the top-level script into a "main" function which has the same role with the advantage of being all in the one place: the top level script was scattered through the file, which makes it very hard to track what happens before the execution of the command entry point. This proved harder than expected due to the large number of existing globals and the way that .cyg-apt is read into the top level's __dict__ necessitating more globals to keep it working.
Passes all the tests in the testsuite but this was such a disruptive change I expect more bugs in the future.
Revision 45
-----------
Change "basename" to "scriptname" when referring to sys.argv[0] to avoid confusion with other uses of basename, and stop passing it around as global.
Added "get_rc()" in line with get_installed() and get_setup(): localise configuration of cyg-apt from .cyg-apt into one function. This includes both reading values and (currently) expanding values by (for example) adding known path chunks.
Rearrange Main: group the four main things it does:
setting up constants
parsing the rc
command line overrides
read in the cygwin package database
Also: don't special case the launching of the update and setup commands: a simple if statement avoids reading in the package database in these cases. (Don't read packge db in: these commands don't count on it existing: setup (potentially creates a fresh empty db) while update overwrites setup.in.
Revision 47
-----------
Moved determing if .cyg-apt exists and if so which one to use back to main. get_rc() and setup() both use this info: get_rc to read in .cyg-apt and setup as an indicator of whether it should create .cyg-apt or not.
Add ability to create .cyg-apt from hardcoded constants to setup() and warnings if setup() is invoked with an existing .cyg-apt: refuses to overwrite.
Revision 49
-----------
Added get_setup_rc(location): reads the Cygwin package database .rc located at /etc/setup/setup.rc and takes last-cache and last-mirror as (sensible) defaults for a new .cyg-apt. Big advtange of this is that new users can now run cyg-apt setup and expect the next command to work (using the last mirror / package cache they accessed using setup.exe.
Added warnings to setup() if /etc/seutp.rc is not found and empty-string default values for mirror and package cache for this case. I expect this case to be rare in practice.
Added verison detection: 1.7 currently uses setup-2.ini not setup.ini: good to pick this up as a default for a fresh .cyg-apt. Will need to remove this once 1.7 moves back to setup.ini
Added sanity check get_rc: if cache or mirror is not defined print an informative error message and exit.
Note -- this new model is quite different from the old one: now a complete .cyg-apt is always required: command line arguments are *strictly overrides* to this initial requirement. It also means you have to create .cyg-apt before running .cyg-apt or (much more common) let cyg-apt setup create one for you.
Revision 50
-----------
Fix the ROOT problem: previously the global ROOT was being applied both as an absolute directory e.g. "tar -C ROOT" and as a path prefix ie:
ROOT + /etc/setup/setup.ini
One constant can't fufill both roles well: to have "/" as root (ie the usual case) you have to use "/." to avoid ROOT + /etc/setup/setup.ini becoming "//etc/setup/setup.ini". Using paths like "etc/setup/setup.ini" are a trap for new developers.
The solution is to have two forms of ROOT: PREFIX_ROOT "" and ABSOLUTE_ROOT "/" which expands well to "/e/home/some/dir/" and "/e/home/some/dir" for a non-null root, not that we expect to be using this since running cyg-apt outside Cygwin is not a (tested) release target at this stage.
Change .cyg-apt to take advantage of the more sensible "/" root.
No test for setup yet.
Revision 51
-----------
Added a test for cyg-apt setup: removes .cyg-apt in cwd and HOME, calls cyg-apt setup and checks the mirror and cache match Cygwin's setup.rc. Then restores .cyg-apt as required.
Fixed TestCygApt.testlist: broke up the horrible regex into three bite-sized regexes, adding a regex to match on the new version available field when it is present.
Revision 52
-----------
Now run the testsetup cleanup code always, even if an exception is thrown (important given we're moving the developer's cyg-apt files around during testing.
Changed testinstall_remove to call core do_testinstalll_remove for the actual tests: this allows this testing code to be shared between testinstall_remove and testcommandline.
Added testcommandline: it has a fairly heavyweight test for --cache= option: it actually copies the whole (testing) package cache to a new directory and confirms we can remove/install the testpkg. Has always-cleanup behaviour as per testsetup (see above)
Revision 53
-----------
Created a do_testupdate function so the test can be shared by testcommandline, which now has a --mirror test: test giving cyg-apt a bad mirror fails properly and test performing an update (of setup.ini) with a command-line provided mirror. The idea is the bad mirror test shows the command line argument is being used and the second test shows it is being used properly: a relatively lightweight test in terms of complexity but unfortunately the bad mirror test takes a few seconds to timeout and it all adds up: the tests now take quite a while to run.
Added utilpack to the tools: some handy routines, currently in the domain of IPC and filesystem queries. (Fancy names for popen and recursive find :) )
Revision 54
-------------
Added tests for --download and --ini. Moved --cache and --mirror tests to their own functions: the command line test was getting monolithic: when something goes wrong it's great to be able to isolate a specific test.
Revision 55
-------------
setup_ini_diff_make.py is getting out of hand: it's handling of the .ini file is unstructured. This was fine to start with but I keep adding functions eg
Added error exits if the primitive line-hunting code runs out of the package we started in. Changed the name of variables to match my model of setup.ini: as a broken/nonstandard .ini where:
@foo
[section]
option=feild1 feild2...
@foo is level higher than the standard .ini section in the tree
[curr] is implied. Why on earth didn't Cygwin make it explicit?
[section] is a standard .ini section
option= are standard .ini options, but
field, is my term. There's no offical term for space separated words on an option line, as far as I know.
What I really need is to create an object like ConfigParser or derived from it to parse the nonstandard Cygwin .ini. That would be much cleaner, but is it worth the effort?
add dist selection to setup_ini_diff_make.py Add a [test] section to the mini_mirror setup.ini, and add the 0.0.2-0 version of testpkg as the target. Add the corresponding md5 patch command to the makefile.
Use the above [test] section (ie --dist=test) in test-cyg-apt to confirm that the --dist= command line option works.
Fixed a bug in the base 0.0.1-0 testpkg: on a second run of the makesystem it would pick up the 0.0.2-0 marker because it wasn't getting cleaned properly.
Makefile I've been slowly adding to is also getting out of hand. I wish there was a good, *standard*, replacement for make.
Fixed a bug in cyg-apt: --dist was failing because main() wasn't propagating distname out to the other functions as a global. Utilimately cyg-apt has to be turned in an object so we can explicitly use self.foo rather than all these globals.
Revision 56
-----------
Added a test for cyg-apt version. Simple command, gives the version of an installed package so the test is simple too.
Added support for cyg-apt --no-deps testing in mini_mirror: testpkg-lib (or package_name_2 as it is also know) now installs /usr/lib/testpkg-lib.marker.
Added test for cyg-apt --no-deps command line option: test absence of marker when testpkg is installed (ie that it doesn't pull in its dependency, testpkg-lib), also check installed.db handling by making sure it doesn't appear in `cyg-apt list`
I notice that the new purge command is suboptimal: it cannot/does not remove packages present in the cache but not installed. As it stands I think the main way of locating tarballs in cyg-apt is via installed.db. Fixing this behaviour will require using setup.ini's data in conjunction with other data: it's more like an "anti-install" than a normal remove, though a normal remove also has to happen.
Revision 57
-----------
Added a test for the basic string search version of `cyg-apt search testpkg`
Added a basic test for the command line --root option. Uses Cygiwn mount command to determine the windows path root of the installation we're running in and confirms that cyg-apt list works with this path as the root. Also confirms it fails with a bad root -- just to make sure we're actually using the option data at all. This is a long way from a comprehensive test: running the whole test suite with specific root would be a much better tests. So I'm not 100% sure that cyg-apt works with a specified root on all commands.
Made a temporary fix to cyg-apt's update() function: it was deleting the current setup-2.ini before we know the new download is successful!
Now it downloads to a transient temporary directory. I notice I've got hardcoding that has to come out.
Revision 58
-----------
Removed hardcoding of Cygwin 1.7's (current) setup-2.ini name for setup.ini. Mostly removed from update()
Hacked a bit on purge(): rather than calling remove() it calls do_uninstall() directly: the advantage is that now each package is processed 'atomically' in the purge() mainloop and you don't get a warning when purging a package that isn't installed: it's not an error to do that, so it shouldn't warn. Disadvantage is now do_uninstall() is called from more places and if additional code is added to remove() it won't automatically get picked up by purge()
Big change to --root option handling: removed all the hardcoded assumptions of how cyg-apt should be configured when using --root. Now the model is much simpler and cleaner: setting the root prefixes the .cyg-apt configuration, period. So if you have specific needs for running cyg-apt outside Cygwin the proceedure is to create a custom .cyg-apt for paths that lie within Cygwin and provide command line overides for *anything that lies outside Cygwin's filetree*. This use case remains untested though.
Changed .cyg-apt to use an absolute path for local_cache. This is a backwards step for the ease of setting up cyg-apt testing but had to be done to support the newly simplified .cyg-apt/ --root model.
Revision 59
------------
Added --regexp flag. Changed cyg-apt search and find to respect the new flag:
noflag -> simple substring searches
--regexp -> report re.search(str) results
The advantage of this is that users are not tripped by characters being used in a regex when they don't expect eg Ahmet Sacan reported a problem with the original cyg-apt when performing cyg-apt search g++.
Added tests for the new flag applied to search and find to test-cyg-apt.py
I notice that the find command is very slow. Most of the time is in reading the tarballs and extracting their filelists.
Revision 60
-----------
Don't raise an exception in update() if the given mirror is bad: it's an error condition not a script failure and I'm increasingly wanting to differentiate these.
Don't give usage() if setup.ini or installed.db is missing: these are error conditions like any other. DO give usage() if given a command we don't understand, we used to exit silently.
Big change to test-cyg-apt.py and it's supporting utilpack.py: don't echo anything unless run with -vv (-v will give the tests that are performed, -vv will also echo the cyg-apt commands and their outputs. Getting -vv into the test object is a bit hacky but it's already a bit of overkill. Also changed popen to make it more like popen2: that's a good interface (subprocess's interface sucks IMO. Too complex -- should come with convenience functions reproducing the old os.popen functions.)
Revision 61
-----------
Remove dependance on Cygwin tar : use Python tarfile module instead.
Idea is to reduce the number of packages cyg-apt can't safely update. Maybe one day cyg-apt will be runnable from a Windows dos box. That would be very useful: it would open the posibility of updating Cygwin itself. Howver I don't know if core Cygwin can/should be done properly by an unoffical tool such as this one.
I notice we have a dependence on Cygwin gzip. That's new to me, and also has to go.
Revision 62
-----------
Remove dependence on Cygwin gzip -- use Python gzip module instead.
Revision 63
-----------
Removed dependence on Cygwin wget -- use Python urllib instead, with CygAptURLopener as a small helper class derived from urllib.FancyURLopener: does a better job of catching errors and has a simple built-in progress bar callback. The calls to uri_get have not been updated to the new semantics: one thing at a time.
Made the cyg-apt error message more informative.
Removed blank link from cyg-apt download's output.
Fixed buggy test in test-cyg-apt: do_updatetest wasn't really testing anything.
Changed test-cyg-apt.py testcmdline_mirror() to match new error message.
Added always-executed cleanup after do_testupdate() to ensure setup.ini is replaced: the test might (purposefully) clobber the file.
Fixed test-cyg-apt.py do_testupdate(): it was generating a diff to patch setup.ini with but not applying it, so the overwriting cyg-apt update could never fail. This test is overcomplicated and will be simplified, anyway.
Revision 64
-----------
cyg-apt update() now checks uri_get error return. Simplify update() -- get rid of all the file shuffling: uri_get won't overwrite anything unless the download succeeds, so there's no need to back up in update(). Remove hardcoding of setup.ini's name in update: now determined by a single call to uname. It's a pitty uname ties us to Cygwin, not sure how to deal with that.
Revision 65
-----------
Remove dependence on cygpath: use internal fn instead.
Reduce dependence on uname: still used, but if we aren't running on Cygwin guesses Cygwin 1.5 and keeps going.
Remove dependence on Cygwin md5sum: use Python m5 module instead.
Add check_forbidden_packages -- fn to eliminate packages we shouldn't attempt to update, not actually used yet.
Revision 66
-----------
Added a new line to .cyg-apt: barred. Barred is a list of packages cyg-apt is forbidden to install, remove, purge or update. If a package is on this list, cyg-apt now warns the user and skips over it. The list is the set of packages we are dependent on:
barred="python cygwin base-cygwin coreutils"
Added a reasonably comprehensive test for barred package handling to test-cyg-apt.py. As part of this added a .cyg-apt patching/restoring fn.
Killed old dead code that faked pipes when using a broken version of Python: we don't pipe anything in cyg-apt anymore: fewer external shell tool dependencies.
Simplied plist helper fn.
Revision 67
-----------
Added more barred packages to generated .cyg-apt: things python is dependentant on.
Added a MinGW compatible verison of rename that papers over the Windows Python behaviour of not overwriting a file with rename.
Changed all the string exceptions to objects: deprecated.
Fixed cyg-apt list: long packagenames used to colide with their version numbers: now there is always a space between them.
Moved from Python md module to haslib: Python 2.6 compatibility to aid the effort to make cyg-apt runnable from outside Cygwin.
Added Cygwin 1.5 compatiblity: mainly affects cyg-apt settup: in the absence of of /etc/settup.rc (1.7 and later Cygwin) use the old settup.exe last-mirror last-cache files, if available.
Changed barred package list to be searched for matching substrings: barred package zlib also bars zlib0.
Changed Cygwin platform detection not to crash on MinGW.
Fixed cyg-apt crashing if run as "just cyg-apt" without a .cyg-apt present: insists on having a .cyg-apt before even giving the help! That's because the help contains feilds from the .cyg-apt: useful but a bit unfriendly for first-time users?
Added Cygwin 1.5 support to the testsuite: mostly using last-mirror last-cache as above. Added cygpath helper to cope with last-cache being given as Windows path.
Hacky removal of ".py" extension if present in scriptname.
Added try:...finally: to testupgrade to ensure cleanup code is run.
Revision 68
-----------
Standardized the directory structure:
cyg-apt/
/trunk
/branches
/tags
/wiki
Added a release directory, some notes and the first release:
cyg-apt-1.0.0-1.tar.bz2
removed mini_mirror setup-2.ini: it's just misleading. If you are going to use test-cyg-apt.py you have to get mini_mirror working on your system. Possibly .cyg-apt should go too.
Revision 75
-----------
Messed about with ignoring mini_mirror/setup-2.ini but backed that change out: I find it useful to have an initial verison checked in, but changes in this file are not significant and other people won't be able to use it -- they'll need to create their own. Unsolved problem.
Added some basic notes on releases. Changed the file permissions on cyg-apt: it wasn't checked in as being executible. Recreated the first release with fixed permission. Looks like we're ready for the alpha release to Google Code.
Revision 78
-----------
Reverted to using Cygwin cygpath instead of my own version to pick up setup.rc -- my version wasn't accounting for possible filepath mapping issues. Need to think more about this.
Conducted the cyg-apt-1.0.1-1 release to get this change out there.
Started work on making cyg-apt runnable from DOS/Windows Python. Added PathMapper: a small class that handles mapping paths according to Cygwin mount: we've still (intentionally) got a dependence on Cygwin being installed before managing packages.
try_run_script() now rejects running scripts if not in Cygwin before it checks if the script is there -- it was throwing exceptions before getting the chance to realise we weren't under cygwin so it didn't matter.
Added a custom tarball unpacking function for running outside Cygwin. We really have to have an external function: the Python library function expects to unpack into a root directory whereas external path mapping has to be done file-by-file. By external path mapping I mean handling the mount table outside Cygwin: ie /usr/bin is actually at C:\cygwin\bin, not C:\cygwin\usr\bin.
Complicated the handling of scripts on removal to cope with running cyg-apt from Windows dosbox: don't remove scripts and don't attempt to run them. Warn the user that they'll need to look after them. I'm planning to provide a cyg-apt command to ease this process: a postremove command to run in Cygwin afterwards. It's all rather theoretical. To this end add the concept of "noremove" to uninstall_want_file_removed().
Set up PathMapper in main: set when the root is explicitly set, which is basically a covert requirement of running outside Cygwin at the moment: something else to address. When not setting root explicitly the PathMapper is given "" as root, making mapping operations no-ops. That might sound bad, but I don't want lots of differnt paths of control depending on where we are running from.
get_md5() now opens "rb" -- needed on MinGW and the correct thing to do in any case.
The uninstall tarfile remove loop was altered directly to use map_path() mappings. This works but it would be more consistent to use diff functions as per install.
Bugfix in test-cyg-apt.py: testsetup() was failing if ~/.cyg-apt never existed: if we started testing without this file we don't create a backup of it, so we can't restore it after testing and, well don't need to. Doy.
Revision 85
-----------
Removed more dependence on shell operations:
uri_get(), update(): use shutil.copy instead of cp.
write_filelist() use os.stat/os.utime instead of "touch"
Added a bailout for attempts at setup outside Cygwin.
Cleaned up platform detection and cygwin version detection, removing a call to Cygwin's shell uname in the process -- affects main() and setup()
Move the .cyg-apt creation message to the end of the setup() function: at this point we can be sure we've actually created it and not encountered an error.
os.mkdir in place of shell mkdir in do_unpack() (source unpack)
If "HOME" is not in the environemnt set home_cyg_apt_rc to None rather than fail with an error.
We now run under DOS!
Revision 86
-----------
Add postinstall and postremove commands to cyg-apt: make it easy for the user to run scripts after installing a package from cyg-apt running in DOS.
Simplify do_external_install to reduce the amount of duplicated code.
Change DOS install messages to avoid the old per-script warnings and just tell the user to run cyg-apt postinstall from Cygwin.
Some moves towards some sort of coding standard adherance. Long way to go.
Revision 87
-----------
Added -f options: allows any package to be installed or removed. For use from DOS where we have no Cygwin dependencies. It's a dangerous option: can remove core Cygwin components. Added a message to prompt user to its availablity from DOS, but not Cygwin.
Added yet more globals, increasing the need to convert cyg-apt to an object: postinstall, postremove, preremove (directories.) The advantage of this is that it localises path mapping to main and get_rc: if path mapping has to change in the future it will be easier to do.
Revision 88
-----------
Added "mountroot" to the PathMapper class: the Cygwin root (as in windows path to "/" as found from the mount program.
Changed the script directories to *_dir to avoid namespace collisions with the new postinstall/postremove commands.
Use PathMapper in setup() to fetch Cygwin root from Cygwin mount command.
Added setup_ini to the paths that get prefixed in get_rc(). Added platform specific behaviour: under Cygwin the root is always "/": that's the Cygwin filesystem. Under DOS we take the root from the rc: the windows path to the Cygwin root.
Tough decision: removed root and cache command line options. Given the complexities of cyg-apt's Cygwin/DOS behaviour I decided to simplify configuration down to: setup or normal run, where normal run always takes all path configuration from .cyg-apt and there are no command line overrides.
Now path mapper is set up in two places only: get_rc() which is the core path configuaration function and setup() which has it's own local copy to get the Cygwin root, exiting afterwards.
Comment out the defunct commandline tests.
Move .cyg-apt to include new product of setup() ie the windows path Cygwin root. .cyg-apt and setup-2.ini are checked in: they are specific to my machine and to a mini_mirror build so they really need to be easily generated but not in svn -- TODO.
Revision 89
-----------
Made PathMapper platform specific: returns Cygwin paths under Cygwin, windows paths under DOS (we retain the proper "/" path separators though, not the foolish "\" ones... Windows Python accepts this.)
Fixed error message in set_root() -- can't complain about a bad .rc, root might not be set from the .rc.
Reduce use of PREFIX_ROOT in setup()-- replace with map_path to localise how we map paths to that one object.
More coding standard changes -- fairly disruptive I'm afraid: eliminate spaces between all functions and their argument parens.
Revision 90
-----------
Sort the mapped paths in PathMapper: this ensures that /foo/baz will be taken instead of /foo for path /foo/baz/adir/afile if both /foo/baz and /foo are present in the mount table.
Added preverse utility function. It's beyond me why a python list reverse doesn't return the list!
Added the .cyg-apt in use to the usage message. Removed options we no longer support.
Added options to suppress postinstall and postremove script execution. Potentially useful in rare real-world cases, more useful to test the new postinstall and postremove functions.
Added tests for postinstall and postremove to test-cyg-apt. Changed helper functions to support same: allow install and remove states to be in the no-postinstall no-postremove state.
All this is aimed at providing some parital testing of:
DOS: cyg-apt install/remove testpkg
CYGWIN: cyg-apt postinstall/postremove testpkg
commands work without recourse to a DOS-side testing framework.
Revision 91
-----------
Part one of removing use of "global" -- transform the main script into an object, but retain the globals. The globals will become class members in the next step.
Revision 92
-----------
Part two of removing use of "global" -- transform all global variables to class members. Big change: cyg-apt 175 lines of 1215 changed.
added __init__ for CygApt.
Moved initialisation from main to CygApt.__init__(): main retains arugment parsing and some high level environment discovery such as .cyg-apt presence and the platform we are running on.
CygApt creator arguments override values from .rc ie command line overrides as before, but made it more explicit.
Re-wrote Usage() to reflect transformation to an object.
Revision 93
-----------
Cleaned up the object model: removed the link between CygApt object creation and the command you will use it for: rather than having different sets of creation requirements and supported initilisation options for different commands, CygApt now has only one set of requirements: the presence of .cyg-apt, setup.ini and installed.db.
To this end I removed command as a parameter to CygApt.__init__() and created a new object CygAptSetup. This object has fewer preconditions and is used to set the environment up for CygApt. It handles help, setup and update, removed from the main class.
Moved some standalone functions out of class scope so both objects can use them. It makes their role as helper functions clearer, too.
Changed main to invoke CygApt or CygAptSetup as required.
Simplified usage() -- echos less configuration details. Separation of concerns.
Revision 94
-----------
Add comments to generate .cyg-apt to help new users.
Move rpsort() to helper status. Why on earth does Python sort fail to return the sorted list?
Move platform detection to main()
Improve error handling for filelist()
Only warn about scripts not run under DOS if they actually exist (try_run_script)
Big revamp of do_install_external() to address several ways Python is broken under Windows. Very disappointing.
Fix filelist .gz generation: the method I was using is valid but broken under Windows.
First cut at providing some sort of reminder to run postremove command when running under DOS. Needs work.
Hacked install() to provide warnings about unrun postinstall scripts under DOS. Bit unclear to those unused to the code though. Needs work.
Improved parsing of .cyg-apt -- use a regex to be more tolerant of formatting for user-edited .cyg-apt files and to robustly step over comments. Use the same code in test-cyg-apt to verify contents of .cyg-apt.
Revision 95
-----------
Added a version of rmtree that, again, works on Windows and Cygwin.
Speed up the Windows workaround for unpacking tarfiles into the tree (install): instead of unpacking into a temporary tree and then copying the tree to mapped paths, *move* the files in the tree to mapped paths, created directories as required. Use new rmtree to clean up temporary tree.
Clean up unused code.
Add chmod to do_uninstall to allow code to remove files under Windows and Cygwin -- more Python platform dependance.
Revision 96
-----------
Breakthrough: cyg-apt under dos can now fully install and remove packages: it uses Cygwin's bash to interpret postinstall/pre/postremove scripts. This is a big advance because it means that cyg-apt can now act on cygwin Python and the packages it depends on, no problem. It also means the core cygwin packages can be installed and removed, with the use of nopostinstall/nopostremove flags as required if bash is affected: it's hairy stuff though, strictly for advanced users.
To do the above the way script paths are handled had to change: mapped and unmapped paths are both required: DOS python needs mapped paths, bash unmapped (cygwin native) script paths.
Merged try_run_script into run_script: too many microfunctions in cyg-apt.
Improved the user messages given when trying to act on a barred package with the assistance of a new common fn: barred_warn_if_need()
Revision 97
-----------
Made the nopostinstall nopostremove flags public for those users brave enough to try reinstalling cygwin core components.
Show usage if given a bad option instead of exception.
Give a error better message and exit if we fail to find a package on the mirror.
Add ability to detect if postinstall scripts are present in the filelist and only warn if we expect them to be there on removal. No such similar detection for install -- not sure if needed.
cyg-apt can now handle Cygwin Python and its dependants now (from DOS: reinstalled Cygwin python with cyg-apt successfully.)
Revision 98
-----------
Improve user messages for show and missing commands.
Move windows temporary extraction directory to [packagename]-[ver]-tmp to avoid colliding with packages downloaded as source.
Fix setup command: SetupCygApt was being passed the .cyg-apt location from main() -- the same logic as the main CygApt object: the proper behaviour is to always create in $(HOME) unless a .cyg-apt file already exists.
Fix some typos/errors in .cyg-apt comments.
Revision 99
-----------
Fix a bug that had crept in under Cygwin 1.5: the 1.5 compatibility code needs to be in the CygAptSetup class now.
Very slightly better error for purge command for non-existant packages: needs work.
Release: 1.0.2-1
Revision 100
------------
(100! Mhahaha!)
Editing the wiki bumps up revision numbers -- hence big gaps.
Define execption class SetupIniError.
Use SetupIniError to greatly improve error message for attempting to purge non-existant package.
Improve DOS install: rather than copying the copies that Windows python creates for links, invoke Cygwin ln to create a real link. Can handle symbolic links (as heavily used in the "vim" package), not handling hard links yet: I expect they would still be copies.
Make the Windows Python chmod klude for removing files in do_uninstall() Windows-only.
Fix bogus warnings when removing symbolic links.
Fix failure to remove symbolic links: os.path.exist() will report False for a link if its target has been removed, but the link itself remains. Fix is to use islink()
Added a symbol link to the test package, but no matching test for it in test-cyg-apt yet.
Revision 120
------------
Fix update command under DOS: use a one-off PathMapper object to map the necessary paths in update(): SetupCygApt is deliberately a separate object to CygApt and so doesn't get the benefits of CygApt's init -- nor the dependencies.
Added support for reproducing hard links from tarballs under DOS.
Added a fallback for the edge case where /bin/ln is not available: move the copies Windows Python creates in lieu of links. This applies to both hard and symbolic links. ln wouldn't be available when upgrading coreutils (or attempting to use cyg-apt to install Cygiwn from scratch -- not that that's really supported.) Very much an edge case but good to have.
Added a symbolic link and a hard link to testpkg in the mini_mirror.
Revision 121
-----------
Fixed a nasty Python bug, again in tarfile: under cmd shell getnames omits the trailing / for directories.
Fixed a bug in do_uninstall under cmd shell: the final uses of postremove_sh and postinstall_done weren't getting mapped for os.remove (which needs windows paths -- unlike bash which needs Cygwin paths for the same scripts.)
Added an error message: setup under cmd shell not supported.
Renamed scriptname to sn: lots of long lines have it and it's not critical for clarity: just "cyg-apt" for error message and warnings.
Enable separate postinstall/postremove under cmd shell -- but remove it from the help message again -- now it's only for edge cases its presence is actually kinda confusing.
Fixed link formation under cmd shell -- logic wrong way around.
Added cmd shell testing to test-cyg-apt: the whole test suite can now target windows instead of Cygwin. The method is pretty hacky, but works well: generate a batch file on the fly to reset the child cmd shell environment back to straight Windows from Cygwin on entrance, then run cyg-apt and pipe back the results.
Unfortuntely the test suite becomes ever harder to set up on another machine: based off a static file for the "clean" cmd shell environment.
Added special casing where required to reflect the slightly lesser capabilities of of cmd shell cyg-apt and translate paths before testing them against known-good paths were required.
Add specific tests for creating symbolic/hard links from package tarballs in testinstall_remove.
Revision 122
------------
Fix update command. Ironically it hadn't been updated to the new .cyg-apt format (which allows comments)
Add a basic safety check: if setup.exe is running it warns and aborts cyg-apt.
Not going to help users who rename setup.exe but hopefully these are few.
Fix test-cyg-apt for the new .cyg-apt format -- and update the testing .cyg-apt.
Update the wiki. Still not happy with the way wiki editing chews up so many revision numbers.
New release cyg-apt-1.0.4-1 : don't like doing so many, but this is important.
Revision 129
------------
Add support for ftp.
Fix additional "/" in setup.ini URL.
Release 1.0.5-1
Revision 131
------------
Build cyg-apt as a package: Makefile at the top level.
Added signature verification to update command in line with setup.exe, using Cygwin gpg package. Added gpg to set of barred pacakges.
Started a man page for cyg-apt : added preinstall script which adds Cygwin's public key to gpg's keyring, and calls cyg-apt setup.
Added a test for update signing to test-cyg-apt.py
Handle update under DOS shell: can't verify -- gpg is unfortuntely Cygwin dependent. setup.exe is better in that it contains a statically linked crypto library. Following suit is nontrivial.
Watered down message for not overwriting ~/.cyg-apt: it might not be an error, it might just be a reinstall.
Provide a better error for ball command on non-found package.
Fix a bug in get_requires. Bug in the error reporting code >.< not using the class namespace for destname.
Fix a bug in main: regex search didn't really support -s flag.
Add -X option in line with setup.exe to ignore signatures.
Add setup.ini gpg signing code to all the build processes: testpkg, testpkg-lib and cyg-apt.
Revision 132
------------
Simplify moving postinstall scripts to ".done" extension, fixing bug in the process: cyg-apt's own postinstall script wasn't being moved.
Fix cyg-apt Makefile: postinstall script was called "postinstall-cyg-apt.sh" not "cyg-apt.sh" (in /etc/postinstall.)
Revsion 134
-----------
Make the old release process work with the new gpg and Cygwin key installation requirement with the aid of a temporary old-style release installation script.
(releases/install-cyg-apt.sh). The sooner cyg-apt becomes a proper package, the better.
Release 1.0.6-1
Revision 135
------------
Always download setup.ini unless told not to when executing commands that use it. Users typically want the most recent versions of packages and this ensures they have the most up-to-date information. Added the options to .cyg-apt so users can revert to the manual system if the time and bandwidth burden of constantly downloading setup.ini isn't worth the convenience of not having to remember to call cyg-apt update to synch with the mirror.
Clean up the mini_mirror makefiles: use more macros.
Add CYGAPT_TESTMIRROR to all makefiles: everything can now build in the absence of testing mirror: useful for new developers -- and the test mirror is set by the environment.
Updated the README for new developers.
Added configure.sh: a small script to set up the build environment for new developers.
Added control of mini_mirror build to the toplevel makefile.
Added cleaning targets to aid source builds
Added a source build target: the whole tree (sans wiki) as a tarball.
Fixed a usage() bug: the CygAptSetup hosted commands weren't reported.
Moved CygAptSetup's rc parsing code into CygAptSetup's namespace.
Added support (and preference for) bz2 compressed setup.ini files
Turn off verification under DOS: Cygwin gpg won't run. Warn users.
Added silencing option to uri_get: it's too noisy to have cyg-apt telling you it's downloading setup.ini all the time.
Fix bug in uri_get() where failing to download a file wouldn't reset the current working directory.
Change uri_get to throw an exception on not finding a file instead of exiting.
Added undocumented option -a to turn off the always update function since some tests patch setup.ini. The proper way to do it is to edit .cyg-apt -- possibly should have done that instead.
Fix bugs in TestCygApt.testsetup: wasn't handling the case when ~/.cyg-apt is missing to start with.
Made TestCygApt.testdownload slightly more robust: looks for md5 matches using the last two lines of output rather than expecting a particular number of output lines.
Revision 139
------------
Added filelist and md5 to commands not needing update.
Made the automatic ini update noisy again: the silent version looks too much like a hang.
Clean up the download progress bar when done.
Add a "-- Installed packages ---" header line when listing installed packages.
Fix up tests to cope with noisy automatic ini update command.
Added install target to makefile for standardisation: not a proper install (not in installe.db), but there for compatibility with testers
configure; make; make install sequence.
Exit without error in setup if ~/.cyg-apt exists.
Move configure.sh to configure.
Move manpage to correct directory.
Revision 140
------------
Generate setup-2.bz in the mini_mirror and the main build (when the main build is exporting cyg-apt to the test server.)
Work on the manpage.
Improve the error handling of several commands when given no package or a non-existant package.
Improve the README for new developers.
Fixed a bug in handling compressed setup.ini (setup.bz2) -- was being opened in text mode, causing truncations in Windows Python.
Fixed Windows mode bug: decompressed setip.ini from setup.bz2 was being written out with Windows line endings. Workaround is ugly but effective: write out in binary mode.
Fixed Cygwin 1.5 bug under cmd shell: gpg has changed path: weakness of needing to use stuff in Cygwin from the DOS shell. I'm no longer sure cmd shell support is worth it.
Rework the clearing of the progress bar after a download completes.
Fix a bug in main() where packagename was set to 0, not None, preventing correct detection of no package given.
Catch and display exceptions at the top level. Much cleaner.
Ditch unused buildrequires() test.
================
Switching to git
================
1.0.8-1
-------
c3e7b15 Make install script change to current directory
b6fe556 Use subprocess module instead of deprecated os.popen3
89804ee Prevent error if $TMP is not set
a789cc7 Use setup.ini instead of setup-2.ini
d836ecf Make help text more readable
22bb534 Fix missing parameter for self.update()
366c4c1 Fix a couple of spelling/formatting issues
5571ddc Apply patch from http://code.google.com/p/cyg-apt/issues/detail?id=3
70c47d4 Show a more helpful error message on package MD5 mismatch.
1.1.0-1
-------
f394618 Add bash completion
24688e4 Fix requires list
348d188 Update install command
f2bc283 Fix write_filelist
d8f31ed Replace getopt by argparse
a72fbff Fix build lst
dd1770a Fix CygApt.write_filelist
d79c371 Add quiet option
7e98ce7 Fix running script like setup.exe
5bef6ad Update testsuite
a658372 Build a local mirror for running the test suites
53f1c71 Use only format function for string formatting
da1e0a1 Fix grammar so that print() is a function
53704b2 Remove string module dependency
5b75ad0 Fix iostreams
a54de00 Fix dependency
9dac272 Fix parse rc
a16f8cd Add control package integrity on install
659b77f Show a more explicit message on barred warning
128ea0f Fix bash execution
d1c4232 Add the ability to overwrite the configuration file for setup command
eec4e0f Update help message with version and license
2507a92 Add any relevent documentation into the binary package
6b88802 Add installtest fonctionnality to provide tests in installed location
788579f Fix unprotected PYTHONPATH assignation
5bb55a5 Update exceptions
8f67467 [doc] Fix target install directory
df5fd72 Fix sha-bang
a8f01f4 Fix content initialisation on cygapt.ob