diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-05 15:10:31 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-06 12:15:24 +0200 |
commit | af08db027b6214306683c8cbf9980798c5f85977 (patch) | |
tree | 97211afd7b11bace6ce508984d110ddf10dc41f2 /prebuilt/common/bin/backuptool.functions | |
parent | dc5051ce0272ddb572aaa72ecd0e1d00ad9b0f83 (diff) | |
download | external_wget-replicant-11.tar.gz external_wget-replicant-11.tar.bz2 external_wget-replicant-11.zip |
This way:
- We can rebase more easily if needed
- We don't have to bring in the other part of vendor/lineage that
is potentially incompatible with what we have
wget was also moved in the top directory along the way.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'prebuilt/common/bin/backuptool.functions')
-rw-r--r-- | prebuilt/common/bin/backuptool.functions | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/prebuilt/common/bin/backuptool.functions b/prebuilt/common/bin/backuptool.functions deleted file mode 100644 index 4319b783..00000000 --- a/prebuilt/common/bin/backuptool.functions +++ /dev/null @@ -1,43 +0,0 @@ -#!/sbin/sh -# -# Functions for backuptool.sh -# - -copy_file() { - cp -dp "$1" "$2" - # symlinks don't have a context - if [ ! -L "$1" ]; then - # it is assumed that every label starts with 'u:object_r' and has no white-spaces - local context=`ls -Z "$1" | grep -o 'u:object_r:[^ ]*' | head -1` - chcon "$context" "$2" - fi -} - -backup_file() { - if [ -e "$1" -o -L "$1" ]; then - local F=`basename "$1"` - local D=`dirname "$1"` - # dont backup any apps that have odex files, they are useless - if ( echo "$F" | grep -q "\.apk$" ) && [ -e `echo "$1" | sed -e 's/\.apk$/\.odex/'` ]; then - echo "Skipping odexed apk $1"; - else - mkdir -p "$C/$D" - copy_file "$1" "$C/$D/$F" - fi - fi -} - -restore_file() { - local FILE=`basename "$1"` - local DIR=`dirname "$1"` - if [ -e "$C/$DIR/$FILE" -o -L "$C/$DIR/$FILE" ]; then - if [ ! -d "$DIR" ]; then - mkdir -p "$DIR"; - fi - copy_file "$C/$DIR/$FILE" "$1"; - if [ -n "$2" ]; then - echo "Deleting obsolete file $2" - rm "$2"; - fi - fi -} |