diff --git a/extract-files.sh b/extract-files.sh index 437e356..21a45cf 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,12 +1,13 @@ #!/bin/bash # # Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -20,7 +21,7 @@ set -e DEVICE=land VENDOR=xiaomi -# Load extractutils and do some sanity checks +# Load extract_utils and do some sanity checks MY_DIR="${BASH_SOURCE%/*}" if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi @@ -33,25 +34,31 @@ if [ ! -f "$HELPER" ]; then fi . "$HELPER" -if [ $# -eq 0 ]; then - SRC=adb -else - if [ $# -eq 1 ]; then - SRC=$1 - else - echo "$0: bad number of arguments" - echo "" - echo "usage: $0 [PATH_TO_EXPANDED_ROM]" - echo "" - echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from" - echo "the device using adb pull." - exit 1 - fi +# default to not sanitizing the vendor folder before extraction +clean_vendor=false + +while [ "$1" != "" ]; do + case $1 in + -p | --path ) shift + SRC=$1 + ;; + -s | --section ) shift + SECTION=$1 + clean_vendor=false + ;; + -c | --clean-vendor ) clean_vendor=true + ;; + esac + shift +done + +if [ -z "$SRC" ]; then + SRC=adb fi # Initialize the helper -setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" +setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false $clean_vendor -extract "$MY_DIR"/proprietary-files.txt "$SRC" +extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION" "$MY_DIR"/setup-makefiles.sh diff --git a/setup-makefiles.sh b/setup-makefiles.sh index b3e5af5..98ff49d 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,12 +1,13 @@ #!/bin/bash # # Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -17,11 +18,12 @@ set -e -# Required! DEVICE=land VENDOR=xiaomi -# Load extractutils and do some sanity checks +INITIAL_COPYRIGHT_YEAR=2016 + +# Load extract_utils and do some sanity checks MY_DIR="${BASH_SOURCE%/*}" if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi @@ -40,8 +42,7 @@ setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" # Copyright headers and guards write_headers -# The standard blobs write_makefiles "$MY_DIR"/proprietary-files.txt -# We are done! +# Finish write_footers