aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 22:49:33 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 22:49:33 +0200
commitd039f56af00fb98b2b03f54f00ce4bb1436e9932 (patch)
treeede844c40fdf84f9c4c3be19004413418ac98b94 /phpBB/includes
parent50f4bea6101f64c513b3918ade58a712b00f3df7 (diff)
downloadforums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.gz
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.bz2
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.xz
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.zip
[ticket/12387] Use the hash as query_id for caching
PHPBB3-12387
Diffstat (limited to 'phpBB/includes')
0 files changed, 0 insertions, 0 deletions
#n9'>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
#!/usr/bin/perl
#
# Guillaume Cottenceau
#
# Copyright 2001-2005 Mandriva
#
# This software may be freely redistributed under the terms of the GNU
# public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

use lib qw(../perl-install /usr/lib/libDrakX);
use common;
use fs;
use fs::proc_partitions;


my @proc_mounts = fs::read_fstab('', '/proc/mounts');

my $target = '/mnt';

if (fs::get::mntpoint2part($target, \@proc_mounts)) {
    print STDERR "$target is already mounted (according to /proc/mounts)\n";
    exit 0;
}

system('drvinst', 'STORAGE');

print STDERR "\nPlease wait, trying to find your root device...\n";

mkdir_p($target);

my @fstab;
my $root;

foreach (fs::proc_partitions::read_raw()) {
    my $dev = devices::make($_->{dev});

    my $fs = find {
	system("mount -t $_ $dev $target 2>/dev/null") == 0;
    } fs::type::true_local_fs_types() or next;

    if (my $release_file = common::release_file($target)) {
	print STDERR "=> found a Mandriva Linux root partition on $dev\n=> type $fs, version `",
	  chomp_(cat_("$target$release_file")), "'\n";
	@fstab = fs::read_fstab($target, '/etc/fstab');
	$root = $dev;
	last;
    } else {
	system('umount', $target) == 0 or die "error unmounting $target\n";
    }
}

if ($root) {
    print STDERR "\nMounting other partitions from fstab on $target...\n";
    foreach (@fstab) {
	my ($valued_options, $options) = fs::mount_options::unpack($_);

	next if 
	  !$_->{fs_type} || $_->{device} eq 'none'
	    || $valued_options->{noauto} || $valued_options->{supermount} 
	    || $_->{mntpoint} eq '/'
	    || member($_->{fs_type}, 'swap', 'nfs', 'ntfs');

	delete $valued_options->{'iocharset='};
	delete $valued_options->{'codepage='};
	fs::mount_options::pack($_, $valued_options, $options); #- vfat opts, we don't have the modules in rescue

	my $where = "$target$_->{mntpoint}";
	mkdir_p($where);
	print STDERR "\t$_->{device} on $where type $_->{fs_type} options $_->{options}\n";
	system("mount -t $_->{fs_type} /dev/$_->{device} $where -o $_->{options}");
	system("cp -f /etc/mtab $target/etc/mtab"); #- to allow a nice chrooted "mount" or "df"
    }
    print STDERR "\nYour system is ready on $target.\n\n";
} else {
    die "Could not find your root device :-(.\n";
}