aboutsummaryrefslogtreecommitdiffstats
path: root/NEWS
blob: bab2688c0ceaaee7600708e28f6d55a4a4d0da75 (plain)
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
Version 2.56 - 1 June 2020, by Jani Välimaa
- build.macros: add _configure_gnuconfig_hack macro based on one from Fedora to update config.{guess,sub}

Version 2.55 - 21 May 2020, by Jani Välimaa
- build.macros: add _legacy_common_support macro for adding -fcommon to compiler flags
- build.macros: run /usr/lib/rpm/check-buildroot at end of %install scriptlet
  via __arch_install_post

Version 2.54 - 14 April 2020, by Thierry Vignaud
- stop emiting requires(posttrans) on info-install (less container bloat)

Version 2.53 - 1 February 2020, by Thierry Vignaud
- build.macros: restore '--without <section>' rpmbuild functionality
  (which is very useful in order to work on huge packages before submiting them
  to BS)

Version 2.52 - 4 February 2020, by Jani Välimaa
- build.macros: remove '--without <section>' rpmbuild functionality
- build.macros: add __spec_install_post

Version 2.51 - 3 February 2020, by Jani Välimaa
- rpmrc: use _ssp_cflags also with arm optflags
- build.macros: drop pyver macro (moved to python-rpm-macros)
- build.macros: drop unused macros
    - _package_i18n()
    - py_platlibdir
    - py_purelibdir
    - py_platsitedir
    - py_puresitedir
    - perl_sitearch
    - perl_archlib

Version 2.50 - 16 January 2020, by Jani Välimaa
- build.macros: add mistakenly removed --prefix= back to configure macro

Version 2.49 - 16 January 2020, by Jani Välimaa
- build.macros: replace configure2_5x with configure macro
    - sync configure macro with rpm upstream
- build.macros: drop legacy libtoolize calls from configure macros
- build.macros: drop legacy --x-includes= and --x-libraries= from configure macros
- build.macros: drop deprecated and unused macros
    - __cputoolize

Version 2.48 - 2 January 2020, by Jani Välimaa
- build.macros: add build_* flags and set_build_flags macro from upstream rpm
- build.macros: add __global_* macros for compatibility with Fedora
- build.macros: drop deprecated and unused macros
    - __chkconfig
    - __service
    - _update_menus_bin
    - _update_desktop_database_bin
    - _update_mime_database_bin
    - _scrollkeeper_bin
    - make_session
    - make_dm_session
    - post_install_gconf_schemas
    - update_menus
    - clean_menus
    - update_desktop_database
    - clean_desktop_database
    - update_mime_database
    - clean_mime_database
    - update_scrollkeeper
    - clean_scrollkeeper
- build.macros: use rpm built-in %{warn:...} macro for deprecation warnings
- remove unused git-repository--after-tarball and git-repository--apply-patch
- build.macros: remove %_after_setup leftovers after
  introduce-_after_setup-which-is-called-after-setup.patch was removed from rpm
- rpmrc: drop deprecated macrofiles line

Version 2.47 - 25 December 2019, by Jani Välimaa
- replace %setup_compile_flags with upstream %set_build_flags and
  output deprecation warning if %setup_compile_flags is used

Version 2.46 - 24 December 2019, by Jani Välimaa

- make brp-mangle-shebangs to not exit if 'read shebang_line < "$f"'
  exits with a non-zero status.

Version 2.45 - 23 December 2019, by Thierry Vignaud

- switch binary payload compression to Zstandard level 19
  for faster installations
  See https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression
- sync brp-mangle-shebangs with FC:
  o do not stat / touch files needlessly
  o fix unsafe/incorrect command expansion
  o brp-mangle-shebangs: speed up finding of "text executables" (scripts)
  o Make ambiguous python shebangs error

Version 2.44 - 15 October 2019, by Pascal Terjan

- previous change worked manually on my mga7 but doesn't seem to work in cauldron
  chroot in iurt. Try harder.

Version 2.43 - 15 October 2019, by Pascal Terjan

- make armv7hl chroots on aarch64 work on all armv8 flavours

Version 2.42 - 15 October 2019, by Pascal Terjan

- actually make armv7hl chroots on aarch64 work as expected

Version 2.41 - 19 September 2019, by Thierry Vignaud

- fix %__libtoolize disapearing in rpm-4.15 (mga#25440)

Version 2.40 - 29 August 2019, by Thierry Vignaud

- move files from /etc/rpm/macros.d into /usr/lib/rpm/macros.d thus fixing most
  issues with rpm's testsuite (related to not being able to disable debuginfo)

Version 2.39 - 4 May 2019, by Pascal Terjan

- make armv7hl chroots on aarch64 work as expected (urpmi accepts to install armv7hl
  packages and default rpm build target is armv7hl)

Version 2.38 - 11 March 2019, by Thierry Vignaud

- add %_metainfodir macro for appdata metainfo dir
- kill ldd path code in devel.req (unused for 12 years)
- php.req:
  o don't a cache file that we never read back, thus fixing emited deps
  o use Find::File in order to find files

Version 2.37 - 21 October 2018, by Jani Välimaa

- strip binaries and libraries in __os_install_post if __debug_package isn't defined
- add __brp_strip, __brp_strip_comment_note, __brp_strip_static_archive and __brp_strip_shared

Version 2.36 - 24 September 2018, by Thierry Vignaud

- add __brp_mangle_shebangs in order to fix /bin -> /usr/bin & "env foobar"
- automatically compile python files

Version 2.35 - 24 September 2018, by Thierry Vignaud

- reduce triming changelog from 3 to 2 years
- remove duplicated systemd macros
- sync %__brp_python_bytecompile with upstream :
  o "%global __python %{__python3}" enables to properly fix py3 bytecompiling
  o also recognize %_python_bytecompile_extra for compiling outisde python
    specific directories
- terminate build when missing buildids by default

Version 2.34 - 8 September 2018, by Thierry Vignaud

- emits requires(posttrans) on info-install
  (needs newer rpm)

Version 2.33 - 7 September 2018, by Thierry Vignaud

- emits requires on info-install instead of provides for *.info files

Version 2.32 - 4 September 2018, by Thierry Vignaud

- automatically emits requires on info-install for *.info files

Version 2.31 - 9 August 2018, by Thierry Vignaud

- emit perl-base requires for new 32bit perl path

Version 2.30 - 9 August 2018, by Thierry Vignaud

- emit perl-base requires for new perl pathes

Version 2.29 - 05 August 2018, by Jani Välimaa

- fix python bytecompile in __os_instal_post as __brp_python_bytecompile is now defined by rpm upstream
- allow redefinition of __brp_python_hardlink in __os_instal_post

Version 2.28 - 26 May 2018, by Jani Välimaa

- add -fasynchronous-unwind-tables to default optflags for x86_64 and aarch64 (%ix86 has it already)

Version 2.27 - 22 March 2018, by Jani Välimaa

- Add aarch64 config

Version 2.26 - 25 January 2018, by Thierry Vignaud

- define %_pkgdocdir (mga#22444)

Version 2.25 - 6 August 2017, by Neal Gompa

- Remove pythoneggs.py in favor of using upstreamed pythondistdeps.py

Version 2.24 - 3 August 2017, by Thierry Vignaud

- drop now useless brp-java-repack-jars
- generate .gdb_index sections by default
- move _debuginfo_subpackages and _debugsource_packages from rpm

Version 2.23 - 30 July 2017, by Neal Gompa

- Remove leftover definition for find-lang.pl

Version 2.22 - 30 July 2017, by Neal Gompa

- Rename %configure to %main_configure and add shims
  for %configure and %configure2_5x to use it
- Remove redundant %__debug_install_post as it breaks
  split debuginfo and debugsource subpackage generation
- Remove find-lang.pl in favor of using upstream find-lang.sh
- Unify %configure macros into a single %configure macro

Version 2.21 - 26 July 2017, by Thierry Vignaud

- support split debugsources in our macros

Version 2.20 - 4 May 2016, by Neal Gompa

- Mark %make as deprecated for upstream %make_build
- Kill redundant %_smp_mflags logic

Version 2.19 - 12 April 2016, by Pascal Terjan

- use rtp's solution to build for armv5tl on armv5tl distro

Version 2.18 - 12 April 2016, by Pascal Terjan

- add config for armv7hl
- don't append %ldflags to $LDFLAGS forcibly

Version 2.17 - 15 November 2015, by Pascal Terjan

- move rubygem build macros to the rubygems package

Version 2.16 - 7 November 2015, by Neal Gompa

- update %mkrel to use %dist when defined and
  split out dist tag generation logic out of %mkrel

Version 2.15 - 23 October 2015, by Pascal Terjan

- update gem_install macro

Version 2.14 - 21 October 2015, by Pascal Terjan

- do not remove buildroot in %install if install is disabled
  (to make rpmbuild --without install actually useful)
- make python dependency extractor much faster

Version 2.13 - 24 July 2015, by Thierry Vignaud

- kill python macros that are already defined in rpm
- kill unused python macros (py_compile, py_requires)

Version 2.12 - 7 July 2015, by Christiaan Welvaart

- do not add -fPIC to optflags for x86-64

Version 2.11 - 3 July 2015, by Thierry Vignaud

- deprecate %makeinstall_std and advertize upstream %make_install instead
- kill %old_makeinstall (use upstream %makeinstall instead)

Version 2.10 - 28 June 2015, by Thierry Vignaud

- stop emitting perlapi-<version> provides
  now that nothing requires it

Version 2.9 - 24 June 2015, by Thierry Vignaud

- stop emitting perlapi-<version> requires

Version 2.8 - 21 June 2015, by Thierry Vignaud

- change file digests hashing algorithm to SHA-256
- kill obsolete %defaultbuildroot
- kill old %__find_(provides|requires)
- kill redondant/unmainted macro (mga#4927)
- kill unused kmod.* files

Version 2.7 - 26 October 2014, by Pascal Terjan

- add support for limiting parallel builds by defining
  %_smp_ncpus_max in spec file for packages needing it

Version 2.6 - 14 October 2014, by Pascal Terjan

- support being passed the egg-info directory

Version 2.5 - 1 October 2014, by Thierry Vignaud

- do not emit PHP requires for package's own files

Version 2.4 - 24 September 2014, by Thierry Vignaud

- emit pythonegg requires/provides back
- remove kmod.* from git (now SRPMS sources)
- remove dwz.macros from git (now SRPMS sources)
- remove now useless g-ir-extract-deps

Version 2.3 - 18 September 2014, by Pascal Terjan

- generate devel() dependencies for gcc libs

Version 2.2 - 15 September 2014, by Thierry Vignaud

- fix matching META files
- retrieve file name from stdin

Version 2.1 - 15 September 2014, by Thierry Vignaud

- actually package php.attr
- convert kmod provides to internal generator
- convert perl requires from meta to internal generator
- use rpmdeps to generate any "normal" dependencies

Version 2.0 - 12 September 2014, by Thierry Vignaud

- convert devel(foo) deps to internal generator
- convert multiarch deps to internal generator
- convert "perlapi" deps to internal generator
- convert perl-base deps to internal generator
- convert PHP deps to internal generator
- drop gstreamer/haskell/ruby/typelib deps generators
  we backported the needed .(attr|prov|req) files from FC/SuSe in other packages
- drop most of the script-based dependency generation bits
- drop some long dead scripts
- use internal dependency generator instead of "external generator"
  (like all other distros) which is way much faster :-)
  See:
  o http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator
  o http://laiskiainen.org/blog/?p=35
  side effect: we now output lowercase perl provides/requires (eg: "perl(urpm)")
- use upstream pkgconfigdeps.sh as we only have more checks because we were
  still using the external generator

Version 1.198 - 26 May 2014, by Jani Välimaa
- gi-find-deps.sh: improve sed magic to handle special sugar typelib requires

Version 1.197 - 27 Dec 2013, by Pascal Terjan
- Fix gem automated dependancies

Version 1.196 - 27 Dec 2013, by Pascal Terjan
- Use correct macro for gems dir now that rubygems moved

Version 1.195 - 24 Dec 2013, by Pascal Terjan
- Fix mistake in previous version

Version 1.194 - 24 Dec 2013, by Pascal Terjan
- Only install gem .so from paths in require_paths

Version 1.193 - 17 Dec 2013, by Pascal Terjan
- Improve binary gems handling and get more compatible with Fedora

Version 1.192 - 15 Oct 2013, by Pascal Terjan
- Switch to new pythonegg dependencies
- Add -O flag to %make

Version 1.191 - 14 Oct 2013, by Pascal Terjan
- have differrent provides for python2 and python3 egg
  requires will be switched after everything is rebuilt once

Version 1.190 - 28 Sep 2013, by Funda Wang
- add switch -d to gem_install to move headers into vendorarchdir

Version 1.189 - 25 Sep 2013, by Philippe Makowski
- Set valid macros names for Python byte compilation

Version 1.188 - 25 Sep 2013, by Philippe Makowski
- Improve macros for Python byte compilation

Version 1.187 - 24 Sep 2013, by Philippe Makowski
- Add macros for Python byte compilation

Version 1.186 - 20 Sep 2013, by Pascal Terjan
- Support gems with .so not under lib/

Version 1.185 - 20 Sep 2013, by Pascal Terjan
- Fix typo in previous version :(

Version 1.184 - 20 Sep 2013, by Pascal Terjan
- Support empty gems

Version 1.183 - 20 Sep 2013, by Pascal Terjan
- Handle another git ls-files syntax in gem_setup
- Fix dependency generation when ruby_version is empty

Version 1.182 - 10 Sep 2013, by Pascal Terjan
- Fix install of gems with several .so

Version 1.181 - 10 Sep 2013, by Pascal Terjan
- Support gems with the .so in a subdirectory

Version 1.180 - 10 Sep 2013, by Pascal Terjan
- Create a %gem_setup fixing most common problems

Version 1.179 -  8 Sep 2013, by Pascal Terjan
- Remove extra space in __ruby_module_name when oname is not defined

Version 1.178 - 15 Aug 2013, by Funda Wang
- gem_helper.rb: deprecated now, we not rely on plain gem command to build rubygems

Version 1.177 - 15 Aug 2013, by Funda Wang
- gem_helper.rb: deal with rubygems 2.0 changes

- gi-find-deps.sh: don't add pythong-gi requires automatically as we can't be sure if the code was written for python3 (again from SUSE)

Version 1.176 - 31 July 2013, by Jani Välimaa
- gi-find-deps.sh: sync more with SUSE to find typelib requires from Python scripts without .py extension (mga#10863)

Version 1.175 - 29 July 2013, by Jani Välimaa
- gi-find-deps.sh: sync 'find javascript requires' code with SUSE to find versioned requires

Version 1.174 - 6 July 2013, by Jani Välimaa
- gi-find-deps.sh: handle gi.require_version('Gtk', '3.0') type requires in .py files (from SUSE)

Version 1.173 - 5 July 2013, by D.Morgan
- Add auto requires for osgi() mvn()

Version 1.172 - 4 June 2013, by Colin Guthrie
- add pkgconfig package requires for private requires

Version 1.171 - 6 April 2013, by David Walser
- properly fix mga #3697 in find-lang.pl (only exclude man directories)
- own man pages that have a dot in their name (find-lang.pl regexp bug)

Version 1.170 - 4 April 2013, by Luc Menut
- revert change 1.168 because it introduces a regression when --with-man
  is used in combination with another --with-xxxx: all the directories
  found by find-lang are skipped (not only man directories mga #3697c10)

Version 1.169 - 24 March 2013, by Colin Guthrie
- add version macros for systemd/rpm-helper to ease distro upgrades

Version 1.168 - 17 March 2013, by Luc Menut
- fix find-lang.pl : do not own man lang directories with --with-man
  (patch from Thierry Vignaud, mga #3697, #9055)

Version 1.167 - 20 Jan 2013, by Funda Wang
- fix bug#8757, gi-find-deps.sh incorrectly match 'imports.github'

Version 1.166 - 10 Jan 2013, by Arnaud Patard
- remove -fsigned-char on arm, as it should not be needed any more
- fix dwz configuration on arm

Version 1.165 - 31 Dec 2012, by Thomas Baclund
- set libexec dir to /usr/libexec

Version 1.164 - 25 Nov 2012, by Colin Guthrie
- add some macros for udev rules and tmpfiles snippets

Version 1.163 - 23 Nov 2012, by Olivier Blin
- modify arch_tagged macro to use ()(64bit) instead of (lib64), to be
  compatible with the mark64 provides generated by find-provides

Version 1.162 - 2 Nov 2012, by Funda Wang
- set LC_CTYPE as UTF-8 when building gem

Version 1.161 - 24 Oct 2012, by Thierry Vignaud
- set LC_ALL=C in find-{provides,requires} (mga#7883)

Version 1.160 - 12 Sep 2012, by Funda wang
- merge rubygems.rb from Mandriva, so that it works with ruby 1.9.x

Version 1.159 - 10 Sep 2012, by Shlomi Fish
- fix gem_helper.rb with ruby-1.9.x (see bug #7429).
    - patch written by Shlomi Fish with some help from the people on
    Freenode's #ruby-lang.

Version 1.158 - 8 Sep 2012, by Funda Wang
- find-provides, find-requires: only enable rubygems when /usr/bin/ruby is found

Version 1.157 - 24 Aug 2012, by Thierry Vignaud
- find-provides: fix pok's perlapi auto provides

Version 1.156 - 21 Aug 2012, by Thierry Vignaud
- find-provides: ignore fontconfig.prov exit code (mga#7078)

Version 1.155 - 2 Aug 2012, by Thierry Vignaud
- drop very old rpmbuild aliases on rpm which warns about being deprecated for
  quite a long time
- enable including mini debuginfo in binaries

Version 1.154 - 31 Jul 2012, by Thierry Vignaud
- drop unused brp-compress (obsoleted by spec-helper 4 years ago)
- use upstream find-debuginfo.sh as we merged our changes back into rpm package

Version 1.153 - 31 Jul 2012, by Thierry Vignaud
- shrunk debug packages through using dwz
  (https://fedoraproject.org/wiki/Features/DwarfCompressor)

Version 1.152 - 27 Jul 2012, by Thierry Vignaud
- add support for mini debug packages
  (https://fedoraproject.org/wiki/Features/MiniDebugInfo)
- document Mageia divergences with upstream
- fix typo that breaks emiting maven provides
- generate a perlapi-<version> provide when libperl.so is found
  (inspirated from mdv (pok))
- sync brp-compress with upstream rpm.org:
  o add *.xz and *.lzma recompress support
  o avoid some unnecessary command invocations in scripts
  o make sure brp-compress doesn't go interactive in corner cases
- sync find-debuginfo.sh with upstream rpm.org:
  o add -r flag to find-debuginfo.sh to invoke eu-strip --reloc-debug-sections
    (Mark Wielaard, 2011-05-25)
  o create GDB index from find-debuginfo if possible (Tom Tromey, RhBug:617166)
  o drop useless rpm5 bits (less divergence with upstream)
  o generate debug symlinks for all filenames sharing a build-id (RhBug:641377)
  o fix behavior on cross-directory hardlinks (RhBug:618426)
- kill unused find-provides.perl.in
- prevent RPM_BUILD_ROOT to break brp-* scripts if it contains spaces
  (rpm.org#843)
- revert %_libexecdir change in 1.151
- use upstream brp-strip* as we provided older versions of upstream

Version 1.151 - 26 Jul 2012, by Thierry Vignaud
- fix %_libexecdir that changed to %_libdir when mga forked mdv
  (when we merged manbo stuff)
- install g-ir-extract-deps in the right place
- perl.prov: do not keep lower case provides since we do not
  emit lower case requires anyway
- switch from lzma to xz payload by default (like FC & mdv)
  (supported since 2008)

Version 1.150 - 26 Jul 2012, by Thierry Vignaud
- build with -fPIC on x86_64 too (pok, mdv)

Version 1.149.1 - 25 Jul 2012, by Thierry Vignaud
- merge patches from package repository:
  o fix build with rpm-4.9+
  o fix %rename macro
  o have kmod.prov handle .xz compressed modules as well

Version 1.148 - 25 Jul 2012, by Thierry Vignaud
- drop automatically generated dependencies on interpreters we either don't
  need dependencies on or that we have other dedicated dependency generators
  for making them duplicate, reducing ~5K packages' dependencies at
  next rebuild. (Per Oyvind, mdv)
- drop automatically generated rtld(GNU_HASH) dependencies, it's been provided
  by glibc for five years now and can safely be assumed that there's no longer
  any need for it, reducing ~8K packages' dependency on it during next rebuild.
  (Per Oyvind, mdv)
- "resolve" /bin/env foo interpreter to actual path, rather than generating
  dependencies on coreutils, should trim off ~800 dependencies more
  (Per Oyvind, mdv)
- perl.prov: sync with upstream rpm.org:
  o avoid emitting empty perl() module deps
  o filter out incorrect perl(main) provides (rh#177960)
  o fix perl version provide for packages defined in multiple blocks (#rhbz214496)
  o make perl.{req,prov} warn about unreadable files
  o skip new-fangled head[34] while gerenerating deps (#118243)
  o skip over =for ... perlpod construct (RhBug:477516)
- use upstream fonconfig.prov as we had exactly the same file

Version 1.147-12 - 24 Jul 2012, by Colin
- Update location of the %_unitdir macro post-usrmove

Version 1.147-11 - 01 Jul 2012, by D.Morgan
- Fix generation of provides for osgi and maven

- Handle better osgi.prov by only looking at the wanted files ( remove error at rpm building 
- Handle better maven.prov by only looking at the wanted files ( remove error at rpm building )
- Add support for osgi and maven provide
- Use upstream desktop-file.prov as we had exactly the same file

Version 1.147 - 27 Dec 2011, by Anssi Hannula
- disable internal dep generator as we can't use it yet due to our
  external dep generator customizations
- add support for $EXCLUDE_FROM_FULL_STRIP regexp which makes
  find-debuginfo.sh only strip debugging symbols from the matched files
  (from Mandriva)

Version 1.146 - 24 Dec 2011, by D.Morgan
- Enable new internal dep generator ( needed for java packages)
- fix changelog truncation to 3 years to work with rpm.org

Version 1.145 - 08 Nov 2011, by Jerome Quelin
- Add Java macros from JPackage ( %create_jar_links(), %remove_java_binaries, and gcj functions )
- extract perl requires from MYMETA.yml / MYMETA.json when present

Version 1.144 - 19 Sep 2011, by Funda Wang
- Add support for fdo /usr/share/help when find_lang

Version 1.143 - 11 Sept 2011, by Derek Morgan
- Add automatic rm -fr %buildroot in %install
- Add systemd rpm macro

Version 1.142 - 29 Aug 2011, by Jerome Quelin
- keep lower-case perl provides in automatic extraction

Version 1.141 - 23 Aug 2011, by Funda Wang
- gi deps for python: push python-gi req for python introspection callings

Version 1.140 - 6 Aug 2011, by Funda Wang
- gi deps for python: push python-gi req for python introspection callings

Version 1.139 - 15 July 2011, by Christiaan Welvaart
- gi interdependencies: deps offset 0 means no dependencies

Version 1.138 - 7 July 2011, by Christiaan Welvaart
- gi deps for python: accept arbitrary whitespace in dependency lists

Version 1.137 - 7 July 2011, by Christiaan Welvaart
- extract gobject introspection typelib interdependencies using a helper program

Version 1.136 - 6 July 2011, by Nicolas Vigier
- fix typo added in find-requires script

Version 1.135 - 6 July 2011, by Nicolas Vigier
- add script for typelib() gobject-introspection bindings provides/requires

Version 1.134 - 6 June 2011, by Funda Wang
- add mimehandler autoprov for desktop files

Version 1.133 - 30 May 2011, by Pascal Terjan
- default to core section

Version 1.132 - 30 May 2011, by Pascal Terjan
- do not append .%distro_section if section is core

Version 1.131 - 19 May 2011, by Pascal Terjan
- append .%distro_section if set

Version 1.130 - 6 May 2011, by Nicolas Vigier
- set default distsuffix to .mga (after being changed to mga in version
  1.128)

Version 1.129 - 6 May 2011, by Nicolas Vigier
- find-requires.in: fix script file filtering, according to latest
  changes in file command output

Version 1.128 - 5 May 2011, by Pascal Terjan
- allow setting distsuffix at build time

Version 1.127 - 28 April 2011, by Nicolas Vigier
- make mgaversion macro return distro_release
- pkgconfigdeps.sh: run pkg-config only on .pc file in a pkgconfig
  directory

Version 1.126 - 23 March 2011, by Nicolas Vigier
- pkgconfigdeps.sh: check if the list of .pc files is not null before
  running pkg-config on it

Version 1.125 - 23 March 2011, by Nicolas Vigier
- pkgconfigdeps.sh was incorrectly checking for pkg-config output
  (bug #497)
- add more errors on pkg-config failure

Version 1.124 - 16 March 2011, by Arnaud Patard
- fix %_host macro to have full host triplet, to avoid break arm as
  it's using -gnueabi and not -gnu

Version 1.123 - 13 March 2011, by Nicolas Vigier
- add fontconfig.prov provides script

Version 1.122 - 4 March 2011, by Nicolas Vigier
- kmod.prov: exit 0 when there is no error
- check if pkgconfig version is defined, or exit with an error

Version 1.121 - 3 March 2011, by Nicolas Vigier
- filter.sh: return error when the script called generate an error
- find-requires.in: test return value of called require scripts and
  exit with error in case of error
- find-provides.in: test return value of called provide scripts and
  exit with error in case of error

Version 1.120 - 3 March 2011, by Thomas Backlund
- kmod.prov: convert special chars [,],:,- to _ when generating
  kernel module version provides (needed with rpm-4.8.1)

Version 1.119 - 2 March 2011, by Jerome Quelin
- make v1.118 work with perl modules having a number followed by a _ in
  their name, and a fully qualified VERSION (eg $l1_cache::VERSION = ...)

Version 1.118 - 26 February 2011, by Jerome Quelin
- support for _ in perl module version

Version 1.117 - 20 February 2011, by Ahmad Samir
- merge svn rev. 271797 from Mandriva to make the python auto-requires always
  lowercase

Version 1.116 - 5 February 2011, by Thomas Backlund
- merge rpmrc from rpm-manbo-setup
- merge manbo.macros from rpm-manbo-setup
- merge manbo-build.macros from rpm-manbo-setup
- merge under/overlinking scripts from rpm-manbo-setup
- merge rpm -b deprecated warning scripts from rpm-manbo-setup

Version 1.115 - 9 January 2011, by Oliver Blin
- initial Mageia import

Version 1.114 - 9 December 2010, by Rémy Clouard
- only add runtime dependencies in rubygems.rb

Version 1.113 - 2 November 2010, by Funda Wang
- find gstreamer provides

Version 1.112 - 1 November 2010, by Per Øyvind Karlsen
- enable python egg provides/requires.

Version 1.111 - 30 October 2010, by Anssi Hannula
- generate requires on "python(abi) = x.y" instead of "python >= x.y" for
  python modules to properly handle the strict dependency
- remove runtime dependencies from %py_requires as they are now handled
  automatically

Version 1.110 - 18 October 2010, by Per Øyvind Karlsen
- fix warning from rubygems.rb
- drop %gem_unpack, equivalent behaviour has been implemented in %setup now
 
Version 1.109 - 16 October 2010, by Per Øyvind Karlsen
- don't install dependencies for gems when using %gem_install
- fix build with rpm 5.3

Version 1.108 - 16 October 2010, by Per Øyvind Karlsen
- add gem_helper.rb and it's corresponding macros %gem_unpack, %gem_build &
  gem_install for simplifying & streamlining ruby gem packaging.
 
Version 1.107 -  9 September 2010, by Per Øyvind Karlsen
- enable automatic dependency extraction for ruby gems

Version 1.106 - 16 July 2010, by Jerome Quelin
- extract perl module version when $Full::Package::VERSION is set

Version 1.105 - 14 July 2010, by Jerome Quelin
- support to extract perl runtime requires from meta spec 2

Version 1.104 - 27 April 2010, by Christophe Fergeau
- revert previous '-g' addition when stripping shared libraries since it 
  increases shared library sizes by 10 to 20% for no good reason

Version 1.103 - 16 April 2010, by Per Øyvind Karlsen
- strip shared libraries with the '-g' option

Version 1.102 -  8 April 2010, by Michael Scherer
- do not requires python 2.X branch rpm for python 3.X modules, 
  requires instead python 3.X interpreter

Version 1.101 - 26 March 2010, by Jerome Quelin
- fix find-requires to call perl.req-from-meta with the correct meta
  file when there are multiple meta file in the package

Version 1.100 - 14 March 2010, by Jerome Quelin
- fix find-requires to look for correct meta.yml before calling
  perl.req-from-meta
- make perl.prov skip comment lines

Version 1.99 -  9 March 2010, by Per Øyvind Karlsen
- allow for for only stripping files without creating debug package contents by
  setting DISABLE_DEBUG environment variable.

Version 1.98 -  5 March 2010, by Per Øyvind Karlsen
- Update find-debuginfo.sh from upstream
- new script: perl.req-from-meta (jquelin)

Version 1.97 - 12 December 2009, by Anssi Hannula
- fix package build when the debug package is empty (regression introduded in
  1.96)

Version 1.96 - 10 December 2009, by Anssi Hannula
- fix perl.prov to assign versions to provides when the version is declared
  with 'our' or 'my' keyword, or when it is prepended with code
  (Jérôme Quelin)
- replace %sunsparc with %sparc & %sparcx (from rpm5.org, Per Øyvind Karlsen)
- support ELF executables only as a.out has been deprecated since ages
  ago (fixes objdump 'File format not recognized' errors) (Per Øyvind Karlsen)
- don't try finding debug files in buildroot when there's none
  (Per Øyvind Karlsen)

Version 1.95 - 25 September 2009, by Olivier Blin
- MIPS and ARM support (from Arnaud Patard):
  o add mipsel support
  o introduce CANONTARGETGNU, to be able to use -gnueabi for ARM
  o add arm support and use -gnueabi instead of -gnu

Version 1.94 - 8 August 2009, by Anssi Hannula
- update perl_convert_version to keep alphabetic tail in version number
  (Luca Berra)

Version 1.93 - 28 July 2009, by Christophe Fergeau
- update perl_convert_version macro (Jérôme Quelin)

Version 1.92 - 9 July 2009, by Christophe Fergeau 
- making sure automatic provides & requires for perl package are using the
  new macro %perl_convert_version (jquelin)
- rpm5 fixes (peroyvind)

Version 1.91 - 3 February 2009, by Christophe Fergeau
- build.macros.in
  o add new perl_convert_version macro to convert cpan version to rpm version
- git-repository--after-tarball:
  o commit the tarball with user "unknown author <cooker@mandrivalinux.org>"
  o commit the tarball using the tarball's modification time

Version 1.90 - 29 January 2009, by Pixel

- call patch with -U (aka --unified-reject-files)

Version 1.89 - 29 January 2009, by Pixel

- when %_with_git_repository is set, define %_after_setup and %_patch to use
  the new scripts git-repository--after-tarball and git-repository--apply-patch

Version 1.88 - 7 January 2009, by Christophe Fergeau

- fix ugly warning during invocation of php.req
- RPM5 fixes 
>; use common; use fs::type; use fs::loopback; use fs::format; use fs::mount_options; use fs; use partition_table; use partition_table::raw; use detect_devices; use run_program; use devices; use fsedit; use raid; use any; use log; =head1 SYNOPSYS struct part { int active # one of { 0 | 0x80 } x86 only, primary only int start # in sectors int size # in sectors int pt_type # 0x82, 0x83, 0x6 ... string fs_type # 'ext2', 'nfs', ... string type_name # 'Linux RAID', 'Linux Logical Volume Manager', ... int part_number # 1 for hda1... string device # 'hda5', 'sdc1' ... string device_LABEL # volume label. LABEL=xxx or /dev/disk/by-label/xxx can be used in fstab instead of the device string device_UUID # volume UUID. UUID=xxx or /dev/disk/by-uuid/xxx can be used in fstab instead of the device bool prefer_device_LABEL # should the {device_LABEL} or the {device} be used in fstab bool prefer_device_UUID # should the {device_UUID} or the {device} be used in fstab bool prefer_device # should the {device} be used in fstab bool faked_device # false if {device} is a real device, true for nfs/smb/dav/none devices. If the field does not exist, we do not know bool device_LABEL_changed # true if device_LABEL is different from the one on the disk string rootDevice # 'sda', 'hdc' ... (can also be a VG_name) string real_mntpoint # directly on real /, '/tmp/hdimage' ... string mntpoint # '/', '/usr' ... string options # 'defaults', 'noauto' string device_windobe # 'C', 'D' ... string encrypt_key # [0-9A-Za-z./]{20,} string comment # comment to have in fstab string volume_label # bool is_removable # is the partition on a removable drive bool isMounted bool isFormatted bool notFormatted # isFormatted means the device is formatted # !isFormatted && notFormatted means the device is not formatted # !isFormatted && !notFormatted means we do not know which state we're in string raid # for partitions of type isRawRAID and which isPartOfRAID, the raid device string lvm # partition used as a PV for the VG with {lvm} as VG_name #-# loopback loopback[] # loopback living on this partition string dmcrypt_key string dm_name bool dm_active # internal string real_device # '/dev/loop0', '/dev/loop1' ... (used for encrypted loopback) # internal CHS (Cylinder/Head/Sector) int start_cyl, start_head, start_sec, end_cyl, end_head, end_sec, } struct part_allocate inherits part { int maxsize # in sectors (alike "size") int min_hd_size # in sectors (do not allocate if the drive is smaller than the given size) int ratio # string hd # 'hda', 'hdc' string parts # for creating raid partitions. eg: 'foo bar' where 'foo' and 'bar' are mntpoint } struct part_raid inherits part { string chunk-size # in KiB, usually '64' string level # one of { 0, 1, 4, 5, 'linear' } string UUID part disks[] # invalid: active, start, rootDevice, device_windobe?, CHS } struct part_dmcrypt inherits part { string dmcrypt_name # rootDevice is special here: it is the device hosting the dm } struct part_loopback inherits part { string loopback_file # absolute file name which is relative to the partition part loopback_device # where the loopback file live # device is special here: it is the absolute filename of the loopback file. # invalid: active, start, rootDevice, device_windobe, CHS } struct part_lvm inherits part { # invalid: active, start, device_windobe, CHS string lv_name } struct partition_table_elem { part normal[] # part extended # the main/next extended part raw[4] # primary partitions } struct geom { int heads int sectors int cylinders int totalcylinders # for SUN, forget it int start # always 0, forget it } struct hd { int totalsectors # size in sectors string device # 'hda', 'sdc' ... string device_alias # 'cdrom', 'floppy' ... string media_type # one of { 'hd', 'cdrom', 'fd', 'tape' } string capacity # contain of the strings of { 'burner', 'DVD' } string info # name of the hd, eg: 'QUANTUM ATLAS IV 9 WLS' bool readonly # is it allowed to modify the partition table bool getting_rid_of_readonly_allowed # is it forbidden to write because the partition table is badly handled, or is it because we MUST not change the partition table bool isDirty # does it need to be written to the disk list will_tell_kernel # list of actions to tell to the kernel so that it knows the new partition table bool rebootNeeded # happens when a kernel reread failed list partitionsRenumbered # happens when you # - remove an extended partition which is not the last one # - add an extended partition which is the first extended partition list allPartitionsRenumbered # used to update bootloader configuration int bus, id bool is_removable # is it a removable drive partition_table_elem primary partition_table_elem extended[] geom geom # internal string prefix # for some RAID arrays device=>c0d0 and prefix=>c0d0p string file # '/dev/hda' ... } struct hd_lvm inherits hd { int PE_size # block size (granularity, similar to cylinder size on x86) string VG_name # VG name part_lvm disks[] # invalid: bus, id, extended, geom } struct raw_hd inherits hd { string fs_type # 'ext2', 'nfs', ... string mntpoint # '/', '/usr' ... string options # 'defaults', 'noauto' # invalid: isDirty, will_tell_kernel, rebootNeeded, primary, extended } struct all_hds { hd hds[] hd_lvm lvms[] part_raid raids[] part_dmcrypt dmcrypts[] part_loopback loopbacks[] raw_hd raw_hds[] raw_hd nfss[] raw_hd smbs[] raw_hd davs[] raw_hd special[] # internal: if fstab_to_string($all_hds) eq current_fstab then no need to save string current_fstab } =cut sub main { my ($in, $all_hds, $do_force_reload) = @_; if ($in->isa('interactive::gtk')) { require diskdrake::hd_gtk; goto &diskdrake::hd_gtk::main; } my ($current_part, $current_hd); while (1) { my $choose_txt = $current_part ? N_("Choose another partition") : N_("Choose a partition"); my $parts_and_holes = [ fs::get::fstab_and_holes($all_hds) ]; my $choose_part = sub { $current_part = $in->ask_from_listf('diskdrake', translate($choose_txt), sub { my $hd = fs::get::part2hd($_[0] || return, $all_hds); format_part_info_short($hd, $_[0]); }, $parts_and_holes, $current_part) || return; $current_hd = fs::get::part2hd($current_part, $all_hds); }; $choose_part->() if !$current_part; return if !$current_part; my %actions = my @actions = ( if_($current_part, (map { my $s = $_; $_ => sub { $diskdrake::interactive::{$s}($in, $current_hd, $current_part, $all_hds) } } part_possible_actions($in, $current_hd, $current_part, $all_hds)), '____________________________' => sub {}, ), if_(@$parts_and_holes > 1, $choose_txt => $choose_part), if_($current_hd, (map { my $s = $_; $_ => sub { $diskdrake::interactive::{$s}($in, $current_hd, $all_hds) } } hd_possible_actions_interactive($in, $current_hd, $all_hds)), ), (map { my $s = $_; $_ => sub { $diskdrake::interactive::{$s}($in, $all_hds) } } general_possible_actions($in, $all_hds)), ); my ($actions) = list2kv(@actions); my $a; if ($current_part) { $in->ask_from_({ cancel => N("Exit"), title => 'diskdrake', messages => format_part_info($current_hd, $current_part), }, [ { val => \$a, list => $actions, format => \&translate, type => 'list', sort => 0, gtk => { use_boxradio => 0 } } ]) or last; my $v = eval { $actions{$a}() }; if (my $err = $@) { $in->ask_warn(N("Error"), formatError($err)); } if ($v eq 'force_reload') { $all_hds = $do_force_reload->(); } $current_hd = $current_part = '' if !is_part_existing($current_part, $all_hds); } else { $choose_part->(); } partition_table::assign_device_numbers($_) foreach fs::get::hds($all_hds); } return if eval { Done($in, $all_hds) }; if (my $err = $@) { $in->ask_warn(N("Error"), formatError($err)); } goto &main; } ################################################################################ # general actions ################################################################################ sub general_possible_actions { my ($_in, $_all_hds) = @_; if_($::isInstall, N_("More")); } sub Done { my ($in, $all_hds) = @_; eval { raid::verify($all_hds->{raids}) }; if (my $err = $@) { $::expert or die; $in->ask_okcancel(N("Confirmation"), [ formatError($err), N("Continue anyway?") ]) or return; } foreach (@{$all_hds->{hds}}) { if (!write_partitions($in, $_, 'skip_check_rebootNeeded')) { return if !$::isStandalone; $in->ask_yesorno(N("Quit without saving"), N("Quit without writing the partition table?"), 1) or return; } } foreach (@{$all_hds->{raids}}) { raid::make($all_hds->{raids}, $_); } if (!$::isInstall) { my $new = fs::fstab_to_string($all_hds); if ($new ne $all_hds->{current_fstab} && $in->ask_yesorno(N("Confirmation"), N("Do you want to save the /etc/fstab modifications?"), 1)) { $all_hds->{current_fstab} = $new; fs::write_fstab($all_hds); } update_bootloader_for_renumbered_partitions($in, $all_hds); if (any { $_->{rebootNeeded} } @{$all_hds->{hds}}) { $in->ask_warn(N("Partitioning"), N("You need to reboot for the partition table modifications to take effect")); tell_wm_and_reboot(); } } if (my $part = find { $_->{mntpoint} && !maybeFormatted($_) } fs::get::fstab($all_hds)) { $in->ask_okcancel(N("Warning"), N("You should format partition %s. Otherwise no entry for mount point %s will be written in fstab. Quit anyway?", $part->{device}, $part->{mntpoint})) or return if $::isStandalone; } 1; } ################################################################################ # per-hd actions ################################################################################ sub hd_possible_actions_base { my ($hd) = @_; ( if_(!$hd->{readonly} || $hd->{getting_rid_of_readonly_allowed}, N_("Clear all")), if_(!$hd->{readonly} && $::isInstall, N_("Auto allocate")), ); } sub hd_possible_actions_extra { my ($_hd) = @_; $::expert ? N_("Toggle to normal mode") : N_("Toggle to expert mode"); } sub hd_possible_actions { my ($_in, $hd, $_all_hds) = @_; hd_possible_actions_base($hd); hd_possible_actions_extra($hd); } sub hd_possible_actions_interactive { my ($_in, $_hd, $_all_hds) = @_; &hd_possible_actions, N_("Hard disk drive information"); } sub Clear_all { my ($in, $hd, $all_hds) = @_; return if detect_devices::is_xbox(); #- do not let them wipe the OS my @parts = partition_table::get_normal_parts($hd); foreach (@parts) { RemoveFromLVM($in, $hd, $_, $all_hds) if isPartOfLVM($_); RemoveFromRAID($in, $hd, $_, $all_hds) if isPartOfRAID($_); RemoveFromDm($in, $hd, $_, $all_hds) if $_->{dm_active}; } if (isLVM($hd)) { lvm::lv_delete($hd, $_) foreach @parts; } else { $hd->{readonly} = 0; #- give a way out of readonly-ness. only allowed when getting_rid_of_readonly_allowed $hd->{getting_rid_of_readonly_allowed} = 0; #- we don't need this flag anymore fsedit::partition_table_clear_and_initialize($all_hds->{lvms}, $hd, $in); } fsedit::init_mntpnt_suggestions($all_hds, 1); } sub Auto_allocate { my ($in, $hd, $all_hds) = @_; my $suggestions = partitions_suggestions($in, $all_hds) or return; my %all_hds_ = %$all_hds; $all_hds_{hds} = [ sort { $a == $hd ? -1 : 1 } fs::get::hds($all_hds) ]; eval { fsedit::auto_allocate(\%all_hds_, $suggestions, $hd) }; if ($@) { $@ =~ /partition table already full/ or die; $in->ask_warn("", [ N("All primary partitions are used"), N("I cannot add any more partitions"), N("To have more partitions, please delete one to be able to create an extended partition"), ]); } } sub More { my ($in, $_hd) = @_; my $r; $in->ask_from(N("More"), '', [ { val => N("Reload partition table"), clicked_may_quit => sub { $r = 'force_reload'; 1 } }, ], ) && $r; } sub Hd_info { my ($in, $hd) = @_; $in->ask_warn(N("Warning"), [ N("Detailed information"), format_hd_info($hd) ]); } ################################################################################ # per-part actions ################################################################################ sub is_LVM_resizable { my ($part) = @_; member($part->{fs_type}, qw(btrfs ext3 ext4 reiserfs xfs)); } sub part_possible_actions { my ($_in, $hd, $part, $all_hds) = @_; $part or return; my %actions = my @l = ( N_("View") => '!isSwap && !isNonMountable && maybeFormatted', N_("Mount point") => '$part->{real_mntpoint} || (!isBusy && !isSwap && !isNonMountable)', N_("Type") => '!isBusy && $::expert && (!readonly || $part->{pt_type} == 0x83)', N_("Options") => '!isSwap($part) && !isNonMountable && $::expert', N_("Label") => '!isNonMountable && $::expert && fs::format::canEditLabel($part)', N_("Resize") => '!isBusy && !readonly && !isSpecial || isLVM($hd) && is_LVM_resizable', N_("Format") => '!isBusy && !cannotBeMountable && (!readonly && ($::expert || $::isStandalone) || fs::type::isRawLUKS($part))', N_("Mount") => '!isBusy && (hasMntpoint || isSwap) && maybeFormatted && ($::expert || $::isStandalone)', N_("Add to RAID") => '!isBusy && isRawRAID && (!isSpecial || isRAID)', N_("Add to LVM") => '!isBusy && isRawLVM', N_("Use") => '!isBusy && fs::type::isRawLUKS($part) && !$part->{notFormatted}', N_("Unmount") => '!$part->{real_mntpoint} && isMounted', N_("Delete") => '!isBusy && !readonly', N_("Remove from RAID") => 'isPartOfRAID', N_("Remove from LVM") => 'isPartOfLVM', N_("Remove from dm") => '$part->{dm_active}', N_("Modify RAID") => 'canModifyRAID', N_("Use for loopback") => '!$part->{real_mntpoint} && isMountableRW && !isSpecial && hasMntpoint && maybeFormatted && $::expert', ); my ($actions_names) = list2kv(@l); my $_all_hds = $all_hds; #- help perl_checker know the $all_hds *is* used in the macro below my %macros = ( readonly => '$hd->{readonly}', hasMntpoint => '$part->{mntpoint}', canModifyRAID => 'isPartOfRAID($part) && !isMounted(fs::get::device2part($part->{raid}, $all_hds->{raids}))', ); if (isEmpty($part)) { if_(!$hd->{readonly}, N_("Create")); } elsif ($part->{pt_type} == 0xbf && detect_devices::is_xbox()) { #- XBox OS partitions, do not allow anything return; } else { grep { my $cond = $actions{$_}; while (my ($k, $v) = each %macros) { $cond =~ s/$k/qq(($v))/e; } $cond =~ s/(^|[^:\$]) \b ([a-z]\w{3,}) \b ($|[\s&\)])/$1 . $2 . '($part)' . $3/exg; eval $cond; } @$actions_names; } } sub View { my ($in, $_hd, $part, $_all_hds) = @_; my $handle = any::inspect($part, $::prefix); if ($handle) { $in->ask_directory({ 'directory' => $handle->{dir} }); } else { $in->ask_warn(N("Error"), N("Failed to mount partition")); } } #- in case someone use diskdrake only to create partitions, #- ie without assigning a mount point, #- do not suggest mount points anymore my $do_suggest_mount_point = $::isInstall; sub Create { my ($in, $hd, $part, $all_hds) = @_; my ($def_start, $def_size, $max) = ($part->{start}, $part->{size}, $part->{start} + $part->{size}); $part->{maxsize} = $part->{size}; $part->{size} = 0; if (fsedit::suggest_part($part, $all_hds)) { $part->{mntpoint} = '' if !$do_suggest_mount_point; } else { $part->{size} = $part->{maxsize}; fs::type::suggest_fs_type($part, defaultFS()); } if (isLVM($hd)) { lvm::suggest_lv_name($hd, $part); } #- update adjustment for start and size, take into account the minimum partition size #- including one less sector for start due to a capacity to increase the adjustement by #- one. my ($primaryOrExtended, $migrate_files); my $type_name = fs::type::part2type_name($part); my $mb_size = to_Mb($part->{size}); my $has_startsector = ($::expert || arch() !~ /i.86/) && !isLVM($hd); my $use_dmcrypt; my $requested_type; $in->ask_from(N("Create a new partition"), '', [ { label => N("Create a new partition"), title => 1 }, if_($has_startsector, { label => N("Start sector: "), val => \$part->{start}, min => $def_start, max => ($max - min_partition_size($hd)), type => 'range', SpinButton => $::expert, changed => sub { $mb_size = min($mb_size, to_Mb($max - $part->{start})) } }, ), { label => N("Size in MB: "), val => \$mb_size, min => to_Mb(min_partition_size($hd)), max => to_Mb($def_size), type => 'range', SpinButton => $::expert, changed => sub { $part->{start} = min($part->{start}, $max - $mb_size * 2048) } }, { label => N("Filesystem type: "), val => \$type_name, list => [ fs::type::type_names($::expert, $hd) ], sort => 0, if_($::expert, gtk => { wrap_width => 2 }, do_not_ellipsize => 1) }, { label => N("Mount point: "), val => \$part->{mntpoint}, list => [ fsedit::suggestions_mntpoint($all_hds), '' ], if_(isLVM($hd), changed => sub { undef $part->{lv_name}; lvm::suggest_lv_name($hd, $part); }), type => 'combo', not_edit => 0, disabled => sub { my $p = fs::type::type_name2subpart($type_name); isSwap($p) || isNonMountable($p) }, type => 'combo', not_edit => 0, }, if_($::expert && $hd->hasExtended, { label => N("Preference: "), val => \$primaryOrExtended, list => [ '', "Extended", "Primary", if_($::expert, "Extended_0x85") ] }, ), if_(isLVM($hd), { label => N("Logical volume name "), val => \$part->{lv_name}, list => [ qw(root swap usr home var), '' ], sort => 0, not_edit => 0 }, ), { label => N("Encrypt partition"), type => 'bool', val => \$use_dmcrypt, disabled => sub { $part->{mntpoint} eq "/boot" } }, { label => N("Encryption key "), val => \$part->{dmcrypt_key}, disabled => sub { !$use_dmcrypt }, hidden => 1, weakness_check => 1 }, { label => N("Encryption key (again)"), val => \$part->{dmcrypt_key2}, disabled => sub { !$use_dmcrypt }, hidden => 1 }, ], complete => sub { $part->{size} = from_Mb($mb_size, min_partition_size($hd), $max - $part->{start}); #- need this to be able to get back the approximation of using MB $do_suggest_mount_point = 0 if !$part->{mntpoint}; put_in_hash($part, fs::type::type_name2subpart($type_name)); $part->{mntpoint} = '' if isNonMountable($part); $part->{mntpoint} = 'swap' if isSwap($part); fs::mount_options::set_default($part, ignore_is_removable => 1); # if user asked to encrypt the partition, use dm-crypt and create requested fs inside if ($use_dmcrypt) { my $err; $err = N("The encryption keys do not match") unless $part->{dmcrypt_key} eq $part->{dmcrypt_key2}; $err = N("Missing encryption key") unless $part->{dmcrypt_key}; if ($err) { $in->ask_warn(N("Error"), $err); return 1; } $requested_type = $type_name; $type_name = 'Encrypted'; } put_in_hash($part, fs::type::type_name2subpart($type_name)); check($in, $hd, $part, $all_hds) or return 1; $migrate_files = need_migration($in, $part->{mntpoint}) or return 1; my $seen; eval { catch_cdie { fsedit::add($hd, $part, $all_hds, { force => 1, primaryOrExtended => $primaryOrExtended }) } sub { $seen = 1; $in->ask_okcancel('', formatError($@)) }; }; if (my $err = $@) { if ($err =~ /raw_add/ && $hd->hasExtended && !$hd->{primary}{extended}) { $in->ask_warn(N("Error"), N("You cannot create a new partition (since you reached the maximal number of primary partitions). First remove a primary partition and create an extended partition.")); return 0; } else { $in->ask_warn(N("Error"), formatError($err)) if !$seen; return 1; } } 0; }, ) or return; if ($use_dmcrypt) { write_partitions($in, $hd) or return; # Initialize it and format it dmcrypt_format($in, $hd, $part, $all_hds); my $p = find { $part->{dm_name} eq $_->{dmcrypt_name} } @{$all_hds->{dmcrypts}}; my $p2 = fs::type::type_name2subpart($requested_type); $p->{fs_type} = $p2->{fs_type}; $p->{type_name} = $requested_type; $p->{mntpoint} = $part->{mntpoint}; $part->{mntpoint} = ''; if ($::isStandalone) { fs::format::check_package_is_installed_format($in->do_pkgs, $p->{fs_type}) or log::l("Missing package"); } _format_raw($in, $p, $all_hds, isRawLVM($p)); } warn_if_renumbered($in, $hd); if ($migrate_files eq 'migrate') { # FIXME check encrypt case format_($in, $hd, $part, $all_hds) or return; migrate_files($in, $hd, $part); fs::mount::part($part); } } sub Delete { my ($in, $hd, $part, $all_hds) = @_; if (fs::type::isLUKS($part)) { my $p = find { $_->{dm_name} eq $part->{dmcrypt_name} } partition_table::get_normal_parts($hd); RemoveFromDm($in, $hd, $p, $all_hds); $part = $p; } if (isRAID($part)) { raid::delete($all_hds->{raids}, $part); } elsif (isLVM($hd)) { lvm::lv_delete($hd, $part); } elsif (isLoopback($part)) { my $f = "$part->{loopback_device}{mntpoint}$part->{loopback_file}"; if (-e $f && $in->ask_yesorno(N("Warning"), N("Remove the loopback file?"))) { unlink $f; } my $l = $part->{loopback_device}{loopback}; @$l = grep { $_ != $part } @$l; delete $part->{loopback_device}{loopback} if @$l == 0; fsedit::recompute_loopbacks($all_hds); } else { partition_table::remove($hd, $part); warn_if_renumbered($in, $hd); } } sub Type { my ($in, $hd, $part) = @_; my $warned; my $warn = sub { $warned = 1; if (maybeFormatted($part)) { ask_alldatawillbelost($in, $part, N_("After changing type of partition %s, all data on this partition will be lost")); } else { 1; } }; #- for ext2/ext3, warn after choosing as ext2->ext3 and ext*->ext4 can be achieved without loosing any data :) member($part->{fs_type}, qw(ext2 ext3)) || $part->{fs_type} =~ /ntfs/ or $warn->() or return; my @types = fs::type::type_names($::expert, $hd); #- when readonly, Type() is allowed only when changing {fs_type} but not {pt_type} #- eg: switching between ext2, ext3, ext4, reiserfs... @types = grep { fs::type::type_name2pt_type($_) == $part->{pt_type} } @types if $hd->{readonly}; my $type_name = fs::type::part2type_name($part); $in->ask_from_({ title => N("Change partition type") }, [ { label => N("Which filesystem do you want?"), title => 1 }, { label => N("Type"), val => \$type_name, type => 'list', list => \@types, sort => 1, do_not_ellipsize => 1, focus => sub { 1 }, not_edit => 1, gtk => { wrap_width => 2 } } ]) or return; my $type = $type_name && fs::type::type_name2subpart($type_name); if ($part->{fs_type} eq 'ext2' && $type->{fs_type} eq 'ext3') { my $_w = $in->wait_message(N("Please wait"), N("Switching from %s to %s", 'ext2', $type->{fs_type})); if (run_program::run("tune2fs", "-j", devices::make($part->{device}))) { put_in_hash($part, $type); set_isFormatted($part, 1); #- assume that if tune2fs works, partition is formatted #- disable the fsck (do not do it together with -j in case -j fails?) fs::format::disable_forced_fsck($part->{device}); return; } } elsif (member($part->{fs_type}, qw(ext2 ext3)) && $type->{fs_type} eq 'ext4') { # FIXME enable some nice flags put_in_hash($part, $type); return; } elsif ($type->{fs_type} =~ /ntfs/ && $part->{fs_type} =~ /ntfs/) { if ($type->{fs_type} eq 'ntfs-3g') { local $::prefix = ''; # For draklive-install $in->do_pkgs->ensure_binary_is_installed('ntfs-3g', 'mount.ntfs-3g') or return; } put_in_hash($part, $type); return; } #- either we switch to non-ext3 or switching losslessly to ext3 failed $warned or $warn->() or return; if (defined $type) { check_type($in, $type, $hd, $part) and fsedit::change_type($type, $hd, $part); } } sub Label { my ($in, $hd, $part) = @_; my $new_label = $part->{device_LABEL} || ""; write_partitions($in, $hd) or return; $in->ask_from(N("Set volume label"), maybeFormatted($part) ? N("Beware, this will be written to disk as soon as you validate!") : N("Beware, this will be written to disk only after formatting!"), [ { label => N("Which volume label?"), title => 1 }, { label => N("Label:"), val => \$new_label } ]) or return; fs::format::check_package_is_installed_label($in->do_pkgs, $part->{fs_type}) or return; $part->{prefer_device_LABEL} = to_bool($part->{device_LABEL}) && !isLVM($part); return if $new_label eq $part->{device_LABEL}; $part->{device_LABEL} = $new_label; $part->{device_LABEL_changed} = 1; fs::format::clean_label($part); fs::format::write_label($part); } sub Mount_point { my ($in, $hd, $part, $all_hds) = @_; my $migrate_files; my $mntpoint = $part->{mntpoint} || do { my $part_ = { %$part }; if (fsedit::suggest_part($part_, $all_hds)) { fs::get::has_mntpoint('/', $all_hds) || $part_->{mntpoint} eq '/boot' ? $part_->{mntpoint} : '/'; } else { '' } }; my $msg = isLoopback($part) ? N("Where do you want to mount the loopback file %s?", $part->{loopback_file}) : N("Where do you want to mount device %s?", $part->{device}); $in->ask_from_({ callbacks => { complete => sub { !isPartOfLoopback($part) || $mntpoint or $in->ask_warn(N("Error"), N("Cannot unset mount point as this partition is used for loop back. Remove the loopback first")), return 1; $part->{mntpoint} eq $mntpoint || check_mntpoint($in, $mntpoint, $part, $all_hds) or return 1; $migrate_files = need_migration($in, $mntpoint) or return 1; 0; } }, }, [ { label => $msg, title => 1 }, { label => N("Mount point"), val => \$mntpoint, list => [ uniq(if_($mntpoint, $mntpoint), fsedit::suggestions_mntpoint($all_hds), '') ], focus => sub { 1 }, not_edit => 0 } ], ) or return; $part->{mntpoint} = $mntpoint; if ($migrate_files eq 'migrate') { format_($in, $hd, $part, $all_hds) or return; migrate_files($in, $hd, $part); fs::mount::part($part); } } sub Mount_point_raw_hd { my ($in, $part, $all_hds, @propositions) = @_; my $mntpoint = $part->{mntpoint} || shift @propositions; $in->ask_from( N("Mount point"), '', [ { label => N("Where do you want to mount %s?", $part->{device}), title => 1 }, { label => N("Mount point"), val => \$mntpoint, list => [ if_($mntpoint, $mntpoint), '', @propositions ], not_edit => 0 } ], complete => sub { $part->{mntpoint} eq $mntpoint || check_mntpoint($in, $mntpoint, $part, $all_hds) or return 1; 0; } ) or return; $part->{mntpoint} = $mntpoint; } sub Resize { my ($in, $hd, $part) = @_; my (%nice_resize); my $low_part = $part; if (isLUKS($part)) { $low_part = find { $_->{dm_name} eq $part->{dmcrypt_name} } partition_table::get_normal_parts($hd); } my ($min, $max) = (min_partition_size($hd), max_partition_resize($hd, $low_part)); if (maybeFormatted($part)) { # here we may have a non-formatted or a formatted partition # -> doing as if it was formatted if ($part->{fs_type} eq 'vfat') { write_partitions($in, $hd) or return; #- try to resize without losing data my $_w = $in->wait_message(N("Resizing"), N("Computing FAT filesystem bounds")); require resize_fat::main; $nice_resize{fat} = resize_fat::main->new($part->{device}, devices::make($part->{device})); $min = max($min, $nice_resize{fat}->min_size); $max = min($max, $nice_resize{fat}->max_size); } elsif (member($part->{fs_type}, qw(ext2 ext3 ext4))) { write_partitions($in, $hd) or return; require diskdrake::resize_ext2; if ($nice_resize{ext2} = diskdrake::resize_ext2->new($part->{device}, devices::make($part->{device}))) { $min = max($min, $nice_resize{ext2}->min_size); } else { delete $nice_resize{ext2}; } } elsif ($part->{fs_type} =~ /ntfs/) { write_partitions($in, $hd) or return; require diskdrake::resize_ntfs; diskdrake::resize_ntfs::check_prog($in) or return; $nice_resize{ntfs} = diskdrake::resize_ntfs->new($part->{device}, devices::make($part->{device})); $min = $nice_resize{ntfs}->min_size or delete $nice_resize{ntfs}; } elsif ($part->{fs_type} eq 'reiserfs') { write_partitions($in, $hd) or return; if ($part->{isMounted}) { $nice_resize{reiserfs} = 1; $min = $part->{size}; #- ensure the user can only increase } elsif (defined(my $free = fs::df($part))) { $nice_resize{reiserfs} = 1; $min = max($min, $part->{size} - $free); } } elsif ($part->{fs_type} eq 'xfs' && isLVM($hd) && $::isStandalone && $part->{isMounted}) { $min = $part->{size}; #- ensure the user can only increase $nice_resize{xfs} = 1; } elsif ($part->{fs_type} eq 'btrfs') { write_partitions($in, $hd) or return; if (defined(my $free = fs::df($part))) { $nice_resize{btrfs} = 1; $min = max($min, $part->{size} - $free); } } #- make sure that even after normalizing the size to cylinder boundaries, the minimun will be saved, #- this save at least a cylinder (less than 8Mb). $min += partition_table::raw::cylinder_size($hd); $min >= $max and return $in->ask_warn(N("Warning"), N("This partition is not resizeable")); #- for these, we have tools to resize partition table #- without losing data (or at least we hope so :-) if (%nice_resize) { ask_alldatamaybelost($in, $part, N_("All data on this partition should be backed up")) or return; } else { ask_alldatawillbelost($in, $part, N_("After resizing partition %s, all data on this partition will be lost")) or return; } } my $mb_size = to_Mb($part->{size}); my ($gmin, $gmax) = (to_Mb($min), to_Mb($max)); $in->ask_from(N("Resize"), '', [ { label => N("Choose the new size"), title => 1 }, { label => N("New size in MB: "), val => \$mb_size, min => $gmin, max => $gmax, type => 'range', SpinButton => $::expert }, { label => N("Minimum size: %s MB", $gmin) }, { label => N("Maximum size: %s MB", $gmax) }, ]) or return; my $size = from_Mb($mb_size, $min, $max); $part->{size} == $size and return; my $oldsize = $part->{size}; $low_part->{size} = $part->{size} = $size; $hd->adjustEnd($low_part); undef $@; my $_b = before_leaving { $@ and $part->{size} = $oldsize }; my $adjust = sub { my ($write_partitions) = @_; if (isLVM($hd)) { lvm::lv_resize($low_part, $oldsize); } else { if ($write_partitions && isLUKS($part)) { run_program::run('cryptsetup', 'luksClose', $part->{dmcrypt_name}) or die("Failed to resize partition, maybe it is mounted"); } partition_table::will_tell_kernel($hd, resize => $low_part); partition_table::adjust_local_extended($hd, $low_part); partition_table::adjust_main_extended($hd); write_partitions($in, $hd) or return if $write_partitions && %nice_resize; if ($write_partitions && isLUKS($part)) { require fs::dmcrypt; fs::dmcrypt::open_part([], $low_part); } } 1; }; $adjust->(1) or return if $size > $oldsize; my $wait = $in->wait_message(N("Please wait"), N("Resizing")); if ($nice_resize{fat}) { local *log::l = sub { $wait->set(join(' ', @_)) }; $nice_resize{fat}->resize($part->{size}); } elsif ($nice_resize{ext2}) { $nice_resize{ext2}->resize($part->{size}); } elsif ($nice_resize{ntfs}) { log::l("ntfs resize to $part->{size} sectors"); $nice_resize{ntfs}->resize($part->{size}); $wait = undef; $in->ask_warn(N("Warning"), N("To ensure data integrity after resizing the partition(s), filesystem checks will be run on your next boot into Microsoft Windows®")); } elsif ($nice_resize{reiserfs}) { log::l("reiser resize to $part->{size} sectors"); run_program::run_or_die('resize_reiserfs', '-f', '-q', '-s' . int($part->{size}/2) . 'K', devices::make($part->{device})); } elsif ($nice_resize{xfs}) { #- happens only with mounted LVM, see above run_program::run_or_die("xfs_growfs", $part->{mntpoint}); } elsif ($nice_resize{btrfs}) { my $dir = "/tmp/tmp_resize_btrfs.$$"; if ($part->{isMounted}) { $dir = ($::prefix || '') . $part->{mntpoint}; } else { mkdir_p($dir);