diff options
author | Phil Davis <phil.davis@world.inf.org> | 2012-07-31 14:47:30 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@world.inf.org> | 2012-07-31 14:47:30 +0545 |
commit | a70cdb7364194e825b0d6a3a927f7f5c6bab376e (patch) | |
tree | d29a6cb86d303a22065ac00731fbe69fbc285fab /etc | |
parent | 41454a132fcd7f6bd8c4f0a831a24bce21a6d59c (diff) | |
download | pfsense-a70cdb7364194e825b0d6a3a927f7f5c6bab376e.zip pfsense-a70cdb7364194e825b0d6a3a927f7f5c6bab376e.tar.gz |
Don't conf_mount_rw every time packages are listed
Every time System:Packages is selected, the code does a conf_mount_rw, checks for existence of some dirs, then does conf_mount_ro. This makes navigating the package install GUI slow on nanobsd, and it is not needed.
Do is_dir checks first, then conf_mount_rw only if they need to be created. The is_dir function works fine on a read-only filesystem.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 8ed44aa..7e1a718 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -8,7 +8,7 @@ * $Id$ ****** * - * Copyright (C) 2010 Ermal Lu�i + * Copyright (C) 2010 Ermal Luci * Copyright (C) 2005-2006 Colin Smith (ethethlay@gmail.com) * All rights reserved. * Redistribution and use in source and binary forms, with or without @@ -81,12 +81,12 @@ $vardb = "/var/db/pkg"; safe_mkdir($vardb); $g['platform'] = trim(file_get_contents("/etc/platform")); -conf_mount_rw(); if(!is_dir("/usr/local/pkg") or !is_dir("/usr/local/pkg/pf")) { + conf_mount_rw(); safe_mkdir("/usr/local/pkg"); safe_mkdir("/usr/local/pkg/pf"); + conf_mount_ro(); } -conf_mount_ro(); /****f* pkg-utils/remove_package * NAME |