aboutsummaryrefslogtreecommitdiffstats
path: root/find-lang.pl
Commit message (Expand)AuthorAgeFilesLines
* - properly fix mga #3697 in find-lang.pl (only exclude man directories)1.171David Walser2013-04-061-2/+2
* revert svn 7582 b/c it introduces a regression when --with-man1.170Luc Menut2013-04-041-1/+0
* find-lang.pl : do not own man lang directories with --with-man1.168Luc Menut2013-03-171-0/+1
* simplify using the regexpThierry Vignaud2012-10-231-2/+1
* simplify callsThierry Vignaud2012-10-231-18/+6
* simplify returnsThierry Vignaud2012-10-231-21/+7
* use shift without ()Thierry Vignaud2012-10-231-2/+2
* use pop with ()Thierry Vignaud2012-10-231-1/+1
* (parent_to_own) fix indentationThierry Vignaud2012-10-231-11/+11
* perl_checker cleanupsThierry Vignaud2012-10-231-21/+20
* fix typo noticed by kamil (#3697)Nicolas Vigier2011-12-111-1/+1
* 1.144: Add support for fdo /usr/share/help when find_lang1.144Funda Wang2011-09-191-0/+9
* Synthesized commit during git-svn import combining previous Mandriva history ...Mageia SVN-Git Migration2011-01-061-1/+1
* 1.82: find-lang.pl: do not own /usr/share/locales/$lang/LC_MESSAGES to speed-...1.82Pascal Rigaux2008-06-231-2/+7
* Handle symlinks the same way as files in find-lang.pl, some symlinks inAnssi Hannula2007-09-201-1/+1
* - include file be file except with --all-nameOlivier Thauvin2007-09-051-18/+47
* - only own parent dir and let rpm find contentOlivier Thauvin2007-08-241-12/+13
* - add basic test runtime for find-langOlivier Thauvin2007-08-231-1/+1
* - tag directory, fix directory tag setOlivier Thauvin2007-08-231-2/+3
* - tag %dir with %lang againOlivier Thauvin2007-08-231-1/+1
* - dont tag C langOlivier Thauvin2007-08-231-8/+7
* - tagging all files one by one, as rpm seems to not include content of dir ha...Olivier Thauvin2007-08-221-21/+24
* - fix second part of #32366Olivier Thauvin2007-08-211-3/+3
* - when a file/dir is owned by multiple language, we assume it should be alway...Olivier Thauvin2007-08-211-4/+22
* - 1.461.46Olivier Thauvin2007-07-051-0/+1
* - man page are compress after install step, taking care to filename to handle...Olivier Thauvin2007-06-251-4/+4
* - fix perl path in shebangOlivier Thauvin2007-06-251-1/+1
* - perlchecker fix to please titiOlivier Thauvin2007-06-251-2/+2
* - allow to pass multiple name to findOlivier Thauvin2007-06-251-2/+4
* - manage man page tooOlivier Thauvin2007-06-251-1/+10
* - clean useless codeOlivier Thauvin2007-06-251-5/+0
* - rewrite find-langOlivier Thauvin2007-05-191-0/+84
apos;, noexec => 'exec', nosuid => 'suid', user_xattr => 'nouser_xattr', ); my @user_implies = qw(noexec nodev nosuid); \%non_defaults, \@user_implies; } sub unpack { my ($part) = @_; my $packed_options = $part->{options}; my ($non_defaults, $user_implies) = list(); my @auto_fs = fs::type::guessed_by_mount(); my %per_fs = ( iso9660 => [ qw(unhide) ], vfat => [ qw(flush umask=0 umask=0022) ], ntfs => [ qw(umask=0 umask=0022) ], nfs => [ qw(rsize=8192 wsize=8192) ], smbfs => [ qw(username= password=) ], davfs2 => [ qw(username= password= uid= gid=) ], reiserfs => [ 'notail' ], ); push @{$per_fs{$_}}, 'usrquota', 'grpquota' foreach 'ext2', 'ext3', 'xfs'; while (my ($fs, $l) = each %per_fs) { $part->{fs_type} eq $fs || $part->{fs_type} eq 'auto' && member($fs, @auto_fs) or next; $non_defaults->{$_} = 1 foreach @$l; } $non_defaults->{relatime} = 1 if isTrueLocalFS($part); $non_defaults->{encrypted} = 1; my $defaults = { reverse %$non_defaults }; my %options = map { $_ => '' } keys %$non_defaults; my @unknown; foreach (split(",", $packed_options)) { if ($_ eq 'defaults') { #- skip } elsif (member($_, 'user', 'users')) { $options{$_} = 1 foreach $_, @$user_implies; } elsif (exists $non_defaults->{$_}) { $options{$_} = 1; } elsif ($defaults->{$_}) { $options{$defaults->{$_}} = 0; } elsif (/(.*?=)(.*)/) { $options{$1} = $2; } else { push @unknown, $_; } } # merge those, for cleaner help $options{'rsize=8192,wsize=8192'} = delete $options{'rsize=8192'} && delete $options{'wsize=8192'} if exists $options{'rsize=8192'}; my $unknown = join(",", @unknown); \%options, $unknown; } sub pack_ { my ($_part, $options, $unknown) = @_; my ($non_defaults, $user_implies) = list(); my @l; my @umasks = map { if (/^umask=/) { my $v = delete $options->{$_}; /^umask=(.+)/ ? if_($v, $1) : $v; } else { () } } keys %$options; if (@umasks) { push @l, 'umask=' . min(@umasks); } if (my $user = find { delete $options->{$_} } 'users', 'user') { push @l, $user; delete $options->{user}; foreach (@$user_implies) { if (!delete $options->{$_}) { # overriding $options->{$non_defaults->{$_}} = 1; } } } push @l, map_each { if_($::b, $::a =~ /=$/ ? "$::a$::b" : $::a) } %$options; push @l, $unknown; join(",", uniq(grep { $_ } @l)); } sub pack { my ($part, $options, $unknown) = @_; $part->{options} = pack_($part, $options, $unknown) || 'defaults'; noreturn(); } # update me on each util-linux new release: sub help() { ( 'encrypted' => N("Use an encrypted file system"), 'flush' => N("Flush write cache on file close"), 'grpquota' => N("Enable group disk quota accounting and optionally enforce limits"), 'noatime' => N("Do not update inode access times on this file system (e.g, for faster access on the news spool to speed up news servers)."), 'relatime' => N("Update inode access times on this filesystem in a more efficient way (e.g, for faster access on the news spool to speed up news servers)."), 'noauto' => N("Can only be mounted explicitly (i.e., the -a option will not cause the file system to be mounted)."), 'nodev' => N("Do not interpret character or block special devices on the file system."), 'noexec' => N("Do not allow execution of any binaries on the mounted file system. This option might be useful for a server that has file systems containing binaries for architectures other than its own."), 'nosuid' => N("Do not allow set-user-identifier or set-group-identifier bits to take effect. (This seems safe, but is in fact rather unsafe if you have suidperl(1) installed.)"), 'ro' => N("Mount the file system read-only."), 'sync' => N("All I/O to the file system should be done synchronously."), 'users' => N("Allow every user to mount and umount the file system."), 'user' => N("Allow an ordinary user to mount the file system."), 'usrquota' => N("Enable user disk quota accounting, and optionally enforce limits"), 'user_xattr' => N("Support \"user.\" extended attributes"), 'umask=0' => N("Give write access to ordinary users"), 'umask=0022' => N("Give read-only access to ordinary users"), ); } sub rationalize { my ($part) = @_; my ($options, $unknown) = &unpack($part); if ($part->{fs_type} ne 'reiserfs') { $options->{notail} = 0; } if (!fs::type::can_be_one_of_those_fs_types($part, 'vfat', 'smbfs', 'iso9660', 'udf')) { delete $options->{'codepage='}; } if (member($part->{mntpoint}, fs::type::directories_needed_to_boot())) { foreach (qw(users user noauto)) { if ($options->{$_}) { $options->{$_} = 0; $options->{$_} = 0 foreach qw(nodev noexec nosuid); } } } &pack($part, $options, $unknown); } sub set_default { my ($part, %opts) = @_; #- opts are: security iocharset codepage ignore_is_removable my ($options, $unknown) = &unpack($part); if (!$opts{ignore_is_removable} && $part->{is_removable} && !member($part->{mntpoint}, fs::type::directories_needed_to_boot()) && (!$part->{fs_type} || $part->{fs_type} eq 'auto' || $part->{fs_type} =~ /:/)) { $options->{supermount} = 0; #- always disable supermount $part->{fs_type} = 'auto'; $options->{flush} = 1 if $part->{media_type} ne 'cdrom'; } if ($part->{media_type} eq 'cdrom') { $options->{ro} = 1; }