Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.

Moved Get_Folder_Size to this new class.

Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
This commit is contained in:
bigbiff bigbiff
2013-12-01 21:03:45 -05:00
committed by Dees Troy
parent 4d132cabf4
commit 34684ff313
11 changed files with 220 additions and 72 deletions
+14 -13
View File
@@ -1,19 +1,18 @@
/*
Copyright 2013 bigbiff/Dees_Troy TeamWin
This file is part of TWRP/TeamWin Recovery Project.
TWRP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ccdd
TWRP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
TWRP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
TWRP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TWRP. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with TWRP. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
@@ -45,6 +44,7 @@ extern "C" {
#include "partitions.hpp"
#include "openrecoveryscript.hpp"
#include "variables.h"
#include "twrpDU.hpp"
#ifdef HAVE_SELINUX
#include "selinux/label.h"
@@ -53,6 +53,7 @@ struct selabel_handle *selinux_handle;
TWPartitionManager PartitionManager;
int Log_Offset;
twrpDU du;
static void Print_Prop(const char *key, const char *name, void *cookie) {
printf("%s=%s\n", key, name);
@@ -124,7 +125,7 @@ int main(int argc, char **argv) {
char *contexts = NULL;
lgetfilecon("/sbin/teamwin", &contexts);
if (!contexts) {
gui_print("Kernel does not have support for reading SELinux contexts.\n");
gui_print("Kernel does not have support for reading SELinux contexts.\n");
} else {
free(contexts);
gui_print("Full SELinux support is present.\n");