Blissify Initial

Signed-off-by: Jackeagle <jackeagle102@gmail.com>
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index cdec959..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,14 +0,0 @@
-   Copyright 2011-15 The CyanogenMod Project
-             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
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/README.mkdn b/README.mkdn
deleted file mode 100644
index cda44d8..0000000
--- a/README.mkdn
+++ /dev/null
@@ -1,37 +0,0 @@
-LineageOS
-===========
-
-Getting started
----------------
-
-To get started with Android/LineageOS, you'll need to get
-familiar with [Repo](https://source.android.com/source/using-repo.html) and [Version Control with Git](https://source.android.com/source/version-control.html).
-
-To initialize your local repository using the LineageOS trees, use a command like this:
-```
-repo init -u git://github.com/LineageOS/android.git -b lineage-16.0
-```
-Then to sync up:
-```
-repo sync
-```
-Please see the [LineageOS Wiki](https://wiki.lineageos.org/) for building instructions, by device.
-
-
-Submitting patches
-------------------
-Patches are always welcome! Please submit your patches via LineageOS Gerrit!
-
-Simply follow our guide on [how to submit patches](https://wiki.lineageos.org/submitting-patch-howto.html).
-
-To view the status of your and others' patches, visit [LineageOS Gerrit Code Review](https://review.lineageos.org/).
-
-
-Buildbot
---------
-
-All supported devices are built weekly and periodically as changes are committed to ensure the source trees remain buildable.
-
-You can view the current build statuses at [LineageOS Jenkins](https://jenkins.lineageos.org/).
-
-Builds produced weekly by the buildbot can be downloaded from [LineageOS downloads](https://download.lineageos.org/).
diff --git a/addonsu/51-addonsu.sh b/addonsu/51-addonsu.sh
deleted file mode 100644
index f2d200b..0000000
--- a/addonsu/51-addonsu.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/sbin/sh
-#
-# ADDOND_VERSION=2
-#
-
-. /tmp/backuptool.functions
-
-list_files() {
-cat <<EOF
-bin/su
-etc/init/superuser.rc
-xbin/su
-EOF
-}
-
-case "$1" in
-  backup)
-    list_files | while read FILE DUMMY; do
-      backup_file $S/"$FILE"
-    done
-  ;;
-  restore)
-    list_files | while read FILE REPLACEMENT; do
-      R=""
-      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
-      restore_file $S/"$FILE" "$R"
-    done
-  ;;
-  pre-backup)
-    # Stub
-  ;;
-  post-backup)
-    # Stub
-  ;;
-  pre-restore)
-    # Stub
-  ;;
-  post-restore)
-    # Stub
-  ;;
-esac
diff --git a/addonsu/mount-system.sh b/addonsu/mount-system.sh
deleted file mode 100644
index e5cc81c..0000000
--- a/addonsu/mount-system.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/sbin/sh
-
-# Modern devices use /system as root ("/")
-system_as_root=`getprop ro.build.system_root_image`
-if [ "$system_as_root" == "true" ]; then
-  if mount /system_root; then
-    exit 0
-  fi
-
-  active_slot=`getprop ro.boot.slot_suffix`
-  if [ ! -z "$active_slot" ]; then
-    block=/dev/block/bootdevice/by-name/system$active_slot
-  else
-    block=/dev/block/bootdevice/by-name/system
-  fi
-  mkdir -p /system_root
-  if mount -o rw $block /system_root ||
-     mount -o rw $block /system_root -t ext4 ||
-     mount -o rw $block /system_root -t f2fs; then
-    exit 0
-  fi
-else
-  if mount /system; then
-    exit 0
-  fi
-
-  # Try to get the block from /etc/recovery.fstab
-  block=`cat /etc/recovery.fstab | cut -d '#' -f 1 | grep /system | grep -o '/dev/[^ ]*' | head -1`
-  if [ -n "$block" ] && mount $block /system; then
-    exit 0
-  fi
-fi
-
-exit 1
diff --git a/addonsu/unmount-system.sh b/addonsu/unmount-system.sh
deleted file mode 100644
index 19b3431..0000000
--- a/addonsu/unmount-system.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/sbin/sh
-
-# Modern devices use /system as root ("/")
-system_as_root=`getprop ro.build.system_root_image`
-if [ "$system_as_root" == "true" ]; then
-  if umount /system_root; then
-    exit 0
-  fi
-else
-  if umount /system; then
-    exit 0
-  fi
-fi
-
-exit 1
diff --git a/addonsu/updater-script-install b/addonsu/updater-script-install
deleted file mode 100644
index 996023c..0000000
--- a/addonsu/updater-script-install
+++ /dev/null
@@ -1,25 +0,0 @@
-ui_print("Installing su addon...");
-ifelse(is_mounted("/system"), unmount("/system"));
-package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
-package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
-set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
-set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
-run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
-
-if getprop("ro.build.system_root_image") != "true" then
-  package_extract_dir("system", "/system");
-  set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
-  set_metadata("/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
-  set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
-  symlink("/system/xbin/su", "/system/bin/su");
-else
-  package_extract_dir("system", "/system_root/system");
-  set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
-  set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
-  set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
-  symlink("/system/xbin/su", "/system_root/system/bin/su");
-endif;
-
-run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
-ui_print("Done");
-set_progress(1.000000);
diff --git a/addonsu/updater-script-remove b/addonsu/updater-script-remove
deleted file mode 100644
index 6531e55..0000000
--- a/addonsu/updater-script-remove
+++ /dev/null
@@ -1,23 +0,0 @@
-ui_print("Removing su addon...");
-ifelse(is_mounted("/system"), unmount("/system"));
-package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
-package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
-set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
-set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
-run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
-
-if getprop("ro.build.system_root_image") != "true" then
-  delete("/system/addon.d/51-addonsu.sh");
-  delete("/system/bin/su");
-  delete("/system/etc/init/superuser.rc");
-  delete("/system/xbin/su");
-else
-  delete("/system_root/system/addon.d/51-addonsu.sh");
-  delete("/system_root/system/bin/su");
-  delete("/system_root/system/etc/init/superuser.rc");
-  delete("/system_root/system/xbin/su");
-endif;
-
-run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
-ui_print("Done");
-set_progress(1.000000);
diff --git a/bash_completion/git.bash b/bash_completion/git.bash
deleted file mode 100644
index 93eba46..0000000
--- a/bash_completion/git.bash
+++ /dev/null
@@ -1,2766 +0,0 @@
-#!bash
-#
-# bash/zsh completion support for core Git.
-#
-# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
-# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
-# Distributed under the GNU General Public License, version 2.0.
-#
-# The contained completion routines provide support for completing:
-#
-#    *) local and remote branch names
-#    *) local and remote tag names
-#    *) .git/remotes file names
-#    *) git 'subcommands'
-#    *) tree paths within 'ref:path/to/file' expressions
-#    *) file paths within current working directory and index
-#    *) common --long-options
-#
-# To use these routines:
-#
-#    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
-#    2) Add the following line to your .bashrc/.zshrc:
-#        source ~/.git-completion.sh
-#    3) Consider changing your PS1 to also show the current branch,
-#       see git-prompt.sh for details.
-
-case "$COMP_WORDBREAKS" in
-*:*) : great ;;
-*)   COMP_WORDBREAKS="$COMP_WORDBREAKS:"
-esac
-
-# __gitdir accepts 0 or 1 arguments (i.e., location)
-# returns location of .git repo
-__gitdir ()
-{
-	# Note: this function is duplicated in git-prompt.sh
-	# When updating it, make sure you update the other one to match.
-	if [ -z "${1-}" ]; then
-		if [ -n "${__git_dir-}" ]; then
-			echo "$__git_dir"
-		elif [ -n "${GIT_DIR-}" ]; then
-			test -d "${GIT_DIR-}" || return 1
-			echo "$GIT_DIR"
-		elif [ -d .git ]; then
-			echo .git
-		else
-			git rev-parse --git-dir 2>/dev/null
-		fi
-	elif [ -d "$1/.git" ]; then
-		echo "$1/.git"
-	else
-		echo "$1"
-	fi
-}
-
-__gitcomp_1 ()
-{
-	local c IFS=$' \t\n'
-	for c in $1; do
-		c="$c$2"
-		case $c in
-		--*=*|*.) ;;
-		*) c="$c " ;;
-		esac
-		printf '%s\n' "$c"
-	done
-}
-
-# The following function is based on code from:
-#
-#   bash_completion - programmable completion functions for bash 3.2+
-#
-#   Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
-#             © 2009-2010, Bash Completion Maintainers
-#                     <bash-completion-devel@lists.alioth.debian.org>
-#
-#   This program 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 2, or (at your option)
-#   any later version.
-#
-#   This program 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 this program; if not, write to the Free Software Foundation,
-#   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#   The latest version of this software can be obtained here:
-#
-#   http://bash-completion.alioth.debian.org/
-#
-#   RELEASE: 2.x
-
-# This function can be used to access a tokenized list of words
-# on the command line:
-#
-#	__git_reassemble_comp_words_by_ref '=:'
-#	if test "${words_[cword_-1]}" = -w
-#	then
-#		...
-#	fi
-#
-# The argument should be a collection of characters from the list of
-# word completion separators (COMP_WORDBREAKS) to treat as ordinary
-# characters.
-#
-# This is roughly equivalent to going back in time and setting
-# COMP_WORDBREAKS to exclude those characters.  The intent is to
-# make option types like --date=<type> and <rev>:<path> easy to
-# recognize by treating each shell word as a single token.
-#
-# It is best not to set COMP_WORDBREAKS directly because the value is
-# shared with other completion scripts.  By the time the completion
-# function gets called, COMP_WORDS has already been populated so local
-# changes to COMP_WORDBREAKS have no effect.
-#
-# Output: words_, cword_, cur_.
-
-__git_reassemble_comp_words_by_ref()
-{
-	local exclude i j first
-	# Which word separators to exclude?
-	exclude="${1//[^$COMP_WORDBREAKS]}"
-	cword_=$COMP_CWORD
-	if [ -z "$exclude" ]; then
-		words_=("${COMP_WORDS[@]}")
-		return
-	fi
-	# List of word completion separators has shrunk;
-	# re-assemble words to complete.
-	for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do
-		# Append each nonempty word consisting of just
-		# word separator characters to the current word.
-		first=t
-		while
-			[ $i -gt 0 ] &&
-			[ -n "${COMP_WORDS[$i]}" ] &&
-			# word consists of excluded word separators
-			[ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ]
-		do
-			# Attach to the previous token,
-			# unless the previous token is the command name.
-			if [ $j -ge 2 ] && [ -n "$first" ]; then
-				((j--))
-			fi
-			first=
-			words_[$j]=${words_[j]}${COMP_WORDS[i]}
-			if [ $i = $COMP_CWORD ]; then
-				cword_=$j
-			fi
-			if (($i < ${#COMP_WORDS[@]} - 1)); then
-				((i++))
-			else
-				# Done.
-				return
-			fi
-		done
-		words_[$j]=${words_[j]}${COMP_WORDS[i]}
-		if [ $i = $COMP_CWORD ]; then
-			cword_=$j
-		fi
-	done
-}
-
-if ! type _get_comp_words_by_ref >/dev/null 2>&1; then
-_get_comp_words_by_ref ()
-{
-	local exclude cur_ words_ cword_
-	if [ "$1" = "-n" ]; then
-		exclude=$2
-		shift 2
-	fi
-	__git_reassemble_comp_words_by_ref "$exclude"
-	cur_=${words_[cword_]}
-	while [ $# -gt 0 ]; do
-		case "$1" in
-		cur)
-			cur=$cur_
-			;;
-		prev)
-			prev=${words_[$cword_-1]}
-			;;
-		words)
-			words=("${words_[@]}")
-			;;
-		cword)
-			cword=$cword_
-			;;
-		esac
-		shift
-	done
-}
-fi
-
-# Generates completion reply with compgen, appending a space to possible
-# completion words, if necessary.
-# It accepts 1 to 4 arguments:
-# 1: List of possible completion words.
-# 2: A prefix to be added to each possible completion word (optional).
-# 3: Generate possible completion matches for this word (optional).
-# 4: A suffix to be appended to each possible completion word (optional).
-__gitcomp ()
-{
-	local cur_="${3-$cur}"
-
-	case "$cur_" in
-	--*=)
-		COMPREPLY=()
-		;;
-	*)
-		local IFS=$'\n'
-		COMPREPLY=($(compgen -P "${2-}" \
-			-W "$(__gitcomp_1 "${1-}" "${4-}")" \
-			-- "$cur_"))
-		;;
-	esac
-}
-
-# Generates completion reply with compgen from newline-separated possible
-# completion words by appending a space to all of them.
-# It accepts 1 to 4 arguments:
-# 1: List of possible completion words, separated by a single newline.
-# 2: A prefix to be added to each possible completion word (optional).
-# 3: Generate possible completion matches for this word (optional).
-# 4: A suffix to be appended to each possible completion word instead of
-#    the default space (optional).  If specified but empty, nothing is
-#    appended.
-__gitcomp_nl ()
-{
-	local IFS=$'\n'
-	COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
-}
-
-# Generates completion reply with compgen from newline-separated possible
-# completion filenames.
-# It accepts 1 to 3 arguments:
-# 1: List of possible completion filenames, separated by a single newline.
-# 2: A directory prefix to be added to each possible completion filename
-#    (optional).
-# 3: Generate possible completion matches for this word (optional).
-__gitcomp_file ()
-{
-	local IFS=$'\n'
-
-	# XXX does not work when the directory prefix contains a tilde,
-	# since tilde expansion is not applied.
-	# This means that COMPREPLY will be empty and Bash default
-	# completion will be used.
-	COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}"))
-
-	# Tell Bash that compspec generates filenames.
-	compopt -o filenames 2>/dev/null
-}
-
-__git_index_file_list_filter_compat ()
-{
-	local path
-
-	while read -r path; do
-		case "$path" in
-		?*/*) echo "${path%%/*}/" ;;
-		*) echo "$path" ;;
-		esac
-	done
-}
-
-__git_index_file_list_filter_bash ()
-{
-	local path
-
-	while read -r path; do
-		case "$path" in
-		?*/*)
-			# XXX if we append a slash to directory names when using
-			# `compopt -o filenames`, Bash will append another slash.
-			# This is pretty stupid, and this the reason why we have to
-			# define a compatible version for this function.
-			echo "${path%%/*}" ;;
-		*)
-			echo "$path" ;;
-		esac
-	done
-}
-
-# Process path list returned by "ls-files" and "diff-index --name-only"
-# commands, in order to list only file names relative to a specified
-# directory, and append a slash to directory names.
-__git_index_file_list_filter ()
-{
-	# Default to Bash >= 4.x
-	__git_index_file_list_filter_bash
-}
-
-# Execute git ls-files, returning paths relative to the directory
-# specified in the first argument, and using the options specified in
-# the second argument.
-__git_ls_files_helper ()
-{
-	(
-		test -n "${CDPATH+set}" && unset CDPATH
-		# NOTE: $2 is not quoted in order to support multiple options
-		cd "$1" && git ls-files --exclude-standard $2
-	) 2>/dev/null
-}
-
-
-# Execute git diff-index, returning paths relative to the directory
-# specified in the first argument, and using the tree object id
-# specified in the second argument.
-__git_diff_index_helper ()
-{
-	(
-		test -n "${CDPATH+set}" && unset CDPATH
-		cd "$1" && git diff-index --name-only --relative "$2"
-	) 2>/dev/null
-}
-
-# __git_index_files accepts 1 or 2 arguments:
-# 1: Options to pass to ls-files (required).
-#    Supported options are --cached, --modified, --deleted, --others,
-#    and --directory.
-# 2: A directory path (optional).
-#    If provided, only files within the specified directory are listed.
-#    Sub directories are never recursed.  Path must have a trailing
-#    slash.
-__git_index_files ()
-{
-	local dir="$(__gitdir)" root="${2-.}"
-
-	if [ -d "$dir" ]; then
-		__git_ls_files_helper "$root" "$1" | __git_index_file_list_filter |
-			sort | uniq
-	fi
-}
-
-# __git_diff_index_files accepts 1 or 2 arguments:
-# 1) The id of a tree object.
-# 2) A directory path (optional).
-#    If provided, only files within the specified directory are listed.
-#    Sub directories are never recursed.  Path must have a trailing
-#    slash.
-__git_diff_index_files ()
-{
-	local dir="$(__gitdir)" root="${2-.}"
-
-	if [ -d "$dir" ]; then
-		__git_diff_index_helper "$root" "$1" | __git_index_file_list_filter |
-			sort | uniq
-	fi
-}
-
-__git_heads ()
-{
-	local dir="$(__gitdir)"
-	if [ -d "$dir" ]; then
-		git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
-			refs/heads
-		return
-	fi
-}
-
-__git_tags ()
-{
-	local dir="$(__gitdir)"
-	if [ -d "$dir" ]; then
-		git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
-			refs/tags
-		return
-	fi
-}
-
-# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments
-# presence of 2nd argument means use the guess heuristic employed
-# by checkout for tracking branches
-__git_refs ()
-{
-	local i hash dir="$(__gitdir "${1-}")" track="${2-}"
-	local format refs
-	if [ -d "$dir" ]; then
-		case "$cur" in
-		refs|refs/*)
-			format="refname"
-			refs="${cur%/*}"
-			track=""
-			;;
-		*)
-			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
-				if [ -e "$dir/$i" ]; then echo $i; fi
-			done
-			format="refname:short"
-			refs="refs/tags refs/heads refs/remotes"
-			;;
-		esac
-		git --git-dir="$dir" for-each-ref --format="%($format)" \
-			$refs
-		if [ -n "$track" ]; then
-			# employ the heuristic used by git checkout
-			# Try to find a remote branch that matches the completion word
-			# but only output if the branch name is unique
-			local ref entry
-			git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \
-				"refs/remotes/" | \
-			while read -r entry; do
-				eval "$entry"
-				ref="${ref#*/}"
-				if [[ "$ref" == "$cur"* ]]; then
-					echo "$ref"
-				fi
-			done | sort | uniq -u
-		fi
-		return
-	fi
-	case "$cur" in
-	refs|refs/*)
-		git ls-remote "$dir" "$cur*" 2>/dev/null | \
-		while read -r hash i; do
-			case "$i" in
-			*^{}) ;;
-			*) echo "$i" ;;
-			esac
-		done
-		;;
-	*)
-		git ls-remote "$dir" HEAD ORIG_HEAD 'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev/null | \
-		while read -r hash i; do
-			case "$i" in
-			*^{}) ;;
-			refs/*) echo "${i#refs/*/}" ;;
-			*) echo "$i" ;;
-			esac
-		done
-		;;
-	esac
-}
-
-# __git_refs2 requires 1 argument (to pass to __git_refs)
-__git_refs2 ()
-{
-	local i
-	for i in $(__git_refs "$1"); do
-		echo "$i:$i"
-	done
-}
-
-# __git_refs_remotes requires 1 argument (to pass to ls-remote)
-__git_refs_remotes ()
-{
-	local i hash
-	git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \
-	while read -r hash i; do
-		echo "$i:refs/remotes/$1/${i#refs/heads/}"
-	done
-}
-
-__git_remotes ()
-{
-	local i IFS=$'\n' d="$(__gitdir)"
-	test -d "$d/remotes" && ls -1 "$d/remotes"
-	for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do
-		i="${i#remote.}"
-		echo "${i/.url*/}"
-	done
-}
-
-__git_list_merge_strategies ()
-{
-	git merge -s help 2>&1 |
-	sed -n -e '/[Aa]vailable strategies are: /,/^$/{
-		s/\.$//
-		s/.*://
-		s/^[ 	]*//
-		s/[ 	]*$//
-		p
-	}'
-}
-
-__git_merge_strategies=
-# 'git merge -s help' (and thus detection of the merge strategy
-# list) fails, unfortunately, if run outside of any git working
-# tree.  __git_merge_strategies is set to the empty string in
-# that case, and the detection will be repeated the next time it
-# is needed.
-__git_compute_merge_strategies ()
-{
-	test -n "$__git_merge_strategies" ||
-	__git_merge_strategies=$(__git_list_merge_strategies)
-}
-
-__git_complete_revlist_file ()
-{
-	local pfx ls ref cur_="$cur"
-	case "$cur_" in
-	*..?*:*)
-		return
-		;;
-	?*:*)
-		ref="${cur_%%:*}"
-		cur_="${cur_#*:}"
-		case "$cur_" in
-		?*/*)
-			pfx="${cur_%/*}"
-			cur_="${cur_##*/}"
-			ls="$ref:$pfx"
-			pfx="$pfx/"
-			;;
-		*)
-			ls="$ref"
-			;;
-		esac
-
-		case "$COMP_WORDBREAKS" in
-		*:*) : great ;;
-		*)   pfx="$ref:$pfx" ;;
-		esac
-
-		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \
-				| sed '/^100... blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^120000 blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^040000 tree /{
-				           s,^.*	,,
-				           s,$,/,
-				       }
-				       s/^.*	//')" \
-			"$pfx" "$cur_" ""
-		;;
-	*...*)
-		pfx="${cur_%...*}..."
-		cur_="${cur_#*...}"
-		__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
-		;;
-	*..*)
-		pfx="${cur_%..*}.."
-		cur_="${cur_#*..}"
-		__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
-		;;
-	*)
-		__gitcomp_nl "$(__git_refs)"
-		;;
-	esac
-}
-
-
-# __git_complete_index_file requires 1 argument: the options to pass to
-# ls-file
-__git_complete_index_file ()
-{
-	local pfx cur_="$cur"
-
-	case "$cur_" in
-	?*/*)
-		pfx="${cur_%/*}"
-		cur_="${cur_##*/}"
-		pfx="${pfx}/"
-
-		__gitcomp_file "$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_"
-		;;
-	*)
-		__gitcomp_file "$(__git_index_files "$1")" "" "$cur_"
-		;;
-	esac
-}
-
-# __git_complete_diff_index_file requires 1 argument: the id of a tree
-# object
-__git_complete_diff_index_file ()
-{
-	local pfx cur_="$cur"
-
-	case "$cur_" in
-	?*/*)
-		pfx="${cur_%/*}"
-		cur_="${cur_##*/}"
-		pfx="${pfx}/"
-
-		__gitcomp_file "$(__git_diff_index_files "$1" "$pfx")" "$pfx" "$cur_"
-		;;
-	*)
-		__gitcomp_file "$(__git_diff_index_files "$1")" "" "$cur_"
-		;;
-	esac
-}
-
-__git_complete_file ()
-{
-	__git_complete_revlist_file
-}
-
-__git_complete_revlist ()
-{
-	__git_complete_revlist_file
-}
-
-__git_complete_remote_or_refspec ()
-{
-	local cur_="$cur" cmd="${words[1]}"
-	local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0
-	if [ "$cmd" = "remote" ]; then
-		((c++))
-	fi
-	while [ $c -lt $cword ]; do
-		i="${words[c]}"
-		case "$i" in
-		--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
-		--all)
-			case "$cmd" in
-			push) no_complete_refspec=1 ;;
-			fetch)
-				COMPREPLY=()
-				return
-				;;
-			*) ;;
-			esac
-			;;
-		-*) ;;
-		*) remote="$i"; break ;;
-		esac
-		((c++))
-	done
-	if [ -z "$remote" ]; then
-		__gitcomp_nl "$(__git_remotes)"
-		return
-	fi
-	if [ $no_complete_refspec = 1 ]; then
-		COMPREPLY=()
-		return
-	fi
-	[ "$remote" = "." ] && remote=
-	case "$cur_" in
-	*:*)
-		case "$COMP_WORDBREAKS" in
-		*:*) : great ;;
-		*)   pfx="${cur_%%:*}:" ;;
-		esac
-		cur_="${cur_#*:}"
-		lhs=0
-		;;
-	+*)
-		pfx="+"
-		cur_="${cur_#+}"
-		;;
-	esac
-	case "$cmd" in
-	fetch)
-		if [ $lhs = 1 ]; then
-			__gitcomp_nl "$(__git_refs2 "$remote")" "$pfx" "$cur_"
-		else
-			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
-		fi
-		;;
-	pull|remote)
-		if [ $lhs = 1 ]; then
-			__gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_"
-		else
-			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
-		fi
-		;;
-	push)
-		if [ $lhs = 1 ]; then
-			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
-		else
-			__gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_"
-		fi
-		;;
-	esac
-}
-
-__git_complete_strategy ()
-{
-	__git_compute_merge_strategies
-	case "$prev" in
-	-s|--strategy)
-		__gitcomp "$__git_merge_strategies"
-		return 0
-	esac
-	case "$cur" in
-	--strategy=*)
-		__gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}"
-		return 0
-		;;
-	esac
-	return 1
-}
-
-__git_commands () {
-	if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}"
-	then
-		printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
-	else
-		git help -a|egrep '^  [a-zA-Z0-9]'
-	fi
-}
-
-__git_list_all_commands ()
-{
-	local i IFS=" "$'\n'
-	for i in $(__git_commands)
-	do
-		case $i in
-		*--*)             : helper pattern;;
-		*) echo $i;;
-		esac
-	done
-}
-
-__git_all_commands=
-__git_compute_all_commands ()
-{
-	test -n "$__git_all_commands" ||
-	__git_all_commands=$(__git_list_all_commands)
-}
-
-__git_list_porcelain_commands ()
-{
-	local i IFS=" "$'\n'
-	__git_compute_all_commands
-	for i in $__git_all_commands
-	do
-		case $i in
-		*--*)             : helper pattern;;
-		applymbox)        : ask gittus;;
-		applypatch)       : ask gittus;;
-		archimport)       : import;;
-		cat-file)         : plumbing;;
-		check-attr)       : plumbing;;
-		check-ignore)     : plumbing;;
-		check-ref-format) : plumbing;;
-		checkout-index)   : plumbing;;
-		commit-tree)      : plumbing;;
-		count-objects)    : infrequent;;
-		credential-cache) : credentials helper;;
-		credential-store) : credentials helper;;
-		cvsexportcommit)  : export;;
-		cvsimport)        : import;;
-		cvsserver)        : daemon;;
-		daemon)           : daemon;;
-		diff-files)       : plumbing;;
-		diff-index)       : plumbing;;
-		diff-tree)        : plumbing;;
-		fast-import)      : import;;
-		fast-export)      : export;;
-		fsck-objects)     : plumbing;;
-		fetch-pack)       : plumbing;;
-		fmt-merge-msg)    : plumbing;;
-		for-each-ref)     : plumbing;;
-		hash-object)      : plumbing;;
-		http-*)           : transport;;
-		index-pack)       : plumbing;;
-		init-db)          : deprecated;;
-		local-fetch)      : plumbing;;
-		lost-found)       : infrequent;;
-		ls-files)         : plumbing;;
-		ls-remote)        : plumbing;;
-		ls-tree)          : plumbing;;
-		mailinfo)         : plumbing;;
-		mailsplit)        : plumbing;;
-		merge-*)          : plumbing;;
-		mktree)           : plumbing;;
-		mktag)            : plumbing;;
-		pack-objects)     : plumbing;;
-		pack-redundant)   : plumbing;;
-		pack-refs)        : plumbing;;
-		parse-remote)     : plumbing;;
-		patch-id)         : plumbing;;
-		peek-remote)      : plumbing;;
-		prune)            : plumbing;;
-		prune-packed)     : plumbing;;
-		quiltimport)      : import;;
-		read-tree)        : plumbing;;
-		receive-pack)     : plumbing;;
-		remote-*)         : transport;;
-		repo-config)      : deprecated;;
-		rerere)           : plumbing;;
-		rev-list)         : plumbing;;
-		rev-parse)        : plumbing;;
-		runstatus)        : plumbing;;
-		sh-setup)         : internal;;
-		shell)            : daemon;;
-		show-ref)         : plumbing;;
-		send-pack)        : plumbing;;
-		show-index)       : plumbing;;
-		ssh-*)            : transport;;
-		stripspace)       : plumbing;;
-		symbolic-ref)     : plumbing;;
-		tar-tree)         : deprecated;;
-		unpack-file)      : plumbing;;
-		unpack-objects)   : plumbing;;
-		update-index)     : plumbing;;
-		update-ref)       : plumbing;;
-		update-server-info) : daemon;;
-		upload-archive)   : plumbing;;
-		upload-pack)      : plumbing;;
-		write-tree)       : plumbing;;
-		var)              : infrequent;;
-		verify-pack)      : infrequent;;
-		verify-tag)       : plumbing;;
-		*) echo $i;;
-		esac
-	done
-}
-
-__git_porcelain_commands=
-__git_compute_porcelain_commands ()
-{
-	__git_compute_all_commands
-	test -n "$__git_porcelain_commands" ||
-	__git_porcelain_commands=$(__git_list_porcelain_commands)
-}
-
-__git_pretty_aliases ()
-{
-	local i IFS=$'\n'
-	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do
-		case "$i" in
-		pretty.*)
-			i="${i#pretty.}"
-			echo "${i/ */}"
-			;;
-		esac
-	done
-}
-
-__git_aliases ()
-{
-	local i IFS=$'\n'
-	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do
-		case "$i" in
-		alias.*)
-			i="${i#alias.}"
-			echo "${i/ */}"
-			;;
-		esac
-	done
-}
-
-# __git_aliased_command requires 1 argument
-__git_aliased_command ()
-{
-	local word cmdline=$(git --git-dir="$(__gitdir)" \
-		config --get "alias.$1")
-	for word in $cmdline; do
-		case "$word" in
-		\!gitk|gitk)
-			echo "gitk"
-			return
-			;;
-		\!*)	: shell command alias ;;
-		-*)	: option ;;
-		*=*)	: setting env ;;
-		git)	: git itself ;;
-		*)
-			echo "$word"
-			return
-		esac
-	done
-}
-
-# __git_find_on_cmdline requires 1 argument
-__git_find_on_cmdline ()
-{
-	local word subcommand c=1
-	while [ $c -lt $cword ]; do
-		word="${words[c]}"
-		for subcommand in $1; do
-			if [ "$subcommand" = "$word" ]; then
-				echo "$subcommand"
-				return
-			fi
-		done
-		((c++))
-	done
-}
-
-__git_has_doubledash ()
-{
-	local c=1
-	while [ $c -lt $cword ]; do
-		if [ "--" = "${words[c]}" ]; then
-			return 0
-		fi
-		((c++))
-	done
-	return 1
-}
-
-# Try to count non option arguments passed on the command line for the
-# specified git command.
-# When options are used, it is necessary to use the special -- option to
-# tell the implementation were non option arguments begin.
-# XXX this can not be improved, since options can appear everywhere, as
-# an example:
-#	git mv x -n y
-#
-# __git_count_arguments requires 1 argument: the git command executed.
-__git_count_arguments ()
-{
-	local word i c=0
-
-	# Skip "git" (first argument)
-	for ((i=1; i < ${#words[@]}; i++)); do
-		word="${words[i]}"
-
-		case "$word" in
-			--)
-				# Good; we can assume that the following are only non
-				# option arguments.
-				((c = 0))
-				;;
-			"$1")
-				# Skip the specified git command and discard git
-				# main options
-				((c = 0))
-				;;
-			?*)
-				((c++))
-				;;
-		esac
-	done
-
-	printf "%d" $c
-}
-
-__git_whitespacelist="nowarn warn error error-all fix"
-
-_git_am ()
-{
-	local dir="$(__gitdir)"
-	if [ -d "$dir"/rebase-apply ]; then
-		__gitcomp "--skip --continue --resolved --abort"
-		return
-	fi
-	case "$cur" in
-	--whitespace=*)
-		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--3way --committer-date-is-author-date --ignore-date
-			--ignore-whitespace --ignore-space-change
-			--interactive --keep --no-utf8 --signoff --utf8
-			--whitespace= --scissors
-			"
-		return
-	esac
-	COMPREPLY=()
-}
-
-_git_apply ()
-{
-	case "$cur" in
-	--whitespace=*)
-		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--stat --numstat --summary --check --index
-			--cached --index-info --reverse --reject --unidiff-zero
-			--apply --no-add --exclude=
-			--ignore-whitespace --ignore-space-change
-			--whitespace= --inaccurate-eof --verbose
-			"
-		return
-	esac
-	COMPREPLY=()
-}
-
-_git_add ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--interactive --refresh --patch --update --dry-run
-			--ignore-errors --intent-to-add
-			"
-		return
-	esac
-
-	# XXX should we check for --update and --all options ?
-	__git_complete_index_file "--others --modified"
-}
-
-_git_archive ()
-{
-	case "$cur" in
-	--format=*)
-		__gitcomp "$(git archive --list)" "" "${cur##--format=}"
-		return
-		;;
-	--remote=*)
-		__gitcomp_nl "$(__git_remotes)" "" "${cur##--remote=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--format= --list --verbose
-			--prefix= --remote= --exec=
-			"
-		return
-		;;
-	esac
-	__git_complete_file
-}
-
-_git_bisect ()
-{
-	__git_has_doubledash && return
-
-	local subcommands="start bad good skip reset visualize replay log run"
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-	if [ -z "$subcommand" ]; then
-		if [ -f "$(__gitdir)"/BISECT_START ]; then
-			__gitcomp "$subcommands"
-		else
-			__gitcomp "replay start"
-		fi
-		return
-	fi
-
-	case "$subcommand" in
-	bad|good|reset|skip|start)
-		__gitcomp_nl "$(__git_refs)"
-		;;
-	*)
-		COMPREPLY=()
-		;;
-	esac
-}
-
-_git_branch ()
-{
-	local i c=1 only_local_ref="n" has_r="n"
-
-	while [ $c -lt $cword ]; do
-		i="${words[c]}"
-		case "$i" in
-		-d|-m)	only_local_ref="y" ;;
-		-r)	has_r="y" ;;
-		esac
-		((c++))
-	done
-
-	case "$cur" in
-	--set-upstream-to=*)
-		__gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}"
-		;;
-	--*)
-		__gitcomp "
-			--color --no-color --verbose --abbrev= --no-abbrev
-			--track --no-track --contains --merged --no-merged
-			--set-upstream-to= --edit-description --list
-			--unset-upstream
-			"
-		;;
-	*)
-		if [ $only_local_ref = "y" -a $has_r = "n" ]; then
-			__gitcomp_nl "$(__git_heads)"
-		else
-			__gitcomp_nl "$(__git_refs)"
-		fi
-		;;
-	esac
-}
-
-_git_bundle ()
-{
-	local cmd="${words[2]}"
-	case "$cword" in
-	2)
-		__gitcomp "create list-heads verify unbundle"
-		;;
-	3)
-		# looking for a file
-		;;
-	*)
-		case "$cmd" in
-			create)
-				__git_complete_revlist
-			;;
-		esac
-		;;
-	esac
-}
-
-_git_checkout ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--conflict=*)
-		__gitcomp "diff3 merge" "" "${cur##--conflict=}"
-		;;
-	--*)
-		__gitcomp "
-			--quiet --ours --theirs --track --no-track --merge
-			--conflict= --orphan --patch
-			"
-		;;
-	*)
-		# check if --track, --no-track, or --no-guess was specified
-		# if so, disable DWIM mode
-		local flags="--track --no-track --no-guess" track=1
-		if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
-			track=''
-		fi
-		__gitcomp_nl "$(__git_refs '' $track)"
-		;;
-	esac
-}
-
-_git_cherry ()
-{
-	__gitcomp "$(__git_refs)"
-}
-
-_git_cherry_pick ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--edit --no-commit"
-		;;
-	*)
-		__gitcomp_nl "$(__git_refs)"
-		;;
-	esac
-}
-
-_git_clean ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--dry-run --quiet"
-		return
-		;;
-	esac
-
-	# XXX should we check for -x option ?
-	__git_complete_index_file "--others"
-}
-
-_git_clone ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--local
-			--no-hardlinks
-			--shared
-			--reference
-			--quiet
-			--no-checkout
-			--bare
-			--mirror
-			--origin
-			--upload-pack
-			--template=
-			--depth
-			--single-branch
-			--branch
-			"
-		return
-		;;
-	esac
-	COMPREPLY=()
-}
-
-_git_commit ()
-{
-	case "$prev" in
-	-c|-C)
-		__gitcomp_nl "$(__git_refs)" "" "${cur}"
-		return
-		;;
-	esac
-
-	case "$prev" in
-	-c|-C)
-		__gitcomp_nl "$(__git_refs)" "" "${cur}"
-		return
-		;;
-	esac
-
-	case "$cur" in
-	--cleanup=*)
-		__gitcomp "default strip verbatim whitespace
-			" "" "${cur##--cleanup=}"
-		return
-		;;
-	--reuse-message=*|--reedit-message=*|\
-	--fixup=*|--squash=*)
-		__gitcomp_nl "$(__git_refs)" "" "${cur#*=}"
-		return
-		;;
-	--untracked-files=*)
-		__gitcomp "all no normal" "" "${cur##--untracked-files=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--all --author= --signoff --verify --no-verify
-			--edit --no-edit
-			--amend --include --only --interactive
-			--dry-run --reuse-message= --reedit-message=
-			--reset-author --file= --message= --template=
-			--cleanup= --untracked-files --untracked-files=
-			--verbose --quiet --fixup= --squash=
-			"
-		return
-	esac
-
-	if git rev-parse --verify --quiet HEAD >/dev/null; then
-		__git_complete_diff_index_file "HEAD"
-	else
-		# This is the first commit
-		__git_complete_index_file "--cached"
-	fi
-}
-
-_git_describe ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--all --tags --contains --abbrev= --candidates=
-			--exact-match --debug --long --match --always
-			"
-		return
-	esac
-	__gitcomp_nl "$(__git_refs)"
-}
-
-__git_diff_algorithms="myers minimal patience histogram"
-
-__git_diff_common_options="--stat --numstat --shortstat --summary
-			--patch-with-stat --name-only --name-status --color
-			--no-color --color-words --no-renames --check
-			--full-index --binary --abbrev --diff-filter=
-			--find-copies-harder
-			--text --ignore-space-at-eol --ignore-space-change
-			--ignore-all-space --exit-code --quiet --ext-diff
-			--no-ext-diff
-			--no-prefix --src-prefix= --dst-prefix=
-			--inter-hunk-context=
-			--patience --histogram --minimal
-			--raw
-			--dirstat --dirstat= --dirstat-by-file
-			--dirstat-by-file= --cumulative
-			--diff-algorithm=
-"
-
-_git_diff ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--diff-algorithm=*)
-		__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
-		return
-		;;
-	--*)
-		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
-			--base --ours --theirs --no-index
-			$__git_diff_common_options
-			"
-		return
-		;;
-	esac
-	__git_complete_revlist_file
-}
-
-__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
-			tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
-"
-
-_git_difftool ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--tool=*)
-		__gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
-		return
-		;;
-	--*)
-		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
-			--base --ours --theirs
-			--no-renames --diff-filter= --find-copies-harder
-			--relative --ignore-submodules
-			--tool="
-		return
-		;;
-	esac
-	__git_complete_file
-}
-
-__git_fetch_options="
-	--quiet --verbose --append --upload-pack --force --keep --depth=
-	--tags --no-tags --all --prune --dry-run
-"
-
-_git_fetch ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "$__git_fetch_options"
-		return
-		;;
-	esac
-	__git_complete_remote_or_refspec
-}
-
-__git_format_patch_options="
-	--stdout --attach --no-attach --thread --thread= --output-directory
-	--numbered --start-number --numbered-files --keep-subject --signoff
-	--signature --no-signature --in-reply-to= --cc= --full-index --binary
-	--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
-	--inline --suffix= --ignore-if-in-upstream --subject-prefix=
-"
-
-_git_format_patch ()
-{
-	case "$cur" in
-	--thread=*)
-		__gitcomp "
-			deep shallow
-			" "" "${cur##--thread=}"
-		return
-		;;
-	--*)
-		__gitcomp "$__git_format_patch_options"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-_git_fsck ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--tags --root --unreachable --cache --no-reflogs --full
-			--strict --verbose --lost-found
-			"
-		return
-		;;
-	esac
-	COMPREPLY=()
-}
-
-_git_gc ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--prune --aggressive"
-		return
-		;;
-	esac
-	COMPREPLY=()
-}
-
-_git_gitk ()
-{
-	_gitk
-}
-
-__git_match_ctag() {
-	awk "/^${1////\\/}/ { print \$1 }" "$2"
-}
-
-_git_grep ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--cached
-			--text --ignore-case --word-regexp --invert-match
-			--full-name --line-number
-			--extended-regexp --basic-regexp --fixed-strings
-			--perl-regexp
-			--files-with-matches --name-only
-			--files-without-match
-			--max-depth
-			--count
-			--and --or --not --all-match
-			"
-		return
-		;;
-	esac
-
-	case "$cword,$prev" in
-	2,*|*,-*)
-		if test -r tags; then
-			__gitcomp_nl "$(__git_match_ctag "$cur" tags)"
-			return
-		fi
-		;;
-	esac
-
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_help ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--all --info --man --web"
-		return
-		;;
-	esac
-	__git_compute_all_commands
-	__gitcomp "$__git_all_commands $(__git_aliases)
-		attributes cli core-tutorial cvs-migration
-		diffcore gitk glossary hooks ignore modules
-		namespaces repository-layout tutorial tutorial-2
-		workflows
-		"
-}
-
-_git_init ()
-{
-	case "$cur" in
-	--shared=*)
-		__gitcomp "
-			false true umask group all world everybody
-			" "" "${cur##--shared=}"
-		return
-		;;
-	--*)
-		__gitcomp "--quiet --bare --template= --shared --shared="
-		return
-		;;
-	esac
-	COMPREPLY=()
-}
-
-_git_ls_files ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--cached --deleted --modified --others --ignored
-			--stage --directory --no-empty-directory --unmerged
-			--killed --exclude= --exclude-from=
-			--exclude-per-directory= --exclude-standard
-			--error-unmatch --with-tree= --full-name
-			--abbrev --ignored --exclude-per-directory
-			"
-		return
-		;;
-	esac
-
-	# XXX ignore options like --modified and always suggest all cached
-	# files.
-	__git_complete_index_file "--cached"
-}
-
-_git_ls_remote ()
-{
-	__gitcomp_nl "$(__git_remotes)"
-}
-
-_git_ls_tree ()
-{
-	__git_complete_file
-}
-
-# Options that go well for log, shortlog and gitk
-__git_log_common_options="
-	--not --all
-	--branches --tags --remotes
-	--first-parent --merges --no-merges
-	--max-count=
-	--max-age= --since= --after=
-	--min-age= --until= --before=
-	--min-parents= --max-parents=
-	--no-min-parents --no-max-parents
-"
-# Options that go well for log and gitk (not shortlog)
-__git_log_gitk_options="
-	--dense --sparse --full-history
-	--simplify-merges --simplify-by-decoration
-	--left-right --notes --no-notes
-"
-# Options that go well for log and shortlog (not gitk)
-__git_log_shortlog_options="
-	--author= --committer= --grep=
-	--all-match
-"
-
-__git_log_pretty_formats="oneline short medium full fuller email raw format:"
-__git_log_date_formats="relative iso8601 rfc2822 short local default raw"
-
-_git_log ()
-{
-	__git_has_doubledash && return
-
-	local g="$(git rev-parse --git-dir 2>/dev/null)"
-	local merge=""
-	if [ -f "$g/MERGE_HEAD" ]; then
-		merge="--merge"
-	fi
-	case "$cur" in
-	--pretty=*|--format=*)
-		__gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases)
-			" "" "${cur#*=}"
-		return
-		;;
-	--date=*)
-		__gitcomp "$__git_log_date_formats" "" "${cur##--date=}"
-		return
-		;;
-	--decorate=*)
-		__gitcomp "long short" "" "${cur##--decorate=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			$__git_log_common_options
-			$__git_log_shortlog_options
-			$__git_log_gitk_options
-			--root --topo-order --date-order --reverse
-			--follow --full-diff
-			--abbrev-commit --abbrev=
-			--relative-date --date=
-			--pretty= --format= --oneline
-			--cherry-pick
-			--graph
-			--decorate --decorate=
-			--walk-reflogs
-			--parents --children
-			$merge
-			$__git_diff_common_options
-			--pickaxe-all --pickaxe-regex
-			"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-__git_merge_options="
-	--no-commit --no-stat --log --no-log --squash --strategy
-	--commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
-"
-
-_git_merge ()
-{
-	__git_complete_strategy && return
-
-	case "$cur" in
-	--*)
-		__gitcomp "$__git_merge_options"
-		return
-	esac
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_mergetool ()
-{
-	case "$cur" in
-	--tool=*)
-		__gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
-		return
-		;;
-	--*)
-		__gitcomp "--tool="
-		return
-		;;
-	esac
-	COMPREPLY=()
-}
-
-_git_merge_base ()
-{
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_mv ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--dry-run"
-		return
-		;;
-	esac
-
-	if [ $(__git_count_arguments "mv") -gt 0 ]; then
-		# We need to show both cached and untracked files (including
-		# empty directories) since this may not be the last argument.
-		__git_complete_index_file "--cached --others --directory"
-	else
-		__git_complete_index_file "--cached"
-	fi
-}
-
-_git_name_rev ()
-{
-	__gitcomp "--tags --all --stdin"
-}
-
-_git_notes ()
-{
-	local subcommands='add append copy edit list prune remove show'
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-
-	case "$subcommand,$cur" in
-	,--*)
-		__gitcomp '--ref'
-		;;
-	,*)
-		case "$prev" in
-		--ref)
-			__gitcomp_nl "$(__git_refs)"
-			;;
-		*)
-			__gitcomp "$subcommands --ref"
-			;;
-		esac
-		;;
-	add,--reuse-message=*|append,--reuse-message=*|\
-	add,--reedit-message=*|append,--reedit-message=*)
-		__gitcomp_nl "$(__git_refs)" "" "${cur#*=}"
-		;;
-	add,--*|append,--*)
-		__gitcomp '--file= --message= --reedit-message=
-				--reuse-message='
-		;;
-	copy,--*)
-		__gitcomp '--stdin'
-		;;
-	prune,--*)
-		__gitcomp '--dry-run --verbose'
-		;;
-	prune,*)
-		;;
-	*)
-		case "$prev" in
-		-m|-F)
-			;;
-		*)
-			__gitcomp_nl "$(__git_refs)"
-			;;
-		esac
-		;;
-	esac
-}
-
-_git_pull ()
-{
-	__git_complete_strategy && return
-
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--rebase --no-rebase
-			$__git_merge_options
-			$__git_fetch_options
-		"
-		return
-		;;
-	esac
-	__git_complete_remote_or_refspec
-}
-
-_git_push ()
-{
-	case "$prev" in
-	--repo)
-		__gitcomp_nl "$(__git_remotes)"
-		return
-	esac
-	case "$cur" in
-	--repo=*)
-		__gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--all --mirror --tags --dry-run --force --verbose
-			--receive-pack= --repo= --set-upstream
-		"
-		return
-		;;
-	esac
-	__git_complete_remote_or_refspec
-}
-
-_git_rebase ()
-{
-	local dir="$(__gitdir)"
-	if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
-		__gitcomp "--continue --skip --abort"
-		return
-	fi
-	__git_complete_strategy && return
-	case "$cur" in
-	--whitespace=*)
-		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
-		return
-		;;
-	--*)
-		__gitcomp "
-			--onto --merge --strategy --interactive
-			--preserve-merges --stat --no-stat
-			--committer-date-is-author-date --ignore-date
-			--ignore-whitespace --whitespace=
-			--autosquash
-			"
-
-		return
-	esac
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_reflog ()
-{
-	local subcommands="show delete expire"
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-
-	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
-	else
-		__gitcomp_nl "$(__git_refs)"
-	fi
-}
-
-__git_send_email_confirm_options="always never auto cc compose"
-__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
-
-_git_send_email ()
-{
-	case "$cur" in
-	--confirm=*)
-		__gitcomp "
-			$__git_send_email_confirm_options
-			" "" "${cur##--confirm=}"
-		return
-		;;
-	--suppress-cc=*)
-		__gitcomp "
-			$__git_send_email_suppresscc_options
-			" "" "${cur##--suppress-cc=}"
-
-		return
-		;;
-	--smtp-encryption=*)
-		__gitcomp "ssl tls" "" "${cur##--smtp-encryption=}"
-		return
-		;;
-	--thread=*)
-		__gitcomp "
-			deep shallow
-			" "" "${cur##--thread=}"
-		return
-		;;
-	--*)
-		__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
-			--compose --confirm= --dry-run --envelope-sender
-			--from --identity
-			--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
-			--no-suppress-from --no-thread --quiet
-			--signed-off-by-cc --smtp-pass --smtp-server
-			--smtp-server-port --smtp-encryption= --smtp-user
-			--subject --suppress-cc= --suppress-from --thread --to
-			--validate --no-validate
-			$__git_format_patch_options"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-_git_stage ()
-{
-	_git_add
-}
-
-__git_config_get_set_variables ()
-{
-	local prevword word config_file= c=$cword
-	while [ $c -gt 1 ]; do
-		word="${words[c]}"
-		case "$word" in
-		--system|--global|--local|--file=*)
-			config_file="$word"
-			break
-			;;
-		-f|--file)
-			config_file="$word $prevword"
-			break
-			;;
-		esac
-		prevword=$word
-		c=$((--c))
-	done
-
-	git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null |
-	while read -r line
-	do
-		case "$line" in
-		*.*=*)
-			echo "${line/=*/}"
-			;;
-		esac
-	done
-}
-
-_git_config ()
-{
-	case "$prev" in
-	branch.*.remote)
-		__gitcomp_nl "$(__git_remotes)"
-		return
-		;;
-	branch.*.merge)
-		__gitcomp_nl "$(__git_refs)"
-		return
-		;;
-	remote.*.fetch)
-		local remote="${prev#remote.}"
-		remote="${remote%.fetch}"
-		if [ -z "$cur" ]; then
-			COMPREPLY=("refs/heads/")
-			return
-		fi
-		__gitcomp_nl "$(__git_refs_remotes "$remote")"
-		return
-		;;
-	remote.*.push)
-		local remote="${prev#remote.}"
-		remote="${remote%.push}"
-		__gitcomp_nl "$(git --git-dir="$(__gitdir)" \
-			for-each-ref --format='%(refname):%(refname)' \
-			refs/heads)"
-		return
-		;;
-	pull.twohead|pull.octopus)
-		__git_compute_merge_strategies
-		__gitcomp "$__git_merge_strategies"
-		return
-		;;
-	color.branch|color.diff|color.interactive|\
-	color.showbranch|color.status|color.ui)
-		__gitcomp "always never auto"
-		return
-		;;
-	color.pager)
-		__gitcomp "false true"
-		return
-		;;
-	color.*.*)
-		__gitcomp "
-			normal black red green yellow blue magenta cyan white
-			bold dim ul blink reverse
-			"
-		return
-		;;
-	help.format)
-		__gitcomp "man info web html"
-		return
-		;;
-	log.date)
-		__gitcomp "$__git_log_date_formats"
-		return
-		;;
-	sendemail.aliasesfiletype)
-		__gitcomp "mutt mailrc pine elm gnus"
-		return
-		;;
-	sendemail.confirm)
-		__gitcomp "$__git_send_email_confirm_options"
-		return
-		;;
-	sendemail.suppresscc)
-		__gitcomp "$__git_send_email_suppresscc_options"
-		return
-		;;
-	--get|--get-all|--unset|--unset-all)
-		__gitcomp_nl "$(__git_config_get_set_variables)"
-		return
-		;;
-	*.*)
-		COMPREPLY=()
-		return
-		;;
-	esac
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--system --global --local --file=
-			--list --replace-all
-			--get --get-all --get-regexp
-			--add --unset --unset-all
-			--remove-section --rename-section
-			"
-		return
-		;;
-	branch.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "remote merge mergeoptions rebase" "$pfx" "$cur_"
-		return
-		;;
-	branch.*)
-		local pfx="${cur%.*}." cur_="${cur#*.}"
-		__gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "."
-		return
-		;;
-	guitool.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "
-			argprompt cmd confirm needsfile noconsole norescan
-			prompt revprompt revunmerged title
-			" "$pfx" "$cur_"
-		return
-		;;
-	difftool.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "cmd path" "$pfx" "$cur_"
-		return
-		;;
-	man.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "cmd path" "$pfx" "$cur_"
-		return
-		;;
-	mergetool.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "cmd path trustExitCode" "$pfx" "$cur_"
-		return
-		;;
-	pager.*)
-		local pfx="${cur%.*}." cur_="${cur#*.}"
-		__git_compute_all_commands
-		__gitcomp_nl "$__git_all_commands" "$pfx" "$cur_"
-		return
-		;;
-	remote.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "
-			url proxy fetch push mirror skipDefaultUpdate
-			receivepack uploadpack tagopt pushurl
-			" "$pfx" "$cur_"
-		return
-		;;
-	remote.*)
-		local pfx="${cur%.*}." cur_="${cur#*.}"
-		__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
-		return
-		;;
-	url.*.*)
-		local pfx="${cur%.*}." cur_="${cur##*.}"
-		__gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_"
-		return
-		;;
-	esac
-	__gitcomp "
-		add.ignoreErrors
-		advice.commitBeforeMerge
-		advice.detachedHead
-		advice.implicitIdentity
-		advice.pushNonFastForward
-		advice.resolveConflict
-		advice.statusHints
-		alias.
-		am.keepcr
-		apply.ignorewhitespace
-		apply.whitespace
-		branch.autosetupmerge
-		branch.autosetuprebase
-		browser.
-		clean.requireForce
-		color.branch
-		color.branch.current
-		color.branch.local
-		color.branch.plain
-		color.branch.remote
-		color.decorate.HEAD
-		color.decorate.branch
-		color.decorate.remoteBranch
-		color.decorate.stash
-		color.decorate.tag
-		color.diff
-		color.diff.commit
-		color.diff.frag
-		color.diff.func
-		color.diff.meta
-		color.diff.new
-		color.diff.old
-		color.diff.plain
-		color.diff.whitespace
-		color.grep
-		color.grep.context
-		color.grep.filename
-		color.grep.function
-		color.grep.linenumber
-		color.grep.match
-		color.grep.selected
-		color.grep.separator
-		color.interactive
-		color.interactive.error
-		color.interactive.header
-		color.interactive.help
-		color.interactive.prompt
-		color.pager
-		color.showbranch
-		color.status
-		color.status.added
-		color.status.changed
-		color.status.header
-		color.status.nobranch
-		color.status.untracked
-		color.status.updated
-		color.ui
-		commit.status
-		commit.template
-		core.abbrev
-		core.askpass
-		core.attributesfile
-		core.autocrlf
-		core.bare
-		core.bigFileThreshold
-		core.compression
-		core.createObject
-		core.deltaBaseCacheLimit
-		core.editor
-		core.eol
-		core.excludesfile
-		core.fileMode
-		core.fsyncobjectfiles
-		core.gitProxy
-		core.ignoreCygwinFSTricks
-		core.ignoreStat
-		core.ignorecase
-		core.logAllRefUpdates
-		core.loosecompression
-		core.notesRef
-		core.packedGitLimit
-		core.packedGitWindowSize
-		core.pager
-		core.preferSymlinkRefs
-		core.preloadindex
-		core.quotepath
-		core.repositoryFormatVersion
-		core.safecrlf
-		core.sharedRepository
-		core.sparseCheckout
-		core.symlinks
-		core.trustctime
-		core.warnAmbiguousRefs
-		core.whitespace
-		core.worktree
-		diff.autorefreshindex
-		diff.statGraphWidth
-		diff.external
-		diff.ignoreSubmodules
-		diff.mnemonicprefix
-		diff.noprefix
-		diff.renameLimit
-		diff.renames
-		diff.suppressBlankEmpty
-		diff.tool
-		diff.wordRegex
-		diff.algorithm
-		difftool.
-		difftool.prompt
-		fetch.recurseSubmodules
-		fetch.unpackLimit
-		format.attach
-		format.cc
-		format.headers
-		format.numbered
-		format.pretty
-		format.signature
-		format.signoff
-		format.subjectprefix
-		format.suffix
-		format.thread
-		format.to
-		gc.
-		gc.aggressiveWindow
-		gc.auto
-		gc.autopacklimit
-		gc.packrefs
-		gc.pruneexpire
-		gc.reflogexpire
-		gc.reflogexpireunreachable
-		gc.rerereresolved
-		gc.rerereunresolved
-		gitcvs.allbinary
-		gitcvs.commitmsgannotation
-		gitcvs.dbTableNamePrefix
-		gitcvs.dbdriver
-		gitcvs.dbname
-		gitcvs.dbpass
-		gitcvs.dbuser
-		gitcvs.enabled
-		gitcvs.logfile
-		gitcvs.usecrlfattr
-		guitool.
-		gui.blamehistoryctx
-		gui.commitmsgwidth
-		gui.copyblamethreshold
-		gui.diffcontext
-		gui.encoding
-		gui.fastcopyblame
-		gui.matchtrackingbranch
-		gui.newbranchtemplate
-		gui.pruneduringfetch
-		gui.spellingdictionary
-		gui.trustmtime
-		help.autocorrect
-		help.browser
-		help.format
-		http.lowSpeedLimit
-		http.lowSpeedTime
-		http.maxRequests
-		http.minSessions
-		http.noEPSV
-		http.postBuffer
-		http.proxy
-		http.sslCAInfo
-		http.sslCAPath
-		http.sslCert
-		http.sslCertPasswordProtected
-		http.sslKey
-		http.sslVerify
-		http.useragent
-		i18n.commitEncoding
-		i18n.logOutputEncoding
-		imap.authMethod
-		imap.folder
-		imap.host
-		imap.pass
-		imap.port
-		imap.preformattedHTML
-		imap.sslverify
-		imap.tunnel
-		imap.user
-		init.templatedir
-		instaweb.browser
-		instaweb.httpd
-		instaweb.local
-		instaweb.modulepath
-		instaweb.port
-		interactive.singlekey
-		log.date
-		log.decorate
-		log.showroot
-		mailmap.file
-		man.
-		man.viewer
-		merge.
-		merge.conflictstyle
-		merge.log
-		merge.renameLimit
-		merge.renormalize
-		merge.stat
-		merge.tool
-		merge.verbosity
-		mergetool.
-		mergetool.keepBackup
-		mergetool.keepTemporaries
-		mergetool.prompt
-		notes.displayRef
-		notes.rewrite.
-		notes.rewrite.amend
-		notes.rewrite.rebase
-		notes.rewriteMode
-		notes.rewriteRef
-		pack.compression
-		pack.deltaCacheLimit
-		pack.deltaCacheSize
-		pack.depth
-		pack.indexVersion
-		pack.packSizeLimit
-		pack.threads
-		pack.window
-		pack.windowMemory
-		pager.
-		pretty.
-		pull.octopus
-		pull.twohead
-		push.default
-		rebase.autosquash
-		rebase.stat
-		receive.autogc
-		receive.denyCurrentBranch
-		receive.denyDeleteCurrent
-		receive.denyDeletes
-		receive.denyNonFastForwards
-		receive.fsckObjects
-		receive.unpackLimit
-		receive.updateserverinfo
-		remotes.
-		repack.usedeltabaseoffset
-		rerere.autoupdate
-		rerere.enabled
-		sendemail.
-		sendemail.aliasesfile
-		sendemail.aliasfiletype
-		sendemail.bcc
-		sendemail.cc
-		sendemail.cccmd
-		sendemail.chainreplyto
-		sendemail.confirm
-		sendemail.envelopesender
-		sendemail.from
-		sendemail.identity
-		sendemail.multiedit
-		sendemail.signedoffbycc
-		sendemail.smtpdomain
-		sendemail.smtpencryption
-		sendemail.smtppass
-		sendemail.smtpserver
-		sendemail.smtpserveroption
-		sendemail.smtpserverport
-		sendemail.smtpuser
-		sendemail.suppresscc
-		sendemail.suppressfrom
-		sendemail.thread
-		sendemail.to
-		sendemail.validate
-		showbranch.default
-		status.relativePaths
-		status.showUntrackedFiles
-		status.submodulesummary
-		submodule.
-		tar.umask
-		transfer.unpackLimit
-		url.
-		user.email
-		user.name
-		user.signingkey
-		web.browser
-		branch. remote.
-	"
-}
-
-_git_remote ()
-{
-	local subcommands="add rename remove set-head set-branches set-url show prune update"
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
-		return
-	fi
-
-	case "$subcommand" in
-	rename|remove|set-url|show|prune)
-		__gitcomp_nl "$(__git_remotes)"
-		;;
-	set-head|set-branches)
-		__git_complete_remote_or_refspec
-		;;
-	update)
-		local i c='' IFS=$'\n'
-		for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do
-			i="${i#remotes.}"
-			c="$c ${i/ */}"
-		done
-		__gitcomp "$c"
-		;;
-	*)
-		COMPREPLY=()
-		;;
-	esac
-}
-
-_git_replace ()
-{
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_reset ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--*)
-		__gitcomp "--merge --mixed --hard --soft --patch"
-		return
-		;;
-	esac
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_revert ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--edit --mainline --no-edit --no-commit --signoff"
-		return
-		;;
-	esac
-	__gitcomp_nl "$(__git_refs)"
-}
-
-_git_rm ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
-		return
-		;;
-	esac
-
-	__git_complete_index_file "--cached"
-}
-
-_git_shortlog ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--*)
-		__gitcomp "
-			$__git_log_common_options
-			$__git_log_shortlog_options
-			--numbered --summary
-			"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-_git_show ()
-{
-	__git_has_doubledash && return
-
-	case "$cur" in
-	--pretty=*|--format=*)
-		__gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases)
-			" "" "${cur#*=}"
-		return
-		;;
-	--diff-algorithm=*)
-		__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
-		return
-		;;
-	--*)
-		__gitcomp "--pretty= --format= --abbrev-commit --oneline
-			$__git_diff_common_options
-			"
-		return
-		;;
-	esac
-	__git_complete_file
-}
-
-_git_show_branch ()
-{
-	case "$cur" in
-	--*)
-		__gitcomp "
-			--all --remotes --topo-order --current --more=
-			--list --independent --merge-base --no-name
-			--color --no-color
-			--sha1-name --sparse --topics --reflog
-			"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-_git_stash ()
-{
-	local save_opts='--keep-index --no-keep-index --quiet --patch'
-	local subcommands='save list show apply clear drop pop create branch'
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-	if [ -z "$subcommand" ]; then
-		case "$cur" in
-		--*)
-			__gitcomp "$save_opts"
-			;;
-		*)
-			if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
-				__gitcomp "$subcommands"
-			else
-				COMPREPLY=()
-			fi
-			;;
-		esac
-	else
-		case "$subcommand,$cur" in
-		save,--*)
-			__gitcomp "$save_opts"
-			;;
-		apply,--*|pop,--*)
-			__gitcomp "--index --quiet"
-			;;
-		show,--*|drop,--*|branch,--*)
-			COMPREPLY=()
-			;;
-		show,*|apply,*|drop,*|pop,*|branch,*)
-			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
-					| sed -n -e 's/:.*//p')"
-			;;
-		*)
-			COMPREPLY=()
-			;;
-		esac
-	fi
-}
-
-_git_submodule ()
-{
-	__git_has_doubledash && return
-
-	local subcommands="add status init update summary foreach sync"
-	if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
-		case "$cur" in
-		--*)
-			__gitcomp "--quiet --cached"
-			;;
-		*)
-			__gitcomp "$subcommands"
-			;;
-		esac
-		return
-	fi
-}
-
-_git_svn ()
-{
-	local subcommands="
-		init fetch clone rebase dcommit log find-rev
-		set-tree commit-diff info create-ignore propget
-		proplist show-ignore show-externals branch tag blame
-		migrate mkdirs reset gc
-		"
-	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
-	else
-		local remote_opts="--username= --config-dir= --no-auth-cache"
-		local fc_opts="
-			--follow-parent --authors-file= --repack=
-			--no-metadata --use-svm-props --use-svnsync-props
-			--log-window-size= --no-checkout --quiet
-			--repack-flags --use-log-author --localtime
-			--ignore-paths= $remote_opts
-			"
-		local init_opts="
-			--template= --shared= --trunk= --tags=
-			--branches= --stdlayout --minimize-url
-			--no-metadata --use-svm-props --use-svnsync-props
-			--rewrite-root= --prefix= --use-log-author
-			--add-author-from $remote_opts
-			"
-		local cmt_opts="
-			--edit --rmdir --find-copies-harder --copy-similarity=
-			"
-
-		case "$subcommand,$cur" in
-		fetch,--*)
-			__gitcomp "--revision= --fetch-all $fc_opts"
-			;;
-		clone,--*)
-			__gitcomp "--revision= $fc_opts $init_opts"
-			;;
-		init,--*)
-			__gitcomp "$init_opts"
-			;;
-		dcommit,--*)
-			__gitcomp "
-				--merge --strategy= --verbose --dry-run
-				--fetch-all --no-rebase --commit-url
-				--revision --interactive $cmt_opts $fc_opts
-				"
-			;;
-		set-tree,--*)
-			__gitcomp "--stdin $cmt_opts $fc_opts"
-			;;
-		create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\
-		show-externals,--*|mkdirs,--*)
-			__gitcomp "--revision="
-			;;
-		log,--*)
-			__gitcomp "
-				--limit= --revision= --verbose --incremental
-				--oneline --show-commit --non-recursive
-				--authors-file= --color
-				"
-			;;
-		rebase,--*)
-			__gitcomp "
-				--merge --verbose --strategy= --local
-				--fetch-all --dry-run $fc_opts
-				"
-			;;
-		commit-diff,--*)
-			__gitcomp "--message= --file= --revision= $cmt_opts"
-			;;
-		info,--*)
-			__gitcomp "--url"
-			;;
-		branch,--*)
-			__gitcomp "--dry-run --message --tag"
-			;;
-		tag,--*)
-			__gitcomp "--dry-run --message"
-			;;
-		blame,--*)
-			__gitcomp "--git-format"
-			;;
-		migrate,--*)
-			__gitcomp "
-				--config-dir= --ignore-paths= --minimize
-				--no-auth-cache --username=
-				"
-			;;
-		reset,--*)
-			__gitcomp "--revision= --parent"
-			;;
-		*)
-			COMPREPLY=()
-			;;
-		esac
-	fi
-}
-
-_git_tag ()
-{
-	local i c=1 f=0
-	while [ $c -lt $cword ]; do
-		i="${words[c]}"
-		case "$i" in
-		-d|-v)
-			__gitcomp_nl "$(__git_tags)"
-			return
-			;;
-		-f)
-			f=1
-			;;
-		esac
-		((c++))
-	done
-
-	case "$prev" in
-	-m|-F)
-		COMPREPLY=()
-		;;
-	-*|tag)
-		if [ $f = 1 ]; then
-			__gitcomp_nl "$(__git_tags)"
-		else
-			COMPREPLY=()
-		fi
-		;;
-	*)
-		__gitcomp_nl "$(__git_refs)"
-		;;
-	esac
-}
-
-_git_whatchanged ()
-{
-	_git_log
-}
-
-__git_main ()
-{
-	local i c=1 command __git_dir
-
-	while [ $c -lt $cword ]; do
-		i="${words[c]}"
-		case "$i" in
-		--git-dir=*) __git_dir="${i#--git-dir=}" ;;
-		--bare)      __git_dir="." ;;
-		--help) command="help"; break ;;
-		-c) c=$((++c)) ;;
-		-*) ;;
-		*) command="$i"; break ;;
-		esac
-		((c++))
-	done
-
-	if [ -z "$command" ]; then
-		case "$cur" in
-		--*)   __gitcomp "
-			--paginate
-			--no-pager
-			--git-dir=
-			--bare
-			--version
-			--exec-path
-			--exec-path=
-			--html-path
-			--info-path
-			--work-tree=
-			--namespace=
-			--no-replace-objects
-			--help
-			"
-			;;
-		*)     __git_compute_porcelain_commands
-		       __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;;
-		esac
-		return
-	fi
-
-	local completion_func="_git_${command//-/_}"
-	declare -f $completion_func >/dev/null && $completion_func && return
-
-	local expansion=$(__git_aliased_command "$command")
-	if [ -n "$expansion" ]; then
-		completion_func="_git_${expansion//-/_}"
-		declare -f $completion_func >/dev/null && $completion_func
-	fi
-}
-
-__gitk_main ()
-{
-	__git_has_doubledash && return
-
-	local g="$(__gitdir)"
-	local merge=""
-	if [ -f "$g/MERGE_HEAD" ]; then
-		merge="--merge"
-	fi
-	case "$cur" in
-	--*)
-		__gitcomp "
-			$__git_log_common_options
-			$__git_log_gitk_options
-			$merge
-			"
-		return
-		;;
-	esac
-	__git_complete_revlist
-}
-
-if [[ -n ${ZSH_VERSION-} ]]; then
-	echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
-
-	autoload -U +X compinit && compinit
-
-	__gitcomp ()
-	{
-		emulate -L zsh
-
-		local cur_="${3-$cur}"
-
-		case "$cur_" in
-		--*=)
-			;;
-		*)
-			local c IFS=$' \t\n'
-			local -a array
-			for c in ${=1}; do
-				c="$c${4-}"
-				case $c in
-				--*=*|*.) ;;
-				*) c="$c " ;;
-				esac
-				array[$#array+1]="$c"
-			done
-			compset -P '*[=:]'
-			compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
-			;;
-		esac
-	}
-
-	__gitcomp_nl ()
-	{
-		emulate -L zsh
-
-		local IFS=$'\n'
-		compset -P '*[=:]'
-		compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
-	}
-
-	__gitcomp_file ()
-	{
-		emulate -L zsh
-
-		local IFS=$'\n'
-		compset -P '*[=:]'
-		compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
-	}
-
-	__git_zsh_helper ()
-	{
-		emulate -L ksh
-		local cur cword prev
-		cur=${words[CURRENT-1]}
-		prev=${words[CURRENT-2]}
-		let cword=CURRENT-1
-		__${service}_main
-	}
-
-	_git ()
-	{
-		emulate -L zsh
-		local _ret=1
-		__git_zsh_helper
-		let _ret && _default -S '' && _ret=0
-		return _ret
-	}
-
-	compdef _git git gitk
-	return
-elif [[ -n ${BASH_VERSION-} ]]; then
-	if ((${BASH_VERSINFO[0]} < 4)); then
-		# compopt is not supported
-		__git_index_file_list_filter ()
-		{
-			__git_index_file_list_filter_compat
-		}
-	fi
-fi
-
-__git_func_wrap ()
-{
-	local cur words cword prev
-	_get_comp_words_by_ref -n =: cur words cword prev
-	$1
-}
-
-# Setup completion for certain functions defined above by setting common
-# variables and workarounds.
-# This is NOT a public function; use at your own risk.
-__git_complete ()
-{
-	local wrapper="__git_wrap${2}"
-	eval "$wrapper () { __git_func_wrap $2 ; }"
-	complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
-		|| complete -o default -o nospace -F $wrapper $1
-}
-
-# wrapper for backwards compatibility
-_git ()
-{
-	__git_wrap__git_main
-}
-
-# wrapper for backwards compatibility
-_gitk ()
-{
-	__git_wrap__gitk_main
-}
-
-__git_complete git __git_main
-__git_complete gitk __gitk_main
-
-# The following are necessary only for Cygwin, and only are needed
-# when the user has tab-completed the executable name and consequently
-# included the '.exe' suffix.
-#
-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
-__git_complete git.exe __git_main
-fi
diff --git a/bash_completion/repo.bash b/bash_completion/repo.bash
deleted file mode 100644
index 9ae5e00..0000000
--- a/bash_completion/repo.bash
+++ /dev/null
@@ -1,655 +0,0 @@
-# -*- mode: sh; -*-
-
-declare -A CMD_HANDLERS
-CMD_HANDLERS=(
-    ["init"]=_repo_init
-    ["help"]=_repo_help
-    ["abandon"]=_repo_abandon
-    ["branch"]=_repo_branch
-    ["branches"]=_repo_branches
-    ["checkout"]=_repo_checkout
-    ["cherry-pick"]=_repo_cherry_pick
-    ["diff"]=_repo_diff
-    ["download"]=_repo_download
-    ["forall"]=_repo_forall
-    ["grep"]=_repo_grep
-    ["list"]=_repo_list
-    ["prune"]=_repo_prune
-    ["rebase"]=_repo_rebase
-    ["selfupdate"]=_repo_selfupdate
-    ["smartsync"]=_repo_smartsync
-    ["stage"]=_repo_stage
-    ["start"]=_repo_start
-    ["status"]=_repo_status
-    ["sync"]=_repo_sync
-    ["upload"]=_repo_upload
-    ["version"]=_repo_version
-)
-
-# To be populated by command handlers.
-declare -a OPTIONS
-declare -A ARG_OPTIONS
-
-declare cur
-declare prev
-
-_init_cur_prev() {
-    cur=$(_get_cword "=")
-    prev=$(_get_cword "=" 1)
-
-    _split_longopt
-}
-
-_find_repo() {
-    local dir=$(pwd)
-    local found=1
-
-    while [ "${dir}" != / ]
-    do
-        if [ -e "${dir}/.repo/repo/main.py" ]
-        then
-            found=0
-            break
-        fi
-
-        dir=$(cd "${dir}/.." && pwd)
-    done
-
-    if [ ${found} -eq 0 ]
-    then
-        echo "${dir}"
-    fi
-}
-
-_is_repo_dir() {
-    local repo_root=$(_find_repo)
-
-    [ -n "${repo_root}" ]
-}
-
-_gen_comps() {
-    local completions="$1"
-    local suffix="${2:- }"
-
-    local -i i
-    local -a tmp=( $(compgen -W "${completions}" -- ${cur}) )
-
-    for (( i=0; i < ${#tmp[*]}; i++ ))
-    do
-        tmp[$i]="${tmp[$i]}${suffix}"
-    done
-
-    COMPREPLY=(
-        "${COMPREPLY[@]}"
-        "${tmp[@]}"
-    )
-}
-
-_strip_colors () {
-    # taken from http://goo.gl/7KlLZ
-    sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
-}
-
-_no_completion() {
-    true
-}
-
-_command_completion() {
-    local cmds
-
-    if _is_repo_dir
-    then
-        cmds=("abandon" "branch" "branches" "checkout" "cherry-pick" "diff"
-            "download" "forall" "grep" "help" "init" "list" "prune" "rebase"
-            "selfupdate" "smartsync" "stage" "start" "status" "sync"
-            "upload" "version")
-    else
-        cmds=("help" "init")
-    fi
-
-    _gen_comps "${cmds[*]}"
-}
-
-_branch_completion() {
-    local raw_branches
-
-    # separate statement required to be able to access exit code
-    raw_branches=$(repo branches 2>/dev/null)
-
-    if [ $? -eq 0 ]
-    then
-        local branches=$(
-            echo "${raw_branches}" |
-            _strip_colors | awk 'BEGIN { FS="|" } { print $1 }' | cut -c 3-
-        )
-
-        _gen_comps "${branches}"
-    fi
-}
-
-_dir_completion() {
-    _filedir -d
-}
-
-_project_completion() {
-    local repo_root=$(_find_repo)
-
-    if [ -n "${repo_root}" -a -f "${repo_root}/.repo/project.list" ]
-    then
-        local projects=$(cat "${repo_root}/.repo/project.list")
-        _gen_comps "${projects}"
-    fi
-}
-
-_manifest_completion() {
-    local repo_root=$(_find_repo)
-
-    if [ -n "${repo_root}" ]
-    then
-        local manifests_dir="${repo_root}/.repo/manifests"
-        local git_dir="${manifests_dir}/.git"
-        local candidates
-
-        manifests=$(
-            git --git-dir "${git_dir}" ls-files "*.xml" 2>/dev/null)
-
-        if [ $? -eq 0 ]
-        then
-            _gen_comps "${manifests}"
-        fi
-    fi
-}
-
-_path_cmd_completion() {
-    _gen_comps "$(compgen -c ${cur})"
-}
-
-_is_option() {
-    local opt="$1"
-
-    [[ "${opt}" == -* ]]
-}
-
-_is_long_option() {
-    local opt="$1"
-
-    [[ "${opt}" == --* ]]
-}
-
-_expects_arg() {
-    local opt="$1"
-
-    if [[ ${ARG_OPTIONS[$opt]} ]]
-    then
-        return 0
-    else
-        return 1
-    fi
-}
-
-_handle_options() {
-    if _expects_arg "${prev}"
-    then
-        local handler=${ARG_OPTIONS[$prev]}
-        eval ${handler} "${cur}"
-    elif _is_option "${cur}"
-    then
-        _gen_comps "${OPTIONS[*]}"
-
-        local arg_short
-        local arg_long
-
-        for opt in "${!ARG_OPTIONS[@]}"
-        do
-            if _is_long_option "${opt}"
-            then
-                arg_long="${arg_long} ${opt}"
-            else
-                arg_short="${arg_short} ${opt}"
-            fi
-        done
-
-        _gen_comps "${arg_short}"
-        _gen_comps "${arg_long}" "="
-    else
-        return 1
-    fi
-
-    return 0
-}
-
-_is_known_shortopt() {
-    local needle="$1"
-
-    for opt in ${OPTIONS[@]}
-    do
-        if [ "${opt}" = "${needle}" ]
-        then
-            return 0
-        fi
-    done
-
-    return 1
-}
-
-_is_known_longopt() {
-    local needle="$1"
-
-    [[ ${ARG_OPTIONS[$1]} ]]
-}
-
-_arg_index() {
-    local -i i=2               # skip repo and command
-    local -i ix=0
-
-    while [ ${i} -lt ${COMP_CWORD} ]
-    do
-        if _is_known_shortopt "${COMP_WORDS[i]}"
-        then
-            i+=1
-        elif _is_known_longopt "${COMP_WORDS[i]}"
-        then
-            i+=2
-        elif _is_option "${COMP_WORDS[i]}"
-        then
-            i+=1
-        else
-            i+=1
-            ix+=1
-        fi
-    done
-
-    eval $1="${ix}"
-}
-
-_when_ix() {
-    local ix="$1"
-    local completion="$2"
-
-    _arg_index arg_ix
-
-    if [ ${arg_ix} -eq ${ix} ]
-    then
-        ${completion}
-        return 0
-    else
-        return 1
-    fi
-}
-
-_when_first() {
-    _when_ix 0 "$1"
-}
-
-_when_even() {
-    local completion="$1"
-
-    _arg_index arg_ix
-
-    if [ $(( ${arg_ix} % 2 )) -eq 0 ]
-    then
-        ${completion}
-        return 0
-    else
-        return 1
-    fi
-}
-
-_cmp_opts() {
-    local opt="$1"
-    local word="$2"
-
-    if _is_option "${opt}" && ! _is_long_option "${opt}"
-    then
-        [ "${word}" == "${opt}" ]
-    else
-        [[ "${word}" == "${opt}"=* || "${word}" == "${opt}" ]]
-    fi
-}
-
-_before() {
-    local completion="$1"
-    local words
-
-    shift
-
-    _get_comp_words_by_ref -n = words
-
-    for word in "${words[@]}"
-    do
-        for needle in "$@"
-        do
-            if _cmp_opts "${needle}" "${word}"
-            then
-                return 1
-            fi
-        done
-    done
-
-    ${completion}
-    return 0
-}
-
-_repo_init() {
-    OPTIONS=(
-        "-h" "--help"
-        "-q" "--quite"
-        "--mirror"
-        "--no-repo-verify"
-    )
-
-    ARG_OPTIONS=(
-        ["-u"]=_no_completion
-        ["--manifest-url"]=_no_completion
-        ["-b"]=_no_completion
-        ["--manifest-branch"]=_no_completion
-        ["-m"]=_manifest_completion
-        ["--manifest-name"]=_manifest_completion
-        ["--reference"]=_dir_completion
-        ["--repo-url"]=_no_completion
-        ["--repo-branch"]=_no_completion
-    )
-
-    _handle_options
-}
-
-_repo_help() {
-    OPTIONS=(
-        "-a" "--all"
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _when_first _command_completion
-}
-
-_repo_abandon() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _when_first _branch_completion || _project_completion
-}
-
-_repo_branch() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options
-}
-
-_repo_branches() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options
-}
-
-_repo_checkout() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _when_first _branch_completion || _project_completion
-}
-
-_repo_cherry_pick() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options
-}
-
-_repo_diff() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _project_completion
-}
-
-_repo_download() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _when_even _project_completion
-}
-
-_repo_forall() {
-    OPTIONS=(
-        "-h" "--help"
-        "-p"
-        "-v" "--verbose"
-    )
-
-    ARG_OPTIONS=(
-        ["-c"]=_path_cmd_completion
-        ["--command"]=_path_cmd_completion
-    )
-
-    _handle_options || _before _project_completion -c --command || _filedir
-}
-
-_repo_grep() {
-    OPTIONS=(
-        "-h" "--help"
-        "--cached"
-        "-r" "--revision"
-        "-i" "--ignore-case"
-        "-a" "--text"
-        "-I"
-        "-w" "--word-regexp"
-        "-v" "--invert-match"
-        "-G" "--basic-regexp"
-        "-E" "--extended-regexp"
-        "-F" "--fixed-strings"
-        "--all-match"
-        "--and" "--or" "--not"
-        "-(" "-)"
-        "-n"
-        "-l" "--name-only" "--files-with-matches"
-        "-L" "--files-without-match"
-    )
-
-    ARG_OPTIONS=(
-        ["-e"]=_no_completion
-        ["-C"]=_no_completion
-        ["-B"]=_no_completion
-        ["-A"]=_no_completion
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_list() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _project_completion
-}
-
-_repo_prune() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _project_completion
-}
-
-_repo_rebase() {
-    OPTIONS=(
-        "-h" "--help"
-        "-i" "--interactive"
-        "-f" "--force-rebase"
-        "--no-ff"
-        "-q" "--quiet"
-        "--autosquash"
-    )
-
-    ARG_OPTIONS=(
-        ["--whitespace"]=_no_completion
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_selfupdate() {
-    OPTIONS=(
-        "-h" "--help"
-        "--no-repo-verify"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options
-}
-
-_repo_smartsync() {
-    OPTIONS=(
-        "-h" "--help"
-        "-f" "--force-broken"
-        "-l" "--local-only"
-        "-n" "--network-only"
-        "-d" "--detach"
-        "-q" "--quiet"
-        "--no-repo-verify"
-    )
-
-    ARG_OPTIONS=(
-        ["-j"]=_no_completion
-        ["--jobs"]=_no_completion
-
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_stage() {
-    OPTIONS=(
-        "-h" "--help"
-        "-i" "--interactive"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _project_completion
-}
-
-_repo_start() {
-    OPTIONS=(
-        "-h" "--help"
-        "--all"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options || _when_first _branch_completion || _project_completion
-}
-
-_repo_status() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=(
-        ["-j"]=_no_completion
-        ["--jobs"]=_no_completion
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_sync() {
-    OPTIONS=(
-        "-h" "--help"
-        "-f" "--force-broken"
-             "--force-sync"
-        "-l" "--local-only"
-        "-n" "--network-only"
-        "-d" "--detach"
-        "-q" "--quiet"
-        "-s" "--smart-sync"
-        "--no-repo-verify"
-    )
-
-    ARG_OPTIONS=(
-        ["-j"]=_no_completion
-        ["--jobs"]=_no_completion
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_upload() {
-    OPTIONS=(
-        "-h" "--help"
-        "-t"
-        "--no-verify"
-        "--verify"
-    )
-
-    ARG_OPTIONS=(
-        ["--re"]=_no_completion
-        ["--reviewers"]=_no_completion
-        ["--cc"]=_no_completion
-        ["--br"]=_branch_completion
-    )
-
-    _handle_options || _project_completion
-}
-
-_repo_version() {
-    OPTIONS=(
-        "-h" "--help"
-    )
-
-    ARG_OPTIONS=()
-
-    _handle_options
-}
-
-_repo() {
-    COMPREPLY=()
-
-    _init_cur_prev
-
-    if [ ${COMP_CWORD} -eq 1 ]
-    then
-        _command_completion
-    else
-        local cmd=${COMP_WORDS[1]}
-        local handler=${CMD_HANDLERS["${cmd}"]}
-        if [ -n ${handler} ]
-        then
-            eval ${handler}
-        fi
-    fi
-
-    return 0
-}
-
-complete -o nospace -F _repo repo
diff --git a/bootanimation/Android.mk b/bootanimation/Android.mk
deleted file mode 100644
index 7eaf96c..0000000
--- a/bootanimation/Android.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Copyright (C) 2016 The CyanogenMod Project
-#               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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-ifeq ($(TARGET_SCREEN_WIDTH),)
-    $(warning TARGET_SCREEN_WIDTH is not set, using default value: 1080)
-    TARGET_SCREEN_WIDTH := 1080
-endif
-ifeq ($(TARGET_SCREEN_HEIGHT),)
-    $(warning TARGET_SCREEN_HEIGHT is not set, using default value: 1920)
-    TARGET_SCREEN_HEIGHT := 1920
-endif
-
-define build-bootanimation
-    $(shell) vendor/lineage/bootanimation/generate-bootanimation.sh \
-    $(PRODUCT_OUT) \
-    $(TARGET_SCREEN_WIDTH) \
-    $(TARGET_SCREEN_HEIGHT) \
-    $(TARGET_BOOTANIMATION_HALF_RES)
-endef
-
-TARGET_GENERATED_BOOTANIMATION := $(TARGET_OUT_INTERMEDIATES)/BOOTANIMATION/bootanimation.zip
-$(TARGET_GENERATED_BOOTANIMATION):
-	@echo "Building bootanimation"
-	$(build-bootanimation)
-
-ifeq ($(TARGET_BOOTANIMATION),)
-    TARGET_BOOTANIMATION := $(TARGET_GENERATED_BOOTANIMATION)
-    ifeq ($(shell command -v mogrify),)
-        $(info **********************************************)
-        $(info The boot animation could not be generated as)
-        $(info ImageMagick is not installed in your system.)
-        $(info $(space))
-        $(info Please install ImageMagick from this website:)
-        $(info https://imagemagick.org/script/binary-releases.php)
-        $(info **********************************************)
-        $(error stop)
-    endif
-endif
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := bootanimation.zip
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT)/media
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(TARGET_BOOTANIMATION)
-	@mkdir -p $(dir $@)
-	@cp $(TARGET_BOOTANIMATION) $@
diff --git a/bootanimation/CleanSpec.mk b/bootanimation/CleanSpec.mk
deleted file mode 100644
index a32a883..0000000
--- a/bootanimation/CleanSpec.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# 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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/BOOTANIMATION)
diff --git a/bootanimation/bootanimation.tar b/bootanimation/bootanimation.tar
deleted file mode 100644
index 7e4b0dc..0000000
--- a/bootanimation/bootanimation.tar
+++ /dev/null
Binary files differ
diff --git a/bootanimation/desc.txt b/bootanimation/desc.txt
deleted file mode 100644
index 5ddacd6..0000000
--- a/bootanimation/desc.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-c 1 0 part0
-c 0 0 part1
-c 1 0 part2
-c 1 1 part3
-c 1 0 part4
diff --git a/bootanimation/generate-bootanimation.sh b/bootanimation/generate-bootanimation.sh
deleted file mode 100755
index 41d8c02..0000000
--- a/bootanimation/generate-bootanimation.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-PRODUCT_OUT="$1"
-WIDTH="$2"
-HEIGHT="$3"
-HALF_RES="$4"
-
-OUT="$PRODUCT_OUT/obj/BOOTANIMATION"
-
-if [ "$HEIGHT" -lt "$WIDTH" ]; then
-    IMAGEWIDTH="$HEIGHT"
-else
-    IMAGEWIDTH="$WIDTH"
-fi
-
-IMAGESCALEWIDTH="$IMAGEWIDTH"
-IMAGESCALEHEIGHT=$(expr $IMAGESCALEWIDTH / 3)
-
-if [ "$HALF_RES" = "true" ]; then
-    IMAGEWIDTH=$(expr $IMAGEWIDTH / 2)
-fi
-
-IMAGEHEIGHT=$(expr $IMAGEWIDTH / 3)
-
-RESOLUTION=""$IMAGEWIDTH"x"$IMAGEHEIGHT""
-
-for part_cnt in 0 1 2 3 4
-do
-    mkdir -p "$OUT/bootanimation/part$part_cnt"
-done
-tar xfp "vendor/lineage/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/"
-mogrify -resize $RESOLUTION -colors 250 "$OUT/bootanimation/"*"/"*".png"
-
-# Create desc.txt
-echo "$IMAGESCALEWIDTH $IMAGESCALEHEIGHT" 60 > "$OUT/bootanimation/desc.txt"
-cat "vendor/lineage/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
-
-# Create bootanimation.zip
-cd "$OUT/bootanimation"
-
-zip -qr0 "$OUT/bootanimation.zip" .
diff --git a/build/core/clear_vars.mk b/build/core/clear_vars.mk
index 1d8135c..3711fb2 100644
--- a/build/core/clear_vars.mk
+++ b/build/core/clear_vars.mk
@@ -1,4 +1,4 @@
 #
-# Lineage-specific variable clears
+# Bliss-specific variable clears
 #
 LOCAL_IGNORE_SUBDIR :=
diff --git a/build/core/config.mk b/build/core/config.mk
index 3bf8e2c..901cadc 100644
--- a/build/core/config.mk
+++ b/build/core/config.mk
@@ -18,9 +18,9 @@
 INTERNAL_LINEAGE_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/lineage_removed.txt
 FRAMEWORK_LINEAGE_PLATFORM_API_FILE := $(TOPDIR)lineage-sdk/api/lineage_current.txt
 FRAMEWORK_LINEAGE_PLATFORM_REMOVED_API_FILE := $(TOPDIR)lineage-sdk/api/lineage_removed.txt
-FRAMEWORK_LINEAGE_API_NEEDS_UPDATE_TEXT := $(TOPDIR)vendor/lineage/build/core/apicheck_msg_current.txt
+FRAMEWORK_LINEAGE_API_NEEDS_UPDATE_TEXT := $(TOPDIR)vendor/bliss/build/core/apicheck_msg_current.txt
 
-BUILD_RRO_SYSTEM_PACKAGE := $(TOPDIR)vendor/lineage/build/core/system_rro.mk
+BUILD_RRO_SYSTEM_PACKAGE := $(TOPDIR)vendor/bliss/build/core/system_rro.mk
 
 # Rules for QCOM targets
-include $(TOPDIR)vendor/lineage/build/core/qcom_target.mk
+include $(TOPDIR)vendor/bliss/build/core/qcom_target.mk
diff --git a/build/core/definitions.mk b/build/core/definitions.mk
index 82ed55d..eadb69c 100644
--- a/build/core/definitions.mk
+++ b/build/core/definitions.mk
@@ -1,12 +1,12 @@
 #
-# Lineage-specific macros
+# Bliss-specific macros
 #
 define uniq
 $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 endef
 
 # Include board/platform macros
-include vendor/lineage/build/core/utils.mk
+include vendor/bliss/build/core/utils.mk
 
 # Include vendor platform definitions
-include vendor/lineage/build/core/vendor/*.mk
+include vendor/bliss/build/core/vendor/*.mk
diff --git a/build/core/main.mk b/build/core/main.mk
index 0793b8a..5582a7f 100644
--- a/build/core/main.mk
+++ b/build/core/main.mk
@@ -1,2 +1,2 @@
-# Include LineageOS versions
-include $(TOPDIR)vendor/lineage/build/core/main_version.mk
+# Include Bliss versions
+include $(TOPDIR)vendor/bliss/build/core/main_version.mk
diff --git a/build/core/main_version.mk b/build/core/main_version.mk
index 96213b0..8ade967 100644
--- a/build/core/main_version.mk
+++ b/build/core/main_version.mk
@@ -1,15 +1,3 @@
-# LineageOS System Version
-ADDITIONAL_BUILD_PROPERTIES += \
-    ro.lineage.version=$(LINEAGE_VERSION) \
-    ro.lineage.releasetype=$(LINEAGE_BUILDTYPE) \
-    ro.lineage.build.version=$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR) \
-    ro.modversion=$(LINEAGE_VERSION) \
-    ro.lineagelegal.url=https://lineageos.org/legal
-
-# LineageOS Platform Display Version
-ADDITIONAL_BUILD_PROPERTIES += \
-    ro.lineage.display.version=$(LINEAGE_DISPLAY_VERSION)
-
 # LineageOS Platform SDK Version
 ADDITIONAL_BUILD_PROPERTIES += \
     ro.lineage.build.version.plat.sdk=$(LINEAGE_PLATFORM_SDK_VERSION)
diff --git a/build/envsetup.sh b/build/envsetup.sh
index b80b07b..7530e99 100644
--- a/build/envsetup.sh
+++ b/build/envsetup.sh
@@ -1,16 +1,16 @@
-function __print_lineage_functions_help() {
+function __print_bliss_functions_help() {
 cat <<EOF
-Additional LineageOS functions:
+Additional Bliss functions:
 - cout:            Changes directory to out.
 - mmp:             Builds all of the modules in the current directory and pushes them to the device.
 - mmap:            Builds all of the modules in the current directory and its dependencies, then pushes the package to the device.
 - mmmp:            Builds all of the modules in the supplied directories and pushes them to the device.
-- lineagegerrit:   A Git wrapper that fetches/pushes patch from/to LineageOS Gerrit Review.
-- lineagerebase:   Rebase a Gerrit change and push it again.
-- lineageremote:   Add git remote for LineageOS Gerrit Review.
+- blissgerrit:   A Git wrapper that fetches/pushes patch from/to BlissRoms Gerrit Review.
+- blissrebase:   Rebase a Gerrit change and push it again.
+- blissremote:   Add git remote for BlissRoms Gerrit Review.
 - aospremote:      Add git remote for matching AOSP repository.
 - cafremote:       Add git remote for matching CodeAurora repository.
-- githubremote:    Add git remote for LineageOS Github.
+- githubremote:    Add git remote for BlissRoms Github.
 - mka:             Builds using SCHED_BATCH on all processors.
 - mkap:            Builds the module(s) using mka and pushes them to the device.
 - cmka:            Cleans and builds using mka.
@@ -68,10 +68,10 @@
 {
     target=$1
     local variant=$2
-    LINEAGE_DEVICES_ONLY="true"
+    BLISS_DEVICES_ONLY="true"
     unset LUNCH_MENU_CHOICES
     add_lunch_combo full-eng
-    for f in `/bin/ls vendor/lineage/vendorsetup.sh 2> /dev/null`
+    for f in `/bin/ls vendor/bliss/vendorsetup.sh 2> /dev/null`
         do
             echo "including $f"
             . $f
@@ -87,12 +87,12 @@
             # A buildtype was specified, assume a full device name
             lunch $target
         else
-            # This is probably just the Lineage model name
+            # This is probably just the Bliss model name
             if [ -z "$variant" ]; then
                 variant="userdebug"
             fi
 
-            lunch lineage_$target-$variant
+            lunch bliss_$target-$variant
         fi
     fi
     return $?
@@ -103,7 +103,7 @@
 function eat()
 {
     if [ "$OUT" ] ; then
-        ZIPPATH=`ls -tr "$OUT"/lineage-*.zip | tail -1`
+        ZIPPATH=`ls -tr "$OUT"/Bliss-*.zip | tail -1`
         if [ ! -f $ZIPPATH ] ; then
             echo "Nothing to eat"
             return 1
@@ -117,7 +117,7 @@
             done
             echo "Device Found.."
         fi
-        if (adb shell getprop ro.lineage.device | grep -q "$LINEAGE_BUILD"); then
+        if (adb shell getprop ro.bliss.device | grep -q "$BLISS_BUILD"); then
             # if adbd isn't root we can't write to /cache/recovery/
             adb root
             sleep 1
@@ -133,7 +133,7 @@
             fi
             rm /tmp/command
         else
-            echo "The connected device does not appear to be $LINEAGE_BUILD, run away!"
+            echo "The connected device does not appear to be $BLISS_BUILD, run away!"
         fi
         return $?
     else
@@ -257,36 +257,36 @@
    fi
 }
 
-function lineageremote()
+function blissremote()
 {
     if ! git rev-parse --git-dir &> /dev/null
     then
         echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up."
         return 1
     fi
-    git remote rm lineage 2> /dev/null
+    git remote rm bliss 2> /dev/null
     local REMOTE=$(git config --get remote.github.projectname)
-    local LINEAGE="true"
+    local BLISS="true"
     if [ -z "$REMOTE" ]
     then
         REMOTE=$(git config --get remote.aosp.projectname)
-        LINEAGE="false"
+        BLISS="false"
     fi
     if [ -z "$REMOTE" ]
     then
         REMOTE=$(git config --get remote.caf.projectname)
-        LINEAGE="false"
+        BLISS="false"
     fi
 
-    if [ $LINEAGE = "false" ]
+    if [ $BLISS = "false" ]
     then
         local PROJECT=$(echo $REMOTE | sed -e "s#platform/#android/#g; s#/#_#g")
-        local PFX="LineageOS/"
+        local PFX="BlissRoms/"
     else
         local PROJECT=$REMOTE
     fi
 
-    local LINEAGE_USER=$(git config --get review.review.lineageos.org.username)
+    local BLISS_USER=$(git config --get review.review.lineageos.org.username)
     if [ -z "$LINEAGE_USER" ]
     then
         git remote add lineage ssh://review.lineageos.org:29418/$PFX$PROJECT
@@ -361,7 +361,7 @@
 
     local PROJECT=$(echo $REMOTE | sed -e "s#platform/#android/#g; s#/#_#g")
 
-    git remote add github https://github.com/LineageOS/$PROJECT
+    git remote add github https://github.com/BlissRoms/$PROJECT
     echo "Remote 'github' created"
 }
 
@@ -395,7 +395,7 @@
     sleep 1
     adb wait-for-online shell mount /system 2>&1 > /dev/null
     adb wait-for-online remount
-    if (adb shell getprop ro.lineage.device | grep -q "$LINEAGE_BUILD");
+    if (adb shell getprop ro.bliss.device | grep -q "$BLISS_BUILD");
     then
         adb push $OUT/boot.img /cache/
         if [ -e "$OUT/system/lib/modules/*" ];
@@ -410,7 +410,7 @@
         adb shell rm -rf /cache/boot.img
         echo "Installation complete."
     else
-        echo "The connected device does not appear to be $LINEAGE_BUILD, run away!"
+        echo "The connected device does not appear to be $BLISS_BUILD, run away!"
     fi
 }
 
@@ -444,14 +444,14 @@
     sleep 1
     adb wait-for-online shell mount /system 2>&1 >> /dev/null
     adb wait-for-online remount
-    if (adb shell getprop ro.lineage.device | grep -q "$LINEAGE_BUILD");
+    if (adb shell getprop ro.bliss.device | grep -q "$BLISS_BUILD");
     then
         adb push $OUT/recovery.img /cache/
         adb shell dd if=/cache/recovery.img of=$PARTITION
         adb shell rm -rf /cache/recovery.img
         echo "Installation complete."
     else
-        echo "The connected device does not appear to be $LINEAGE_BUILD, run away!"
+        echo "The connected device does not appear to be $BLISS_BUILD, run away!"
     fi
 }
 
@@ -471,13 +471,13 @@
     if [ "$REPO_REMOTE" = "github" ]
     then
         pwd
-        lineageremote
-        git push lineage HEAD:refs/heads/'$1'
+        blissremote
+        git push bliss HEAD:refs/heads/'$1'
     fi
     '
 }
 
-function lineagegerrit() {
+function blissgerrit() {
     if [ "$(__detect_shell)" = "zsh" ]; then
         # zsh does not define FUNCNAME, derive from funcstack
         local FUNCNAME=$funcstack[1]
@@ -715,7 +715,7 @@
     esac
 }
 
-function lineagerebase() {
+function blissrebase() {
     local repo=$1
     local refs=$2
     local pwd="$(pwd)"
@@ -829,7 +829,7 @@
         echo "Device Found."
     fi
 
-    if (adb shell getprop ro.lineage.device | grep -q "$LINEAGE_BUILD") || [ "$FORCE_PUSH" = "true" ];
+    if (adb shell getprop ro.bliss.device | grep -q "$BLISS_BUILD") || [ "$FORCE_PUSH" = "true" ];
     then
     # retrieve IP and PORT info if we're using a TCP connection
     TCPIPPORT=$(adb devices \
@@ -947,7 +947,7 @@
     rm -f $OUT/.log
     return 0
     else
-        echo "The connected device does not appear to be $LINEAGE_BUILD, run away!"
+        echo "The connected device does not appear to be $BLISS_BUILD, run away!"
     fi
 }
 
@@ -960,13 +960,13 @@
 
 function repopick() {
     T=$(gettop)
-    $T/vendor/lineage/build/tools/repopick.py $@
+    $T/vendor/bliss/build/tools/repopick.py $@
 }
 
 function fixup_common_out_dir() {
     common_out_dir=$(get_build_var OUT_DIR)/target/common
     target_device=$(get_build_var TARGET_DEVICE)
-    if [ ! -z $LINEAGE_FIXUP_COMMON_OUT ]; then
+    if [ ! -z $BLISS_FIXUP_COMMON_OUT ]; then
         if [ -d ${common_out_dir} ] && [ ! -L ${common_out_dir} ]; then
             mv ${common_out_dir} ${common_out_dir}-${target_device}
             ln -s ${common_out_dir}-${target_device} ${common_out_dir}
@@ -991,7 +991,7 @@
             export SDCLANG=true
             export SDCLANG_PATH=$(gettop)/prebuilts/snapdragon-llvm/toolchains/llvm-Snapdragon_LLVM_for_Android_4.0/prebuilt/linux-x86_64/bin
             export SDCLANG_PATH_2=$(gettop)/prebuilts/snapdragon-llvm/toolchains/llvm-Snapdragon_LLVM_for_Android_4.0/prebuilt/linux-x86_64/bin
-            export SDCLANG_LTO_DEFS=$(gettop)/vendor/lineage/build/core/sdllvm-lto-defs.mk
+            export SDCLANG_LTO_DEFS=$(gettop)/vendor/bliss/build/core/sdllvm-lto-defs.mk
             ;;
     esac
 fi
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
index 382b68e..50b3672 100644
--- a/build/soong/Android.bp
+++ b/build/soong/Android.bp
@@ -1,6 +1,6 @@
 bootstrap_go_package {
-    name: "soong-lineage",
-    pkgPath: "lineage/soong/android",
+    name: "soong-bliss",
+    pkgPath: "bliss/soong/android",
     srcs: [
         "android/config.go",
         "android/variable.go",
@@ -8,8 +8,8 @@
 }
 
 bootstrap_go_package {
-    name: "soong-lineage-generator",
-    pkgPath: "lineage/soong/generator",
+    name: "soong-bliss-generator",
+    pkgPath: "bliss/soong/generator",
     deps: [
         "blueprint",
         "blueprint-pathtools",
@@ -24,7 +24,7 @@
     pluginFor: ["soong_build"],
 }
 
-lineage_generator {
+bliss_generator {
     name: "generated_kernel_includes",
 
     // The headers make command
diff --git a/build/soong/android/config.go b/build/soong/android/config.go
index e926c9d..3b4d6d0 100644
--- a/build/soong/android/config.go
+++ b/build/soong/android/config.go
@@ -1,7 +1,7 @@
 package android
 
-// Global config used by Lineage soong additions
-var LineageConfig = struct {
+// Global config used by Bliss soong additions
+var BlissConfig = struct {
 	// List of packages that are permitted
 	// for java source overlays.
 	JavaSourceOverlayModuleWhitelist []string
diff --git a/build/soong/generator/generator.go b/build/soong/generator/generator.go
index 7da1fde..ffaece3 100644
--- a/build/soong/generator/generator.go
+++ b/build/soong/generator/generator.go
@@ -29,7 +29,7 @@
 )
 
 func init() {
-	android.RegisterModuleType("lineage_generator", GeneratorFactory)
+	android.RegisterModuleType("bliss_generator", GeneratorFactory)
 
 	pctx.HostBinToolVariable("sboxCmd", "sbox")
 }
@@ -214,12 +214,12 @@
 	if depRoot == "" {
 		depRoot = ctx.ModuleDir()
 	} else {
-		depRoot = lineageExpandVariables(ctx, depRoot)
+		depRoot = blissExpandVariables(ctx, depRoot)
 	}
 
 	// Glob dep_files property
 	for _, dep_file := range g.properties.Dep_files {
-		dep_file = lineageExpandVariables(ctx, dep_file)
+		dep_file = blissExpandVariables(ctx, dep_file)
 		globPath := filepath.Join(depRoot, dep_file)
 		paths, err := ctx.GlobWithDeps(globPath, nil)
 		if err != nil {
@@ -231,7 +231,7 @@
 		}
 	}
 
-	cmd := lineageExpandVariables(ctx, String(g.properties.Cmd))
+	cmd := blissExpandVariables(ctx, String(g.properties.Cmd))
 
 	rawCommand, err := android.Expand(cmd, func(name string) (string, error) {
 		switch name {
diff --git a/build/soong/generator/variables.go b/build/soong/generator/variables.go
index 8485f94..3e633ff 100644
--- a/build/soong/generator/variables.go
+++ b/build/soong/generator/variables.go
@@ -6,12 +6,12 @@
 	"android/soong/android"
 )
 
-func lineageExpandVariables(ctx android.ModuleContext, in string) string {
-	lineageVars := ctx.Config().VendorConfig("lineageVarsPlugin")
+func blissExpandVariables(ctx android.ModuleContext, in string) string {
+	blissVars := ctx.Config().VendorConfig("blissVarsPlugin")
 
 	out, err := android.Expand(in, func(name string) (string, error) {
-		if lineageVars.IsSet(name) {
-			return lineageVars.String(name), nil
+		if blissVars.IsSet(name) {
+			return blissVars.String(name), nil
 		}
 		// This variable is not for us, restore what the original
 		// variable string will have looked like for an Expand
diff --git a/build/soong/soong_config.mk b/build/soong/soong_config.mk
index f421c58..9b94482 100644
--- a/build/soong/soong_config.mk
+++ b/build/soong/soong_config.mk
@@ -1,7 +1,7 @@
 add_json_str_omitempty = $(if $(strip $(2)),$(call add_json_str, $(1), $(2)))
 add_json_val_default = $(call add_json_val, $(1), $(if $(strip $(2)), $(2), $(3)))
 
-_contents := $(_contents)    "Lineage":{$(newline)
+_contents := $(_contents)    "Bliss":{$(newline)
 
 # See build/core/soong_config.mk for the add_json_* functions you can use here.
 $(call add_json_str_omitempty, Additional_gralloc_10_usage_bits, $(TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS))
diff --git a/build/target/product/AndroidProducts.mk b/build/target/product/AndroidProducts.mk
index d585d68..65ff665 100644
--- a/build/target/product/AndroidProducts.mk
+++ b/build/target/product/AndroidProducts.mk
@@ -15,6 +15,6 @@
 #
 
 PRODUCT_MAKEFILES := \
-    $(LOCAL_DIR)/lineage_arm.mk \
-    $(LOCAL_DIR)/lineage_arm64.mk \
-    $(LOCAL_DIR)/lineage_x86.mk
+    $(LOCAL_DIR)/bliss_arm.mk \
+    $(LOCAL_DIR)/bliss_arm64.mk \
+    $(LOCAL_DIR)/bliss_x86.mk
diff --git a/build/target/product/lineage_arm.mk b/build/target/product/bliss_arm.mk
similarity index 89%
rename from build/target/product/lineage_arm.mk
rename to build/target/product/bliss_arm.mk
index 4ce098e..d905e8c 100644
--- a/build/target/product/lineage_arm.mk
+++ b/build/target/product/bliss_arm.mk
@@ -13,11 +13,11 @@
 # limitations under the License.
 
 $(call inherit-product, build/target/product/aosp_arm.mk)
-$(call inherit-product, vendor/lineage/config/common.mk)
+$(call inherit-product, vendor/bliss/config/common.mk)
 
 # Allow building otatools
 TARGET_FORCE_OTA_PACKAGE := true
 
 TARGET_USES_64_BIT_BINDER := true
 
-PRODUCT_NAME := lineage_arm
+PRODUCT_NAME := bliss_arm
diff --git a/build/target/product/lineage_arm64.mk b/build/target/product/bliss_arm64.mk
similarity index 88%
rename from build/target/product/lineage_arm64.mk
rename to build/target/product/bliss_arm64.mk
index d2d0bc0..5d63889 100644
--- a/build/target/product/lineage_arm64.mk
+++ b/build/target/product/bliss_arm64.mk
@@ -13,9 +13,9 @@
 # limitations under the License.
 
 $(call inherit-product, build/target/product/aosp_arm64.mk)
-$(call inherit-product, vendor/lineage/config/common.mk)
+$(call inherit-product, vendor/bliss/config/common.mk)
 
 # Allow building otatools
 TARGET_FORCE_OTA_PACKAGE := true
 
-PRODUCT_NAME := lineage_arm64
+PRODUCT_NAME := bliss_arm64
diff --git a/build/target/product/lineage_x86.mk b/build/target/product/bliss_x86.mk
similarity index 89%
rename from build/target/product/lineage_x86.mk
rename to build/target/product/bliss_x86.mk
index 51cf752..6fb689b 100644
--- a/build/target/product/lineage_x86.mk
+++ b/build/target/product/bliss_x86.mk
@@ -13,11 +13,11 @@
 # limitations under the License.
 
 $(call inherit-product, build/target/product/aosp_x86.mk)
-$(call inherit-product, vendor/lineage/config/common.mk)
+$(call inherit-product, vendor/bliss/config/common.mk)
 
 # Allow building otatools
 TARGET_FORCE_OTA_PACKAGE := true
 
 TARGET_USES_64_BIT_BINDER := true
 
-PRODUCT_NAME := lineage_x86
+PRODUCT_NAME := bliss_x86
diff --git a/build/target/product/security/lineage.x509.pem b/build/target/product/security/lineage.x509.pem
deleted file mode 100644
index edbe469..0000000
--- a/build/target/product/security/lineage.x509.pem
+++ /dev/null
@@ -1,23 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDszCCApugAwIBAgIJAOEEE8dzw8VPMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
-BAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRIw
-EAYDVQQKDAlMaW5lYWdlT1MxEjAQBgNVBAsMCUxpbmVhZ2VPUzESMBAGA1UEAwwJ
-TGluZWFnZU9TMB4XDTE3MDEwNzA0MjEyNVoXDTQ0MDUyNTA0MjEyNVowcDELMAkG
-A1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUx
-EjAQBgNVBAoMCUxpbmVhZ2VPUzESMBAGA1UECwwJTGluZWFnZU9TMRIwEAYDVQQD
-DAlMaW5lYWdlT1MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmTdPh
-+EIDj/A/Z7jpvwlTD8KRPLU+NlTHjsINvIsecRNijKWrwIYFYMtELBtR+Yttzl5Z
-xJA38n9k9IrvBJCrmRBvCAeiEw4aizqs2DTmVvCFS2Amd7ZsAHsUwtDCjQ3GE0He
-ZI2HnbWannnhKIhzGjuxxh+1j3JawHHeErYQk97MVoWsJHTO4s8i8ORL8ghBDZHF
-0fYKp5RVSIIrrXVqcOD+F8g/NeX6Wb5N0rRGBI+bQjMhhv8KpH7TnCEN6f2YHFVx
-nsjzDKrEQVwhYF8T9X0OzfBoLEhOlFZ0jevoDi8uCxz0f7ldkv/0Zz4W9jeB87LH
-zUuQQEGr6134UFmZAgMBAAGjUDBOMB0GA1UdDgQWBBRyljIn1mxMTV+gkWrCLHk8
-1F9DXDAfBgNVHSMEGDAWgBRyljIn1mxMTV+gkWrCLHk81F9DXDAMBgNVHRMEBTAD
-AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCKJH4ByccucWfewkmT8j9TnAdhjCgZ7k0+
-rpbSgxc66+ESRpQFxMSAUu8exy8pSawGd7SerFBVvqL+dajdPfyLPM+I+xDEoMJ3
-ncKGHoC0RRKMGEhc4rS090/wOJJHZZtThlcjdND5vybMwmHngzl8o4CNWhneJvjb
-hNkqxocrC9vGCsdo5Kx00ULn8sXVwcq7yl0bqtuSMlKxm6CVA3DVVnB8N8OZyTam
-fgj9F0jOpWVtit1/ohd+1jB5bY3g+ulXCydKBFkJhNXAZf4welNG61SWLkH1gNGk
-SEYxEuLV9JGjm7n5oqDKxYVcKKNfvbGtSmrqsq6i+QVuc/xIdzfr
------END CERTIFICATE-----
-
diff --git a/build/tasks/addonsu.mk b/build/tasks/addonsu.mk
deleted file mode 100644
index 8f96387..0000000
--- a/build/tasks/addonsu.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-ADDONSU_PREBUILTS_PATH := vendor/lineage/addonsu/
-
-ADDONSU_INSTALL_OUT := $(PRODUCT_OUT)/addonsu-install/
-ADDONSU_INSTALL_TARGET := $(PRODUCT_OUT)/addonsu-$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_ARCH).zip
-
-$(ADDONSU_INSTALL_TARGET): $(ALL_MODULES.updater.BUILT) \
-		$(ALL_MODULES.su.BUILT) $(ALL_MODULES.su.PATH)/superuser.rc
-	$(hide) rm -rf $@ $(ADDONSU_INSTALL_OUT)
-	$(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/
-	$(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/xbin
-	$(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/addon.d
-	$(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/etc/init
-	$(hide) cp $(ALL_MODULES.su.BUILT) $(ADDONSU_INSTALL_OUT)/system/xbin/
-	$(hide) cp $(ALL_MODULES.su.PATH)/superuser.rc $(ADDONSU_INSTALL_OUT)/system/etc/init/
-	$(hide) cp $(ALL_MODULES.updater.BUILT) $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/update-binary
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/51-addonsu.sh $(ADDONSU_INSTALL_OUT)/system/addon.d/
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/mount-system.sh $(ADDONSU_INSTALL_OUT)/
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/unmount-system.sh $(ADDONSU_INSTALL_OUT)/
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-install $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/updater-script
-	$(hide) (cd $(ADDONSU_INSTALL_OUT) && zip -qr $@ *)
-
-.PHONY: addonsu
-addonsu: $(ADDONSU_INSTALL_TARGET)
-	@echo "Done: $(ADDONSU_INSTALL_TARGET)"
-
-
-ADDONSU_REMOVE_OUT := $(PRODUCT_OUT)/addonsu-remove/
-ADDONSU_REMOVE_TARGET := $(PRODUCT_OUT)/addonsu-remove-$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_ARCH).zip
-
-$(ADDONSU_REMOVE_TARGET): $(ALL_MODULES.updater.BUILT)
-	$(hide) rm -rf $@ $(ADDONSU_REMOVE_OUT)
-	$(hide) mkdir -p $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/
-	$(hide) cp $(ALL_MODULES.updater.BUILT) $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/update-binary
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/mount-system.sh $(ADDONSU_REMOVE_OUT)/
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/unmount-system.sh $(ADDONSU_REMOVE_OUT)/
-	$(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-remove $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/updater-script
-	$(hide) (cd $(ADDONSU_REMOVE_OUT) && zip -qr $@ *)
-
-.PHONY: addonsu-remove
-addonsu-remove: $(ADDONSU_REMOVE_TARGET)
-	@echo "Done: $(ADDONSU_REMOVE_TARGET)"
diff --git a/build/tasks/bacon.mk b/build/tasks/bacon.mk
deleted file mode 100644
index f018440..0000000
--- a/build/tasks/bacon.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2017 Unlegacy-Android
-# 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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# -----------------------------------------------------------------
-# Lineage OTA update package
-
-LINEAGE_TARGET_PACKAGE := $(PRODUCT_OUT)/lineage-$(LINEAGE_VERSION).zip
-
-.PHONY: bacon
-bacon: $(INTERNAL_OTA_PACKAGE_TARGET)
-	$(hide) ln -f $(INTERNAL_OTA_PACKAGE_TARGET) $(LINEAGE_TARGET_PACKAGE)
-	$(hide) $(MD5SUM) $(LINEAGE_TARGET_PACKAGE) | sed "s|$(PRODUCT_OUT)/||" > $(LINEAGE_TARGET_PACKAGE).md5sum
-	@echo "Package Complete: $(LINEAGE_TARGET_PACKAGE)" >&2
diff --git a/build/templates/extract-files.sh b/build/templates/extract-files.sh
deleted file mode 100755
index fede670..0000000
--- a/build/templates/extract-files.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-set -e
-
-DEVICE=**** FILL IN DEVICE NAME ****
-VENDOR=*** FILL IN VENDOR ****
-
-# Load extract_utils and do some sanity checks
-MY_DIR="${BASH_SOURCE%/*}"
-if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
-
-LINEAGE_ROOT="${MY_DIR}/../../.."
-
-HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh"
-if [ ! -f "${HELPER}" ]; then
-    echo "Unable to find helper script at ${HELPER}"
-    exit 1
-fi
-source "${HELPER}"
-
-# Default to sanitizing the vendor folder before extraction
-CLEAN_VENDOR=true
-SECTION=
-KANG=
-
-while [ "$1" != "" ]; do
-    case "$1" in
-        -n | --no-cleanup )     CLEAN_VENDOR=false
-                                ;;
-        -k | --kang)            KANG="--kang"
-                                ;;
-        -s | --section )        shift
-                                SECTION="$1"
-                                CLEAN_VENDOR=false
-                                ;;
-        * )                     SRC="$1"
-                                ;;
-    esac
-    shift
-done
-
-if [ -z "${SRC}" ]; then
-    SRC=adb
-fi
-
-# Initialize the helper
-setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}"
-
-extract "${MY_DIR}/proprietary-files.txt" "${SRC}" ${KANG} --section "${SECTION}"
-
-"${MY_DIR}/setup-makefiles.sh"
diff --git a/build/templates/setup-makefiles.sh b/build/templates/setup-makefiles.sh
deleted file mode 100755
index 51b4ba2..0000000
--- a/build/templates/setup-makefiles.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-set -e
-
-DEVICE=*** FILL IN DEVICE ****
-VENDOR=*** FILL IN VENDOR ****
-
-INITIAL_COPYRIGHT_YEAR=**** FILL IN COPYRIGHT YEAR ****
-
-# Load extract_utils and do some sanity checks
-MY_DIR="${BASH_SOURCE%/*}"
-if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
-
-LINEAGE_ROOT="$MY_DIR"/../../..
-
-HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
-if [ ! -f "$HELPER" ]; then
-    echo "Unable to find helper script at $HELPER"
-    exit 1
-fi
-. "$HELPER"
-
-# Initialize the helper
-setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT"
-
-# Copyright headers and guards
-write_headers
-
-write_makefiles "$MY_DIR"/proprietary-files.txt
-
-# Finish
-write_footers
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
deleted file mode 100644
index 81487ca..0000000
--- a/build/tools/extract_utils.sh
+++ /dev/null
@@ -1,1388 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2016 The CyanogenMod 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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-PRODUCT_COPY_FILES_LIST=()
-PRODUCT_COPY_FILES_HASHES=()
-PRODUCT_COPY_FILES_FIXUP_HASHES=()
-PRODUCT_PACKAGES_LIST=()
-PRODUCT_PACKAGES_HASHES=()
-PRODUCT_PACKAGES_FIXUP_HASHES=()
-PACKAGE_LIST=()
-VENDOR_STATE=-1
-VENDOR_RADIO_STATE=-1
-COMMON=-1
-ARCHES=
-FULLY_DEODEXED=-1
-
-TMPDIR=$(mktemp -d)
-
-#
-# cleanup
-#
-# kill our tmpfiles with fire on exit
-#
-function cleanup() {
-    rm -rf "${TMPDIR:?}"
-}
-
-trap cleanup 0
-
-#
-# setup_vendor
-#
-# $1: device name
-# $2: vendor name
-# $3: Lineage root directory
-# $4: is common device - optional, default to false
-# $5: cleanup - optional, default to true
-# $6: custom vendor makefile name - optional, default to false
-#
-# Must be called before any other functions can be used. This
-# sets up the internal state for a new vendor configuration.
-#
-function setup_vendor() {
-    local DEVICE="$1"
-    if [ -z "$DEVICE" ]; then
-        echo "\$DEVICE must be set before including this script!"
-        exit 1
-    fi
-
-    export VENDOR="$2"
-    if [ -z "$VENDOR" ]; then
-        echo "\$VENDOR must be set before including this script!"
-        exit 1
-    fi
-
-    export LINEAGE_ROOT="$3"
-    if [ ! -d "$LINEAGE_ROOT" ]; then
-        echo "\$LINEAGE_ROOT must be set and valid before including this script!"
-        exit 1
-    fi
-
-    export OUTDIR=vendor/"$VENDOR"/"$DEVICE"
-    if [ ! -d "$LINEAGE_ROOT/$OUTDIR" ]; then
-        mkdir -p "$LINEAGE_ROOT/$OUTDIR"
-    fi
-
-    VNDNAME="$6"
-    if [ -z "$VNDNAME" ]; then
-        VNDNAME="$DEVICE"
-    fi
-
-    export PRODUCTMK="$LINEAGE_ROOT"/"$OUTDIR"/"$VNDNAME"-vendor.mk
-    export ANDROIDMK="$LINEAGE_ROOT"/"$OUTDIR"/Android.mk
-    export BOARDMK="$LINEAGE_ROOT"/"$OUTDIR"/BoardConfigVendor.mk
-
-    if [ "$4" == "true" ] || [ "$4" == "1" ]; then
-        COMMON=1
-    else
-        COMMON=0
-    fi
-
-    if [ "$5" == "false" ] || [ "$5" == "0" ]; then
-        VENDOR_STATE=1
-        VENDOR_RADIO_STATE=1
-    else
-        VENDOR_STATE=0
-        VENDOR_RADIO_STATE=0
-    fi
-}
-
-# Helper functions for parsing a spec.
-# notes: an optional "|SHA1" that may appear in the format is stripped
-#        early from the spec in the parse_file_list function, and
-#        should not be present inside the input parameter passed
-#        to these functions.
-
-#
-# input: spec in the form of "src[:dst][;args]"
-# output: "src"
-#
-function src_file() {
-    local SPEC="$1"
-    local SPLIT=(${SPEC//:/ })
-    local ARGS="$(target_args ${SPEC})"
-    # Regardless of there being a ":" delimiter or not in the spec,
-    # the source file is always either the first, or the only entry.
-    local SRC="${SPLIT[0]}"
-    # Remove target_args suffix, if present
-    echo "${SRC%;${ARGS}}"
-}
-
-#
-# input: spec in the form of "src[:dst][;args]"
-# output: "dst" if present, "src" otherwise.
-#
-function target_file() {
-    local SPEC="$1"
-    local SPLIT=(${SPEC//:/ })
-    local ARGS="$(target_args ${SPEC})"
-    local DST=
-    case ${#SPLIT[@]} in
-    1)
-        # The spec doesn't have a : delimiter
-        DST="${SPLIT[0]}"
-        ;;
-    *)
-        # The spec actually has a src:dst format
-        DST="${SPLIT[1]}"
-        ;;
-    esac
-    # Remove target_args suffix, if present
-    echo "${DST%;${ARGS}}"
-}
-
-#
-# input: spec in the form of "src[:dst][;args]"
-# output: "args" if present, "" otherwise.
-#
-function target_args() {
-    local SPEC="$1"
-    local SPLIT=(${SPEC//;/ })
-    local ARGS=
-    case ${#SPLIT[@]} in
-    1)
-        # No ";" delimiter in the spec.
-        ;;
-    *)
-        # The "args" are whatever comes after the ";" character.
-        # Basically the spec stripped of whatever is to the left of ";".
-        ARGS="${SPEC#${SPLIT[0]};}"
-        ;;
-    esac
-    echo "${ARGS}"
-}
-
-#
-# prefix_match:
-#
-# input:
-#   - $1: prefix
-#   - (global variable) PRODUCT_PACKAGES_LIST: array of [src:]dst[;args] specs.
-# output:
-#   - new array consisting of dst[;args] entries where $1 is a prefix of ${dst}.
-#
-function prefix_match() {
-    local PREFIX="$1"
-    for LINE in "${PRODUCT_PACKAGES_LIST[@]}"; do
-        local FILE=$(target_file "$LINE")
-        if [[ "$FILE" =~ ^"$PREFIX" ]]; then
-            local ARGS=$(target_args "$LINE")
-            if [ -z "${ARGS}" ]; then
-                echo "${FILE#$PREFIX}"
-            else
-                echo "${FILE#$PREFIX};${ARGS}"
-            fi
-        fi
-    done
-}
-
-#
-# prefix_match_file:
-#
-# $1: the prefix to match on
-# $2: the file to match the prefix for
-#
-# Internal function which returns true if a filename contains the
-# specified prefix.
-#
-function prefix_match_file() {
-    local PREFIX="$1"
-    local FILE="$2"
-    if [[ "$FILE" =~ ^"$PREFIX" ]]; then
-        return 0
-    else
-        return 1
-    fi
-}
-
-#
-# suffix_match_file:
-#
-# $1: the suffix to match on
-# $2: the file to match the suffix for
-#
-# Internal function which returns true if a filename contains the
-# specified suffix.
-#
-function suffix_match_file() {
-    local SUFFIX="$1"
-    local FILE="$2"
-    if [[ "$FILE" = *"$SUFFIX" ]]; then
-        return 0
-    else
-        return 1
-    fi
-}
-
-#
-# truncate_file
-#
-# $1: the filename to truncate
-# $2: the argument to output the truncated filename to
-#
-# Internal function which truncates a filename by removing the first dir
-# in the path. ex. vendor/lib/libsdmextension.so -> lib/libsdmextension.so
-#
-function truncate_file() {
-    local FILE="$1"
-    RETURN_FILE="$2"
-    local FIND="${FILE%%/*}"
-    local LOCATION="${#FIND}+1"
-    echo ${FILE:$LOCATION}
-}
-
-#
-# write_product_copy_files:
-#
-# $1: make treble compatible makefile - optional, default to false
-#
-# Creates the PRODUCT_COPY_FILES section in the product makefile for all
-# items in the list which do not start with a dash (-).
-#
-function write_product_copy_files() {
-    local COUNT=${#PRODUCT_COPY_FILES_LIST[@]}
-    local TARGET=
-    local FILE=
-    local LINEEND=
-    local TREBLE_COMPAT=$1
-
-    if [ "$COUNT" -eq "0" ]; then
-        return 0
-    fi
-
-    printf '%s\n' "PRODUCT_COPY_FILES += \\" >> "$PRODUCTMK"
-    for (( i=1; i<COUNT+1; i++ )); do
-        FILE="${PRODUCT_COPY_FILES_LIST[$i-1]}"
-        LINEEND=" \\"
-        if [ "$i" -eq "$COUNT" ]; then
-            LINEEND=""
-        fi
-
-        TARGET=$(target_file "$FILE")
-        if [ "$TREBLE_COMPAT" == "true" ] || [ "$TREBLE_COMPAT" == "1" ]; then
-            if prefix_match_file "vendor/" $TARGET ; then
-                local OUTTARGET=$(truncate_file $TARGET)
-                printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_VENDOR)/%s%s\n' \
-                    "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
-            else
-                printf '    %s/proprietary/%s:system/%s%s\n' \
-                    "$OUTDIR" "$TARGET" "$TARGET" "$LINEEND" >> "$PRODUCTMK"
-            fi
-        else
-            printf '    %s/proprietary/%s:system/%s%s\n' \
-                "$OUTDIR" "$TARGET" "$TARGET" "$LINEEND" >> "$PRODUCTMK"
-        fi
-    done
-    return 0
-}
-
-#
-# write_packages:
-#
-# $1: The LOCAL_MODULE_CLASS for the given module list
-# $2: "true" if this package is part of the vendor/ path
-# $3: type-specific extra flags
-# $4: Name of the array holding the target list
-#
-# Internal function which writes out the BUILD_PREBUILT stanzas
-# for all modules in the list. This is called by write_product_packages
-# after the modules are categorized.
-#
-function write_packages() {
-
-    local CLASS="$1"
-    local VENDOR_PKG="$2"
-    local EXTRA="$3"
-
-    # Yes, this is a horrible hack - we create a new array using indirection
-    local ARR_NAME="$4[@]"
-    local FILELIST=("${!ARR_NAME}")
-
-    local FILE=
-    local ARGS=
-    local BASENAME=
-    local EXTENSION=
-    local PKGNAME=
-    local SRC=
-
-    for P in "${FILELIST[@]}"; do
-        FILE=$(target_file "$P")
-        ARGS=$(target_args "$P")
-
-        BASENAME=$(basename "$FILE")
-        DIRNAME=$(dirname "$FILE")
-        EXTENSION=${BASENAME##*.}
-        PKGNAME=${BASENAME%.*}
-
-        # Add to final package list
-        PACKAGE_LIST+=("$PKGNAME")
-
-        SRC="proprietary"
-        if [ "$VENDOR_PKG" = "true" ]; then
-            SRC+="/vendor"
-        fi
-
-        printf 'include $(CLEAR_VARS)\n'
-        printf 'LOCAL_MODULE := %s\n' "$PKGNAME"
-        printf 'LOCAL_MODULE_OWNER := %s\n' "$VENDOR"
-        if [ "$CLASS" = "SHARED_LIBRARIES" ]; then
-            if [ "$EXTRA" = "both" ]; then
-                printf 'LOCAL_SRC_FILES_64 := %s/lib64/%s\n' "$SRC" "$FILE"
-                printf 'LOCAL_SRC_FILES_32 := %s/lib/%s\n' "$SRC" "$FILE"
-                #if [ "$VENDOR_PKG" = "true" ]; then
-                #    echo "LOCAL_MODULE_PATH_64 := \$(TARGET_OUT_VENDOR_SHARED_LIBRARIES)"
-                #    echo "LOCAL_MODULE_PATH_32 := \$(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES)"
-                #else
-                #    echo "LOCAL_MODULE_PATH_64 := \$(TARGET_OUT_SHARED_LIBRARIES)"
-                #    echo "LOCAL_MODULE_PATH_32 := \$(2ND_TARGET_OUT_SHARED_LIBRARIES)"
-                #fi
-            elif [ "$EXTRA" = "64" ]; then
-                printf 'LOCAL_SRC_FILES := %s/lib64/%s\n' "$SRC" "$FILE"
-            else
-                printf 'LOCAL_SRC_FILES := %s/lib/%s\n' "$SRC" "$FILE"
-            fi
-            if [ "$EXTRA" != "none" ]; then
-                printf 'LOCAL_MULTILIB := %s\n' "$EXTRA"
-            fi
-        elif [ "$CLASS" = "APPS" ]; then
-            if [ "$EXTRA" = "priv-app" ]; then
-                SRC="$SRC/priv-app"
-            else
-                SRC="$SRC/app"
-            fi
-            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
-            local CERT=platform
-            if [ ! -z "$ARGS" ]; then
-                CERT="$ARGS"
-            fi
-            printf 'LOCAL_CERTIFICATE := %s\n' "$CERT"
-        elif [ "$CLASS" = "JAVA_LIBRARIES" ]; then
-            printf 'LOCAL_SRC_FILES := %s/framework/%s\n' "$SRC" "$FILE"
-            local CERT=platform
-            if [ ! -z "$ARGS" ]; then
-                CERT="$ARGS"
-            fi
-            printf 'LOCAL_CERTIFICATE := %s\n' "$CERT"
-        elif [ "$CLASS" = "ETC" ]; then
-            printf 'LOCAL_SRC_FILES := %s/etc/%s\n' "$SRC" "$FILE"
-        elif [ "$CLASS" = "EXECUTABLES" ]; then
-            if [ "$ARGS" = "rootfs" ]; then
-                SRC="$SRC/rootfs"
-                if [ "$EXTRA" = "sbin" ]; then
-                    SRC="$SRC/sbin"
-                    printf '%s\n' "LOCAL_MODULE_PATH := \$(TARGET_ROOT_OUT_SBIN)"
-                    printf '%s\n' "LOCAL_UNSTRIPPED_PATH := \$(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)"
-                fi
-            else
-                SRC="$SRC/bin"
-            fi
-            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
-            unset EXTENSION
-        else
-            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
-        fi
-        printf 'LOCAL_MODULE_TAGS := optional\n'
-        printf 'LOCAL_MODULE_CLASS := %s\n' "$CLASS"
-        if [ "$CLASS" = "APPS" ]; then
-            printf 'LOCAL_DEX_PREOPT := false\n'
-        fi
-        if [ ! -z "$EXTENSION" ]; then
-            printf 'LOCAL_MODULE_SUFFIX := .%s\n' "$EXTENSION"
-        fi
-        if [ "$CLASS" = "SHARED_LIBRARIES" ] || [ "$CLASS" = "EXECUTABLES" ]; then
-            if [ "$DIRNAME" != "." ]; then
-                printf 'LOCAL_MODULE_RELATIVE_PATH := %s\n' "$DIRNAME"
-            fi
-        fi
-        if [ "$EXTRA" = "priv-app" ]; then
-            printf 'LOCAL_PRIVILEGED_MODULE := true\n'
-        fi
-        if [ "$VENDOR_PKG" = "true" ]; then
-            printf 'LOCAL_VENDOR_MODULE := true\n'
-        fi
-        printf 'include $(BUILD_PREBUILT)\n\n'
-    done
-}
-
-#
-# write_product_packages:
-#
-# This function will create BUILD_PREBUILT entries in the
-# Android.mk and associated PRODUCT_PACKAGES list in the
-# product makefile for all files in the blob list which
-# start with a single dash (-) character.
-#
-function write_product_packages() {
-    PACKAGE_LIST=()
-
-    local COUNT=${#PRODUCT_PACKAGES_LIST[@]}
-
-    if [ "$COUNT" = "0" ]; then
-        return 0
-    fi
-
-    # Figure out what's 32-bit, what's 64-bit, and what's multilib
-    # I really should not be doing this in bash due to shitty array passing :(
-    local T_LIB32=( $(prefix_match "lib/") )
-    local T_LIB64=( $(prefix_match "lib64/") )
-    local MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_LIB32[@]}") <(printf '%s\n' "${T_LIB64[@]}")) )
-    local LIB32=( $(comm -23 <(printf '%s\n'  "${T_LIB32[@]}") <(printf '%s\n' "${MULTILIBS[@]}")) )
-    local LIB64=( $(comm -23 <(printf '%s\n' "${T_LIB64[@]}") <(printf '%s\n' "${MULTILIBS[@]}")) )
-
-    if [ "${#MULTILIBS[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "false" "both" "MULTILIBS" >> "$ANDROIDMK"
-    fi
-    if [ "${#LIB32[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "false" "32" "LIB32" >> "$ANDROIDMK"
-    fi
-    if [ "${#LIB64[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "false" "64" "LIB64" >> "$ANDROIDMK"
-    fi
-
-    local T_V_LIB32=( $(prefix_match "vendor/lib/") )
-    local T_V_LIB64=( $(prefix_match "vendor/lib64/") )
-    local V_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_V_LIB32[@]}") <(printf '%s\n' "${T_V_LIB64[@]}")) )
-    local V_LIB32=( $(comm -23 <(printf '%s\n' "${T_V_LIB32[@]}") <(printf '%s\n' "${V_MULTILIBS[@]}")) )
-    local V_LIB64=( $(comm -23 <(printf '%s\n' "${T_V_LIB64[@]}") <(printf '%s\n' "${V_MULTILIBS[@]}")) )
-
-    if [ "${#V_MULTILIBS[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "true" "both" "V_MULTILIBS" >> "$ANDROIDMK"
-    fi
-    if [ "${#V_LIB32[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "true" "32" "V_LIB32" >> "$ANDROIDMK"
-    fi
-    if [ "${#V_LIB64[@]}" -gt "0" ]; then
-        write_packages "SHARED_LIBRARIES" "true" "64" "V_LIB64" >> "$ANDROIDMK"
-    fi
-
-    # Apps
-    local APPS=( $(prefix_match "app/") )
-    if [ "${#APPS[@]}" -gt "0" ]; then
-        write_packages "APPS" "false" "" "APPS" >> "$ANDROIDMK"
-    fi
-    local PRIV_APPS=( $(prefix_match "priv-app/") )
-    if [ "${#PRIV_APPS[@]}" -gt "0" ]; then
-        write_packages "APPS" "false" "priv-app" "PRIV_APPS" >> "$ANDROIDMK"
-    fi
-    local V_APPS=( $(prefix_match "vendor/app/") )
-    if [ "${#V_APPS[@]}" -gt "0" ]; then
-        write_packages "APPS" "true" "" "V_APPS" >> "$ANDROIDMK"
-    fi
-    local V_PRIV_APPS=( $(prefix_match "vendor/priv-app/") )
-    if [ "${#V_PRIV_APPS[@]}" -gt "0" ]; then
-        write_packages "APPS" "true" "priv-app" "V_PRIV_APPS" >> "$ANDROIDMK"
-    fi
-
-    # Framework
-    local FRAMEWORK=( $(prefix_match "framework/") )
-    if [ "${#FRAMEWORK[@]}" -gt "0" ]; then
-        write_packages "JAVA_LIBRARIES" "false" "" "FRAMEWORK" >> "$ANDROIDMK"
-    fi
-    local V_FRAMEWORK=( $(prefix_match "vendor/framework/") )
-    if [ "${#V_FRAMEWORK[@]}" -gt "0" ]; then
-        write_packages "JAVA_LIBRARIES" "true" "" "V_FRAMEWORK" >> "$ANDROIDMK"
-    fi
-
-    # Etc
-    local ETC=( $(prefix_match "etc/") )
-    if [ "${#ETC[@]}" -gt "0" ]; then
-        write_packages "ETC" "false" "" "ETC" >> "$ANDROIDMK"
-    fi
-    local V_ETC=( $(prefix_match "vendor/etc/") )
-    if [ "${#V_ETC[@]}" -gt "0" ]; then
-        write_packages "ETC" "true" "" "V_ETC" >> "$ANDROIDMK"
-    fi
-
-    # Executables
-    local BIN=( $(prefix_match "bin/") )
-    if [ "${#BIN[@]}" -gt "0"  ]; then
-        write_packages "EXECUTABLES" "false" "" "BIN" >> "$ANDROIDMK"
-    fi
-    local V_BIN=( $(prefix_match "vendor/bin/") )
-    if [ "${#V_BIN[@]}" -gt "0" ]; then
-        write_packages "EXECUTABLES" "true" "" "V_BIN" >> "$ANDROIDMK"
-    fi
-    local SBIN=( $(prefix_match "sbin/") )
-    if [ "${#SBIN[@]}" -gt "0" ]; then
-        write_packages "EXECUTABLES" "false" "sbin" "SBIN" >> "$ANDROIDMK"
-    fi
-
-
-    # Actually write out the final PRODUCT_PACKAGES list
-    local PACKAGE_COUNT=${#PACKAGE_LIST[@]}
-
-    if [ "$PACKAGE_COUNT" -eq "0" ]; then
-        return 0
-    fi
-
-    printf '\n%s\n' "PRODUCT_PACKAGES += \\" >> "$PRODUCTMK"
-    for (( i=1; i<PACKAGE_COUNT+1; i++ )); do
-        local LINEEND=" \\"
-        if [ "$i" -eq "$PACKAGE_COUNT" ]; then
-            LINEEND=""
-        fi
-        printf '    %s%s\n' "${PACKAGE_LIST[$i-1]}" "$LINEEND" >> "$PRODUCTMK"
-    done
-}
-
-#
-# write_header:
-#
-# $1: file which will be written to
-#
-# writes out the copyright header with the current year.
-# note that this is not an append operation, and should
-# be executed first!
-#
-function write_header() {
-    if [ -f $1 ]; then
-        rm $1
-    fi
-
-    YEAR=$(date +"%Y")
-
-    [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"
-
-    NUM_REGEX='^[0-9]+$'
-    if [[ $INITIAL_COPYRIGHT_YEAR =~ $NUM_REGEX ]] && [ $INITIAL_COPYRIGHT_YEAR -le $YEAR ]; then
-        if [ $INITIAL_COPYRIGHT_YEAR -lt 2016 ]; then
-            printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-2016 The CyanogenMod Project\n" > $1
-        elif [ $INITIAL_COPYRIGHT_YEAR -eq 2016 ]; then
-            printf "# Copyright (C) 2016 The CyanogenMod Project\n" > $1
-        fi
-        if [ $YEAR -eq 2017 ]; then
-            printf "# Copyright (C) 2017 The LineageOS Project\n" >> $1
-        elif [ $INITIAL_COPYRIGHT_YEAR -eq $YEAR ]; then
-            printf "# Copyright (C) $YEAR The LineageOS Project\n" >> $1
-        elif [ $INITIAL_COPYRIGHT_YEAR -le 2017 ]; then
-            printf "# Copyright (C) 2017-$YEAR The LineageOS Project\n" >> $1
-        else
-            printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-$YEAR The LineageOS Project\n" >> $1
-        fi
-    else
-        printf "# Copyright (C) $YEAR The LineageOS Project\n" > $1
-    fi
-
-    cat << EOF >> $1
-#
-# 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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
-
-EOF
-}
-
-#
-# write_headers:
-#
-# $1: devices falling under common to be added to guard - optional
-# $2: custom guard - optional
-#
-# Calls write_header for each of the makefiles and creates
-# the initial path declaration and device guard for the
-# Android.mk
-#
-function write_headers() {
-    write_header "$ANDROIDMK"
-
-    GUARD="$2"
-    if [ -z "$GUARD" ]; then
-        GUARD="TARGET_DEVICE"
-    fi
-
-    cat << EOF >> "$ANDROIDMK"
-LOCAL_PATH := \$(call my-dir)
-
-EOF
-    if [ "$COMMON" -ne 1 ]; then
-        cat << EOF >> "$ANDROIDMK"
-ifeq (\$($GUARD),$DEVICE)
-
-EOF
-    else
-        if [ -z "$1" ]; then
-            echo "Argument with devices to be added to guard must be set!"
-            exit 1
-        fi
-        cat << EOF >> "$ANDROIDMK"
-ifneq (\$(filter $1,\$($GUARD)),)
-
-EOF
-    fi
-
-    write_header "$BOARDMK"
-    write_header "$PRODUCTMK"
-}
-
-#
-# write_footers:
-#
-# Closes the inital guard and any other finalization tasks. Must
-# be called as the final step.
-#
-function write_footers() {
-    cat << EOF >> "$ANDROIDMK"
-endif
-EOF
-}
-
-# Return success if adb is up and not in recovery
-function _adb_connected {
-    {
-        if [[ "$(adb get-state)" == device ]]
-        then
-            return 0
-        fi
-    } 2>/dev/null
-
-    return 1
-};
-
-#
-# parse_file_list:
-#
-# $1: input file
-# $2: blob section in file - optional
-#
-# Sets PRODUCT_PACKAGES and PRODUCT_COPY_FILES while parsing the input file
-#
-function parse_file_list() {
-    if [ -z "$1" ]; then
-        echo "An input file is expected!"
-        exit 1
-    elif [ ! -f "$1" ]; then
-        echo "Input file "$1" does not exist!"
-        exit 1
-    fi
-
-    if [ -n "$2" ]; then
-        echo "Using section \"$2\""
-        LIST=$TMPDIR/files.txt
-        # Match all lines starting with first line found to start* with '#'
-        # comment and contain** $2, and ending with first line to be empty*.
-        # *whitespaces (tabs, spaces) at the beginning of lines are discarded
-        # **the $2 match is case-insensitive
-        cat $1 | sed -n '/^[[:space:]]*#.*'"$2"'/I,/^[[:space:]]*$/ p' > $LIST
-    else
-        LIST=$1
-    fi
-
-
-    PRODUCT_PACKAGES_LIST=()
-    PRODUCT_PACKAGES_HASHES=()
-    PRODUCT_PACKAGES_FIXUP_HASHES=()
-    PRODUCT_COPY_FILES_LIST=()
-    PRODUCT_COPY_FILES_HASHES=()
-    PRODUCT_COPY_FILES_FIXUP_HASHES=()
-
-    while read -r line; do
-        if [ -z "$line" ]; then continue; fi
-
-        # If the line has a pipe delimiter, a sha1 hash should follow.
-        # This indicates the file should be pinned and not overwritten
-        # when extracting files.
-        local SPLIT=(${line//\|/ })
-        local COUNT=${#SPLIT[@]}
-        local SPEC=${SPLIT[0]}
-        local HASH="x"
-        local FIXUP_HASH="x"
-        if [ "$COUNT" -gt "1" ]; then
-            HASH=${SPLIT[1]}
-        fi
-        if [ "$COUNT" -gt "2" ]; then
-            FIXUP_HASH=${SPLIT[2]}
-        fi
-
-        # if line starts with a dash, it needs to be packaged
-        if [[ "$SPEC" =~ ^- ]]; then
-            PRODUCT_PACKAGES_LIST+=("${SPEC#-}")
-            PRODUCT_PACKAGES_HASHES+=("$HASH")
-            PRODUCT_PACKAGES_FIXUP_HASHES+=("$FIXUP_HASH")
-        else
-            PRODUCT_COPY_FILES_LIST+=("$SPEC")
-            PRODUCT_COPY_FILES_HASHES+=("$HASH")
-            PRODUCT_COPY_FILES_FIXUP_HASHES+=("$FIXUP_HASH")
-        fi
-
-    done < <(egrep -v '(^#|^[[:space:]]*$)' "$LIST" | LC_ALL=C sort | uniq)
-}
-
-#
-# write_makefiles:
-#
-# $1: file containing the list of items to extract
-# $2: make treble compatible makefile - optional
-#
-# Calls write_product_copy_files and write_product_packages on
-# the given file and appends to the Android.mk as well as
-# the product makefile.
-#
-function write_makefiles() {
-    parse_file_list "$1"
-    write_product_copy_files "$2"
-    write_product_packages
-}
-
-#
-# append_firmware_calls_to_makefiles:
-#
-# Appends to Android.mk the calls to all images present in radio folder
-# (filesmap file used by releasetools to map firmware images should be kept in the device tree)
-#
-function append_firmware_calls_to_makefiles() {
-    cat << EOF >> "$ANDROIDMK"
-ifeq (\$(LOCAL_PATH)/radio, \$(wildcard \$(LOCAL_PATH)/radio))
-
-RADIO_FILES := \$(wildcard \$(LOCAL_PATH)/radio/*)
-\$(foreach f, \$(notdir \$(RADIO_FILES)), \\
-    \$(call add-radio-file,radio/\$(f)))
-\$(call add-radio-file,../../../device/$VENDOR/$DEVICE/radio/filesmap)
-
-endif
-
-EOF
-}
-
-#
-# get_file:
-#
-# $1: input file
-# $2: target file/folder
-# $3: source of the file (can be "adb" or a local folder)
-#
-# Silently extracts the input file to defined target
-# Returns success if file can be pulled from the device or found locally
-#
-function get_file() {
-    local SRC="$3"
-
-    if [ "$SRC" = "adb" ]; then
-        # try to pull
-        adb pull "$1" "$2" >/dev/null 2>&1 && return 0
-
-        return 1
-    else
-        # try to copy
-        cp -r "$SRC/$1"           "$2" 2>/dev/null && return 0
-        cp -r "$SRC/${1#/system}" "$2" 2>/dev/null && return 0
-        cp -r "$SRC/system/$1"    "$2" 2>/dev/null && return 0
-
-        return 1
-    fi
-};
-
-#
-# oat2dex:
-#
-# $1: extracted apk|jar (to check if deodex is required)
-# $2: odexed apk|jar to deodex
-# $3: source of the odexed apk|jar
-#
-# Convert apk|jar .odex in the corresposing classes.dex
-#
-function oat2dex() {
-    local LINEAGE_TARGET="$1"
-    local OEM_TARGET="$2"
-    local SRC="$3"
-    local TARGET=
-    local OAT=
-    local HOST="$(uname)"
-
-    if [ -z "$BAKSMALIJAR" ] || [ -z "$SMALIJAR" ]; then
-        export BAKSMALIJAR="$LINEAGE_ROOT"/vendor/lineage/build/tools/smali/baksmali.jar
-        export SMALIJAR="$LINEAGE_ROOT"/vendor/lineage/build/tools/smali/smali.jar
-    fi
-
-    if [ -z "$VDEXEXTRACTOR" ]; then
-        export VDEXEXTRACTOR="$LINEAGE_ROOT"/vendor/lineage/build/tools/"$HOST"/vdexExtractor
-    fi
-
-    if [ -z "$CDEXCONVERTER" ]; then
-        export CDEXCONVERTER="$LINEAGE_ROOT"/vendor/lineage/build/tools/"$HOST"/compact_dex_converter
-    fi
-
-    # Extract existing boot.oats to the temp folder
-    if [ -z "$ARCHES" ]; then
-        echo "Checking if system is odexed and locating boot.oats..."
-        for ARCH in "arm64" "arm" "x86_64" "x86"; do
-            mkdir -p "$TMPDIR/system/framework/$ARCH"
-            if get_file "/system/framework/$ARCH" "$TMPDIR/system/framework/" "$SRC"; then
-                ARCHES+="$ARCH "
-            else
-                rmdir "$TMPDIR/system/framework/$ARCH"
-            fi
-        done
-    fi
-
-    if [ -z "$ARCHES" ]; then
-        FULLY_DEODEXED=1 && return 0 # system is fully deodexed, return
-    fi
-
-    if [ ! -f "$LINEAGE_TARGET" ]; then
-        return;
-    fi
-
-    if grep "classes.dex" "$LINEAGE_TARGET" >/dev/null; then
-        return 0 # target apk|jar is already odexed, return
-    fi
-
-    for ARCH in $ARCHES; do
-        BOOTOAT="$TMPDIR/system/framework/$ARCH/boot.oat"
-
-        local OAT="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}").odex"
-        local VDEX="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}").vdex"
-
-        if get_file "$OAT" "$TMPDIR" "$SRC"; then
-            if get_file "$VDEX" "$TMPDIR" "$SRC"; then
-                "$VDEXEXTRACTOR" -o "$TMPDIR/" -i "$TMPDIR/$(basename "$VDEX")" > /dev/null
-                CLASSES=$(ls "$TMPDIR/$(basename "${OEM_TARGET%.*}")_classes"*)
-                for CLASS in $CLASSES; do
-                    NEWCLASS=$(echo "$CLASS" | sed 's/.*_//;s/cdex/dex/')
-                    # Check if we have to deal with CompactDex
-                    if [[ "$CLASS" == *.cdex ]]; then
-                        "$CDEXCONVERTER" "$CLASS" &>/dev/null
-                        mv "$CLASS.new" "$TMPDIR/$NEWCLASS"
-                    else
-                        mv "$CLASS" "$TMPDIR/$NEWCLASS"
-                    fi
-                done
-            else
-                java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$TMPDIR/$(basename "$OAT")"
-                java -jar "$SMALIJAR" assemble "$TMPDIR/dexout" -o "$TMPDIR/classes.dex"
-            fi
-        elif [[ "$LINEAGE_TARGET" =~ .jar$ ]]; then
-            JAROAT="$TMPDIR/system/framework/$ARCH/boot-$(basename ${OEM_TARGET%.*}).oat"
-            JARVDEX="/system/framework/boot-$(basename ${OEM_TARGET%.*}).vdex"
-            if [ ! -f "$JAROAT" ]; then
-                JAROAT=$BOOTOAT
-            fi
-            # try to extract classes.dex from boot.vdex for frameworks jars
-            # fallback to boot.oat if vdex is not available
-            if get_file "$JARVDEX" "$TMPDIR" "$SRC"; then
-                "$VDEXEXTRACTOR" -o "$TMPDIR/" -i "$TMPDIR/$(basename "$JARVDEX")" > /dev/null
-                CLASSES=$(ls "$TMPDIR/$(basename "${JARVDEX%.*}")_classes"*)
-                for CLASS in $CLASSES; do
-                    NEWCLASS=$(echo "$CLASS" | sed 's/.*_//;s/cdex/dex/')
-                    # Check if we have to deal with CompactDex
-                    if [[ "$CLASS" == *.cdex ]]; then
-                        "$CDEXCONVERTER" "$CLASS" &>/dev/null
-                        mv "$CLASS.new" "$TMPDIR/$NEWCLASS"
-                    else
-                        mv "$CLASS" "$TMPDIR/$NEWCLASS"
-                    fi
-                done
-            else
-                java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$JAROAT/$OEM_TARGET"
-                java -jar "$SMALIJAR" assemble "$TMPDIR/dexout" -o "$TMPDIR/classes.dex"
-            fi
-        else
-            continue
-        fi
-
-    done
-
-    rm -rf "$TMPDIR/dexout"
-}
-
-#
-# init_adb_connection:
-#
-# Starts adb server and waits for the device
-#
-function init_adb_connection() {
-    adb start-server # Prevent unexpected starting server message from adb get-state in the next line
-    if ! _adb_connected; then
-        echo "No device is online. Waiting for one..."
-        echo "Please connect USB and/or enable USB debugging"
-        until _adb_connected; do
-            sleep 1
-        done
-        echo "Device Found."
-    fi
-
-    # Retrieve IP and PORT info if we're using a TCP connection
-    TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \
-        | head -1 | awk '{print $1}')
-    adb root &> /dev/null
-    sleep 0.3
-    if [ -n "$TCPIPPORT" ]; then
-        # adb root just killed our connection
-        # so reconnect...
-        adb connect "$TCPIPPORT"
-    fi
-    adb wait-for-device &> /dev/null
-    sleep 0.3
-}
-
-#
-# fix_xml:
-#
-# $1: xml file to fix
-#
-function fix_xml() {
-    local XML="$1"
-    local TEMP_XML="$TMPDIR/`basename "$XML"`.temp"
-
-    grep -a '^<?xml version' "$XML" > "$TEMP_XML"
-    grep -av '^<?xml version' "$XML" >> "$TEMP_XML"
-
-    mv "$TEMP_XML" "$XML"
-}
-
-function get_hash() {
-    local FILE="$1"
-
-    if [ "$(uname)" == "Darwin" ]; then
-        shasum "${FILE}" | awk '{print $1}'
-    else
-        sha1sum "${FILE}" | awk '{print $1}'
-    fi
-}
-
-function print_spec() {
-    local SPEC_PRODUCT_PACKAGE="$1"
-    local SPEC_SRC_FILE="$2"
-    local SPEC_DST_FILE="$3"
-    local SPEC_ARGS="$4"
-    local SPEC_HASH="$5"
-    local SPEC_FIXUP_HASH="$6"
-
-    local PRODUCT_PACKAGE=""
-    if [ ${SPEC_PRODUCT_PACKAGE} = true ]; then
-        PRODUCT_PACKAGE="-"
-    fi
-    local SRC=""
-    if [ ! -z "${SPEC_SRC_FILE}" ] && [ "${SPEC_SRC_FILE}" != "${SPEC_DST_FILE}" ]; then
-        SRC="${SPEC_SRC_FILE}:"
-    fi
-    local DST=""
-    if [ ! -z "${SPEC_DST_FILE}" ]; then
-        DST="${SPEC_DST_FILE}"
-    fi
-    local ARGS=""
-    if [ ! -z "${SPEC_ARGS}" ]; then
-        ARGS=";${SPEC_ARGS}"
-    fi
-    local HASH=""
-    if [ ! -z "${SPEC_HASH}" ] && [ "${SPEC_HASH}" != "x" ]; then
-        HASH="|${SPEC_HASH}"
-    fi
-    local FIXUP_HASH=""
-    if [ ! -z "${SPEC_FIXUP_HASH}" ] && [ "${SPEC_FIXUP_HASH}" != "x" ] && [ "${SPEC_FIXUP_HASH}" != "${SPEC_HASH}" ]; then
-        FIXUP_HASH="|${SPEC_FIXUP_HASH}"
-    fi
-    printf '%s%s%s%s%s%s\n' "${PRODUCT_PACKAGE}" "${SRC}" "${DST}" "${ARGS}" "${HASH}" "${FIXUP_HASH}"
-}
-
-# To be overridden by device-level extract-files.sh
-# Parameters:
-#   $1: spec name of a blob. Can be used for filtering.
-#       If the spec is "src:dest", then $1 is "dest".
-#       If the spec is "src", then $1 is "src".
-#   $2: path to blob file. Can be used for fixups.
-#
-function blob_fixup() {
-    :
-}
-
-#
-# extract:
-#
-# Positional parameters:
-# $1: file containing the list of items to extract (aka proprietary-files.txt)
-# $2: path to extracted system folder, an ota zip file, or "adb" to extract from device
-# $3: section in list file to extract - optional. Setting section via $3 is deprecated.
-#
-# Non-positional parameters (coming after $2):
-# --section: preferred way of selecting the portion to parse and extract from
-#            proprietary-files.txt
-# --kang: if present, this option will activate the printing of hashes for the
-#         extracted blobs. Useful with --section for subsequent pinning of
-#         blobs taken from other origins.
-#
-function extract() {
-    # Consume positional parameters
-    local PROPRIETARY_FILES_TXT="$1"; shift
-    local SRC="$1"; shift
-    local SECTION=""
-    local KANG=false
-
-    # Consume optional, non-positional parameters
-    while [ "$#" -gt 0 ]; do
-        case "$1" in
-        -s|--section)
-            SECTION="$2"; shift
-            ;;
-        -k|--kang)
-            KANG=true
-            DISABLE_PINNING=1
-            ;;
-        *)
-            # Backwards-compatibility with the old behavior, where $3, if
-            # present, denoted an optional positional ${SECTION} argument.
-            # Users of ${SECTION} are encouraged to migrate from setting it as
-            # positional $3, to non-positional --section ${SECTION}, the
-            # reason being that it doesn't scale to have more than 1 optional
-            # positional argument.
-            SECTION="$1"
-            ;;
-        esac
-        shift
-    done
-
-    if [ -z "$OUTDIR" ]; then
-        echo "Output dir not set!"
-        exit 1
-    fi
-
-    parse_file_list "${PROPRIETARY_FILES_TXT}" "${SECTION}"
-
-    # Allow failing, so we can try $DEST and/or $FILE
-    set +e
-
-    local FILELIST=( ${PRODUCT_COPY_FILES_LIST[@]} ${PRODUCT_PACKAGES_LIST[@]} )
-    local HASHLIST=( ${PRODUCT_COPY_FILES_HASHES[@]} ${PRODUCT_PACKAGES_HASHES[@]} )
-    local FIXUP_HASHLIST=( ${PRODUCT_COPY_FILES_FIXUP_HASHES[@]} ${PRODUCT_PACKAGES_FIXUP_HASHES[@]} )
-    local PRODUCT_COPY_FILES_COUNT=${#PRODUCT_COPY_FILES_LIST[@]}
-    local COUNT=${#FILELIST[@]}
-    local OUTPUT_ROOT="$LINEAGE_ROOT"/"$OUTDIR"/proprietary
-    local OUTPUT_TMP="$TMPDIR"/"$OUTDIR"/proprietary
-
-    if [ "$SRC" = "adb" ]; then
-        init_adb_connection
-    fi
-
-    if [ -f "$SRC" ] && [ "${SRC##*.}" == "zip" ]; then
-        DUMPDIR="$TMPDIR"/system_dump
-
-        # Check if we're working with the same zip that was passed last time.
-        # If so, let's just use what's already extracted.
-        MD5=`md5sum "$SRC"| awk '{print $1}'`
-        OLDMD5=`cat "$DUMPDIR"/zipmd5.txt`
-
-        if [ "$MD5" != "$OLDMD5" ]; then
-            rm -rf "$DUMPDIR"
-            mkdir "$DUMPDIR"
-            unzip "$SRC" -d "$DUMPDIR"
-            echo "$MD5" > "$DUMPDIR"/zipmd5.txt
-
-            # Stop if an A/B OTA zip is detected. We cannot extract these.
-            if [ -a "$DUMPDIR"/payload.bin ]; then
-                echo "A/B style OTA zip detected. This is not supported at this time. Stopping..."
-                exit 1
-            # If OTA is block based, extract it.
-            elif [ -a "$DUMPDIR"/system.new.dat ]; then
-                echo "Converting system.new.dat to system.img"
-                python "$LINEAGE_ROOT"/vendor/lineage/build/tools/sdat2img.py "$DUMPDIR"/system.transfer.list "$DUMPDIR"/system.new.dat "$DUMPDIR"/system.img 2>&1
-                rm -rf "$DUMPDIR"/system.new.dat "$DUMPDIR"/system
-                mkdir "$DUMPDIR"/system "$DUMPDIR"/tmp
-                echo "Requesting sudo access to mount the system.img"
-                sudo mount -o loop "$DUMPDIR"/system.img "$DUMPDIR"/tmp
-                cp -r "$DUMPDIR"/tmp/* "$DUMPDIR"/system/
-                sudo umount "$DUMPDIR"/tmp
-                rm -rf "$DUMPDIR"/tmp "$DUMPDIR"/system.img
-            fi
-        fi
-
-        SRC="$DUMPDIR"
-    fi
-
-    if [ "$VENDOR_STATE" -eq "0" ]; then
-        echo "Cleaning output directory ($OUTPUT_ROOT).."
-        rm -rf "${OUTPUT_TMP:?}"
-        mkdir -p "${OUTPUT_TMP:?}"
-        if [ -d "$OUTPUT_ROOT" ]; then
-            mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
-        fi
-        VENDOR_STATE=1
-    fi
-
-    echo "Extracting ${COUNT} files in ${PROPRIETARY_FILES_TXT} from ${SRC}:"
-
-    for (( i=1; i<COUNT+1; i++ )); do
-
-        local SPEC_SRC_FILE=$(src_file "${FILELIST[$i-1]}")
-        local SPEC_DST_FILE=$(target_file "${FILELIST[$i-1]}")
-        local SPEC_ARGS=$(target_args "${FILELIST[$i-1]}")
-        local OUTPUT_DIR=
-        local TMP_DIR=
-        local SRC_FILE=
-        local DST_FILE=
-        local IS_PRODUCT_PACKAGE=false
-
-        # Note: this relies on the fact that the ${FILELIST[@]} array
-        # contains first ${PRODUCT_COPY_FILES_LIST[@]}, then ${PRODUCT_PACKAGES_LIST[@]}.
-        if [ "${i}" -gt "${PRODUCT_COPY_FILES_COUNT}" ]; then
-            IS_PRODUCT_PACKAGE=true
-        fi
-
-        if [ "${SPEC_ARGS}" = "rootfs" ]; then
-            OUTPUT_DIR="${OUTPUT_ROOT}/rootfs"
-            TMP_DIR="${OUTPUT_TMP}/rootfs"
-            SRC_FILE="/${SPEC_SRC_FILE}"
-            DST_FILE="/${SPEC_DST_FILE}"
-        else
-            OUTPUT_DIR="${OUTPUT_ROOT}"
-            TMP_DIR="${OUTPUT_TMP}"
-            SRC_FILE="/system/${SPEC_SRC_FILE}"
-            DST_FILE="/system/${SPEC_DST_FILE}"
-        fi
-
-        # Strip the file path in the vendor repo of "system", if present
-        local VENDOR_REPO_FILE="$OUTPUT_DIR/${DST_FILE#/system}"
-        local BLOB_DISPLAY_NAME="${DST_FILE#/system/}"
-        mkdir -p $(dirname "${VENDOR_REPO_FILE}")
-
-        # Check pinned files
-        local HASH="$(echo ${HASHLIST[$i-1]} | awk '{ print tolower($0); }')"
-        local FIXUP_HASH="$(echo ${FIXUP_HASHLIST[$i-1]} | awk '{ print tolower($0); }')"
-        local KEEP=""
-        if [ "$DISABLE_PINNING" != "1" ] && [ "$HASH" != "x" ]; then
-            if [ -f "${VENDOR_REPO_FILE}" ]; then
-                local PINNED="${VENDOR_REPO_FILE}"
-            else
-                local PINNED="${TMP_DIR}${DST_FILE#/system}"
-            fi
-            if [ -f "$PINNED" ]; then
-                local TMP_HASH=$(get_hash "${PINNED}")
-                if [ "${TMP_HASH}" = "${HASH}" ] || [ "${TMP_HASH}" = "${FIXUP_HASH}" ]; then
-                    KEEP="1"
-                    if [ ! -f "${VENDOR_REPO_FILE}" ]; then
-                        cp -p "$PINNED" "${VENDOR_REPO_FILE}"
-                    fi
-                fi
-            fi
-        fi
-
-        if [ "${KANG}" = false ]; then
-            printf '  - %s\n' "${BLOB_DISPLAY_NAME}"
-        fi
-
-        if [ "$KEEP" = "1" ]; then
-            printf '    + keeping pinned file with hash %s\n' "${HASH}"
-        else
-            FOUND=false
-            # Try Lineage target first.
-            # Also try to search for files stripped of
-            # the "/system" prefix, if we're actually extracting
-            # from a system image.
-            for CANDIDATE in "${DST_FILE}" "${SRC_FILE}"; do
-                get_file ${CANDIDATE} ${VENDOR_REPO_FILE} ${SRC} && {
-                    FOUND=true
-                    break
-                }
-            done
-
-            if [ "${FOUND}" = false ]; then
-                printf '    !! %s: file not found in source\n' "${BLOB_DISPLAY_NAME}"
-                continue
-            fi
-        fi
-
-        # Blob fixup pipeline has 2 parts: one that is fixed and
-        # one that is user-configurable
-        local PRE_FIXUP_HASH=$(get_hash ${VENDOR_REPO_FILE})
-        # Deodex apk|jar if that's the case
-        if [[ "$FULLY_DEODEXED" -ne "1" && "${VENDOR_REPO_FILE}" =~ .(apk|jar)$ ]]; then
-            oat2dex "${VENDOR_REPO_FILE}" "${SRC_FILE}" "$SRC"
-            if [ -f "$TMPDIR/classes.dex" ]; then
-                zip -gjq "${VENDOR_REPO_FILE}" "$TMPDIR/classes"*
-                rm "$TMPDIR/classes"*
-                printf '    (updated %s from odex files)\n' "${SRC_FILE}"
-            fi
-        elif [[ "${VENDOR_REPO_FILE}" =~ .xml$ ]]; then
-            fix_xml "${VENDOR_REPO_FILE}"
-        fi
-        # Now run user-supplied fixup function
-        blob_fixup "${BLOB_DISPLAY_NAME}" "${VENDOR_REPO_FILE}"
-        local POST_FIXUP_HASH=$(get_hash ${VENDOR_REPO_FILE})
-
-        if [ -f "${VENDOR_REPO_FILE}" ]; then
-            local DIR=$(dirname "${VENDOR_REPO_FILE}")
-            local TYPE="${DIR##*/}"
-            if [ "$TYPE" = "bin" -o "$TYPE" = "sbin" ]; then
-                chmod 755 "${VENDOR_REPO_FILE}"
-            else
-                chmod 644 "${VENDOR_REPO_FILE}"
-            fi
-        fi
-
-        if [ "${KANG}" =  true ]; then
-            print_spec "${IS_PRODUCT_PACKAGE}" "${SPEC_SRC_FILE}" "${SPEC_DST_FILE}" "${SPEC_ARGS}" "${PRE_FIXUP_HASH}" "${POST_FIXUP_HASH}"
-        fi
-
-        # Check and print whether the fixup pipeline actually did anything.
-        # This isn't done right after the fixup pipeline because we want this print
-        # to come after print_spec above, when in kang mode.
-        if [ "${PRE_FIXUP_HASH}" != "${POST_FIXUP_HASH}" ]; then
-            printf "    + Fixed up %s\n" "${BLOB_DISPLAY_NAME}"
-            # Now sanity-check the spec for this blob.
-            if [ "${KANG}" = false ] && [ "${FIXUP_HASH}" = "x" ] && [ "${HASH}" != "x" ]; then
-                printf "WARNING: The %s file was fixed up, but it is pinned.\n" ${BLOB_DISPLAY_NAME}
-                printf "This is a mistake and you want to either remove the hash completely, or add an extra one.\n"
-            fi
-        fi
-
-    done
-
-    # Don't allow failing
-    set -e
-}
-
-#
-# extract_firmware:
-#
-# $1: file containing the list of items to extract
-# $2: path to extracted radio folder
-#
-function extract_firmware() {
-    if [ -z "$OUTDIR" ]; then
-        echo "Output dir not set!"
-        exit 1
-    fi
-
-    parse_file_list "$1"
-
-    # Don't allow failing
-    set -e
-
-    local FILELIST=( ${PRODUCT_COPY_FILES_LIST[@]} )
-    local COUNT=${#FILELIST[@]}
-    local SRC="$2"
-    local OUTPUT_DIR="$LINEAGE_ROOT"/"$OUTDIR"/radio
-
-    if [ "$VENDOR_RADIO_STATE" -eq "0" ]; then
-        echo "Cleaning firmware output directory ($OUTPUT_DIR).."
-        rm -rf "${OUTPUT_DIR:?}/"*
-        VENDOR_RADIO_STATE=1
-    fi
-
-    echo "Extracting $COUNT files in $1 from $SRC:"
-
-    for (( i=1; i<COUNT+1; i++ )); do
-        local FILE="${FILELIST[$i-1]}"
-        printf '  - %s \n' "/radio/$FILE"
-
-        if [ ! -d "$OUTPUT_DIR" ]; then
-            mkdir -p "$OUTPUT_DIR"
-        fi
-        cp "$SRC/$FILE" "$OUTPUT_DIR/$FILE"
-        chmod 644 "$OUTPUT_DIR/$FILE"
-    done
-}
-
-function extract_img_data() {
-    local image_file="$1"
-    local out_dir="$2"
-    local logFile="$TMPDIR/debugfs.log"
-
-    if [ ! -d "$out_dir" ]; then
-        mkdir -p "$out_dir"
-    fi
-
-    if [[ "$HOST_OS" == "Darwin" ]]; then
-        debugfs -R "rdump / \"$out_dir\"" "$image_file" &> "$logFile" || {
-            echo "[-] Failed to extract data from '$image_file'"
-            abort 1
-        }
-    else
-        debugfs -R 'ls -p' "$image_file" 2>/dev/null | cut -d '/' -f6 | while read -r entry
-        do
-            debugfs -R "rdump \"$entry\" \"$out_dir\"" "$image_file" >> "$logFile" 2>&1 || {
-                echo "[-] Failed to extract data from '$image_file'"
-                abort 1
-            }
-        done
-    fi
-
-    local symlink_err="rdump: Attempt to read block from filesystem resulted in short read while reading symlink"
-    if grep -Fq "$symlink_err" "$logFile"; then
-        echo "[-] Symlinks have not been properly processed from $image_file"
-        echo "[!] If you don't have a compatible debugfs version, modify 'execute-all.sh' to disable 'USE_DEBUGFS' flag"
-        abort 1
-    fi
-}
-
-declare -ra VENDOR_SKIP_FILES=(
-  "bin/toybox_vendor"
-  "bin/toolbox"
-  "bin/grep"
-  "build.prop"
-  "compatibility_matrix.xml"
-  "default.prop"
-  "etc/NOTICE.xml.gz"
-  "etc/vintf/compatibility_matrix.xml"
-  "etc/vintf/manifest.xml"
-  "etc/wifi/wpa_supplicant.conf"
-  "manifest.xml"
-  "overlay/DisplayCutoutEmulationCorner/DisplayCutoutEmulationCornerOverlay.apk"
-  "overlay/DisplayCutoutEmulationDouble/DisplayCutoutEmulationDoubleOverlay.apk"
-  "overlay/DisplayCutoutEmulationTall/DisplayCutoutEmulationTallOverlay.apk"
-  "overlay/DisplayCutoutNoCutout/NoCutoutOverlay.apk"
-  "overlay/framework-res__auto_generated_rro.apk"
-  "overlay/SysuiDarkTheme/SysuiDarkThemeOverlay.apk"
-)
-
-function array_contains() {
-    local element
-    for element in "${@:2}"; do [[ "$element" == "$1" ]] && return 0; done
-    return 1
-}
-
-function generate_prop_list_from_image() {
-    local image_file="$1"
-    local image_dir="$TMPDIR/image-temp"
-    local output_list="$2"
-    local output_list_tmp="$TMPDIR/_proprietary-blobs.txt"
-    local -n skipped_vendor_files="$3"
-
-    extract_img_data "$image_file" "$image_dir"
-
-    find "$image_dir" -not -type d | sed "s#^$image_dir/##" | while read -r FILE
-    do
-        # Skip VENDOR_SKIP_FILES since it will be re-generated at build time
-        if array_contains "$FILE" "${VENDOR_SKIP_FILES[@]}"; then
-            continue
-        fi
-        # Skip device defined skipped files since they will be re-generated at build time
-        if array_contains "$FILE" "${skipped_vendor_files[@]}"; then
-            continue
-        fi
-        if suffix_match_file ".apk" "$FILE" ; then
-            echo "-vendor/$FILE" >> "$output_list_tmp"
-        else
-            echo "vendor/$FILE" >> "$output_list_tmp"
-        fi
-    done
-
-    # Sort merged file with all lists
-    sort -u "$output_list_tmp" > "$output_list"
-
-    # Clean-up
-    rm -f "$output_list_tmp"
-}
diff --git a/charger/Android.mk b/charger/Android.mk
index 5d42e6a..6ec2330 100644
--- a/charger/Android.mk
+++ b/charger/Android.mk
@@ -15,8 +15,8 @@
 endif
 
 include $(CLEAR_VARS)
-LOCAL_SRC_FILES := healthd_board_lineage.cpp
-LOCAL_MODULE := libhealthd.lineage
+LOCAL_SRC_FILES := healthd_board_bliss.cpp
+LOCAL_MODULE := libhealthd.bliss
 LOCAL_CFLAGS := -Werror
 LOCAL_C_INCLUDES := \
     system/core/healthd/include \
@@ -45,7 +45,7 @@
 
 define _add-charger-image
 include $$(CLEAR_VARS)
-LOCAL_MODULE := vendor_lineage_charger_$(notdir $(1))
+LOCAL_MODULE := vendor_bliss_charger_$(notdir $(1))
 LOCAL_MODULE_STEM := $(notdir $(1))
 _img_modules += $$(LOCAL_MODULE)
 LOCAL_SRC_FILES := $1
@@ -61,7 +61,7 @@
   $(eval $(call _add-charger-image,$(_img))))
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := lineage_charger_res_images
+LOCAL_MODULE := bliss_charger_res_images
 LOCAL_MODULE_TAGS := optional
 LOCAL_REQUIRED_MODULES := $(_img_modules)
 LOCAL_OVERRIDES_PACKAGES := charger_res_images
diff --git a/charger/healthd_board_lineage.cpp b/charger/healthd_board_bliss.cpp
similarity index 98%
rename from charger/healthd_board_lineage.cpp
rename to charger/healthd_board_bliss.cpp
index dcfbc4a..c2f42ea 100644
--- a/charger/healthd_board_lineage.cpp
+++ b/charger/healthd_board_bliss.cpp
@@ -290,10 +290,10 @@
     char value[PROP_VALUE_MAX];
     int rc = 0, scale_count = 0, i;
     GRSurface **scale_frames;
-    int scale_fps;  // Not in use (charger/lineage_battery_scale doesn't have FPS text
+    int scale_fps;  // Not in use (charger/bliss_battery_scale doesn't have FPS text
                     // chunk). We are using hard-coded frame.disp_time instead.
 
-    rc = res_create_multi_display_surface("charger/lineage_battery_scale",
+    rc = res_create_multi_display_surface("charger/bliss_battery_scale",
             &scale_count, &scale_fps, &scale_frames);
     if (rc < 0) {
         LOGE("%s: Unable to load battery scale image", __func__);
diff --git a/charger/images/hdpi/lineage_battery_scale.png b/charger/images/hdpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/hdpi/lineage_battery_scale.png
rename to charger/images/hdpi/bliss_battery_scale.png
Binary files differ
diff --git a/charger/images/ldpi/lineage_battery_scale.png b/charger/images/ldpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/ldpi/lineage_battery_scale.png
rename to charger/images/ldpi/bliss_battery_scale.png
Binary files differ
diff --git a/charger/images/mdpi/lineage_battery_scale.png b/charger/images/mdpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/mdpi/lineage_battery_scale.png
rename to charger/images/mdpi/bliss_battery_scale.png
Binary files differ
diff --git a/charger/images/xhdpi/lineage_battery_scale.png b/charger/images/xhdpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/xhdpi/lineage_battery_scale.png
rename to charger/images/xhdpi/bliss_battery_scale.png
Binary files differ
diff --git a/charger/images/xxhdpi/lineage_battery_scale.png b/charger/images/xxhdpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/xxhdpi/lineage_battery_scale.png
rename to charger/images/xxhdpi/bliss_battery_scale.png
Binary files differ
diff --git a/charger/images/xxxhdpi/lineage_battery_scale.png b/charger/images/xxxhdpi/bliss_battery_scale.png
similarity index 100%
rename from charger/images/xxxhdpi/lineage_battery_scale.png
rename to charger/images/xxxhdpi/bliss_battery_scale.png
Binary files differ
diff --git a/config/BoardConfigBliss.mk b/config/BoardConfigBliss.mk
new file mode 100644
index 0000000..f984277
--- /dev/null
+++ b/config/BoardConfigBliss.mk
@@ -0,0 +1,12 @@
+# Charger
+ifeq ($(WITH_BLISS_CHARGER),true)
+    BOARD_HAL_STATIC_LIBRARIES := libhealthd.bliss
+endif
+
+include vendor/bliss/config/BoardConfigKernel.mk
+
+ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
+include vendor/bliss/config/BoardConfigQcom.mk
+endif
+
+include vendor/bliss/config/BoardConfigSoong.mk
diff --git a/config/BoardConfigLineage.mk b/config/BoardConfigLineage.mk
deleted file mode 100644
index 547792f..0000000
--- a/config/BoardConfigLineage.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-# Charger
-ifeq ($(WITH_LINEAGE_CHARGER),true)
-    BOARD_HAL_STATIC_LIBRARIES := libhealthd.lineage
-endif
-
-include vendor/lineage/config/BoardConfigKernel.mk
-
-ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
-include vendor/lineage/config/BoardConfigQcom.mk
-endif
-
-include vendor/lineage/config/BoardConfigSoong.mk
diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk
index 82dedad..a6fa538 100644
--- a/config/BoardConfigSoong.mk
+++ b/config/BoardConfigSoong.mk
@@ -10,13 +10,13 @@
 # Documentation here:
 # https://github.com/LineageOS/android_build_soong/commit/8328367c44085b948c003116c0ed74a047237a69
 
-SOONG_CONFIG_NAMESPACES += lineageVarsPlugin
+SOONG_CONFIG_NAMESPACES += blissVarsPlugin
 
-SOONG_CONFIG_lineageVarsPlugin :=
+SOONG_CONFIG_blissVarsPlugin :=
 
 define addVar
-  SOONG_CONFIG_lineageVarsPlugin += $(1)
-  SOONG_CONFIG_lineageVarsPlugin_$(1) := $$(subst ",\",$$($1))
+  SOONG_CONFIG_blissVarsPlugin += $(1)
+  SOONG_CONFIG_blissVarsPlugin_$(1) := $$(subst ",\",$$($1))
 endef
 
 $(foreach v,$(EXPORT_TO_SOONG),$(eval $(call addVar,$(v))))
diff --git a/config/lineage_audio.mk b/config/bliss_audio.mk
similarity index 89%
rename from config/lineage_audio.mk
rename to config/bliss_audio.mk
index 5d97102..83f215e 100644
--- a/config/lineage_audio.mk
+++ b/config/bliss_audio.mk
@@ -1,10 +1,10 @@
 #
-# Lineage Audio Files
+# Bliss Audio Files
 #
 
-ALARM_PATH := vendor/lineage/prebuilt/common/media/audio/alarms
-NOTIFICATION_PATH := vendor/lineage/prebuilt/common/media/audio/notifications
-RINGTONE_PATH := vendor/lineage/prebuilt/common/media/audio/ringtones
+ALARM_PATH := vendor/bliss/prebuilt/common/media/audio/alarms
+NOTIFICATION_PATH := vendor/bliss/prebuilt/common/media/audio/notifications
+RINGTONE_PATH := vendor/bliss/prebuilt/common/media/audio/ringtones
 
 # Alarms
 PRODUCT_COPY_FILES += \
diff --git a/config/common.mk b/config/common.mk
index 4f04a76..88a44f0 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -1,7 +1,7 @@
 # Allow vendor/extra to override any property by setting it first
 $(call inherit-product-if-exists, vendor/extra/product.mk)
 
-PRODUCT_BRAND ?= LineageOS
+PRODUCT_BRAND ?= Bliss
 
 PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
 
@@ -36,44 +36,44 @@
 
 # Backup Tool
 PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
-    vendor/lineage/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
-    vendor/lineage/prebuilt/common/bin/50-lineage.sh:system/addon.d/50-lineage.sh \
-    vendor/lineage/prebuilt/common/bin/blacklist:system/addon.d/blacklist
+    vendor/bliss/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
+    vendor/bliss/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
+    vendor/bliss/prebuilt/common/bin/50-bliss.sh:system/addon.d/50-bliss.sh \
+    vendor/bliss/prebuilt/common/bin/blacklist:system/addon.d/blacklist
 
 ifeq ($(AB_OTA_UPDATER),true)
 PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/bin/backuptool_ab.sh:system/bin/backuptool_ab.sh \
-    vendor/lineage/prebuilt/common/bin/backuptool_ab.functions:system/bin/backuptool_ab.functions \
-    vendor/lineage/prebuilt/common/bin/backuptool_postinstall.sh:system/bin/backuptool_postinstall.sh
+    vendor/bliss/prebuilt/common/bin/backuptool_ab.sh:system/bin/backuptool_ab.sh \
+    vendor/bliss/prebuilt/common/bin/backuptool_ab.functions:system/bin/backuptool_ab.functions \
+    vendor/bliss/prebuilt/common/bin/backuptool_postinstall.sh:system/bin/backuptool_postinstall.sh
 endif
 
 # Backup Services whitelist
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/backup.xml:system/etc/sysconfig/backup.xml
+    vendor/bliss/config/permissions/backup.xml:system/etc/sysconfig/backup.xml
 
 # Lineage-specific broadcast actions whitelist
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/lineage-sysconfig.xml:system/etc/sysconfig/lineage-sysconfig.xml
+    vendor/bliss/config/permissions/lineage-sysconfig.xml:system/etc/sysconfig/lineage-sysconfig.xml
 
 # init.d support
 PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/etc/init.d/00banner:system/etc/init.d/00banner \
-    vendor/lineage/prebuilt/common/bin/sysinit:system/bin/sysinit
+    vendor/bliss/prebuilt/common/etc/init.d/00banner:system/etc/init.d/00banner \
+    vendor/bliss/prebuilt/common/bin/sysinit:system/bin/sysinit
 
 ifneq ($(TARGET_BUILD_VARIANT),user)
 # userinit support
 PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/etc/init.d/90userinit:system/etc/init.d/90userinit
+    vendor/bliss/prebuilt/common/etc/init.d/90userinit:system/etc/init.d/90userinit
 endif
 
-# Copy all Lineage-specific init rc files
-$(foreach f,$(wildcard vendor/lineage/prebuilt/common/etc/init/*.rc),\
+# Copy all Bliss-specific init rc files
+$(foreach f,$(wildcard vendor/bliss/prebuilt/common/etc/init/*.rc),\
 	$(eval PRODUCT_COPY_FILES += $(f):system/etc/init/$(notdir $f)))
 
 # Copy over added mimetype supported in libcore.net.MimeUtils
 PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/lib/content-types.properties:system/lib/content-types.properties
+    vendor/bliss/prebuilt/common/lib/content-types.properties:system/lib/content-types.properties
 
 # Enable SIP+VoIP on all targets
 PRODUCT_COPY_FILES += \
@@ -83,34 +83,34 @@
 PRODUCT_COPY_FILES += \
     frameworks/base/data/keyboards/Vendor_045e_Product_028e.kl:system/usr/keylayout/Vendor_045e_Product_0719.kl
 
-# This is Lineage!
+# Lineage specific permissions
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/org.lineageos.android.xml:system/etc/permissions/org.lineageos.android.xml \
-    vendor/lineage/config/permissions/privapp-permissions-lineage.xml:system/etc/permissions/privapp-permissions-lineage.xml \
-    vendor/lineage/config/permissions/privapp-permissions-cm-legacy.xml:system/etc/permissions/privapp-permissions-cm-legacy.xml
+    vendor/bliss/config/permissions/org.lineageos.android.xml:system/etc/permissions/org.lineageos.android.xml \
+    vendor/bliss/config/permissions/privapp-permissions-lineage.xml:system/etc/permissions/privapp-permissions-lineage.xml \
+    vendor/bliss/config/permissions/privapp-permissions-cm-legacy.xml:system/etc/permissions/privapp-permissions-cm-legacy.xml
 
 # Hidden API whitelist
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/lineage-hiddenapi-package-whitelist.xml:system/etc/permissions/lineage-hiddenapi-package-whitelist.xml
+    vendor/bliss/config/permissions/lineage-hiddenapi-package-whitelist.xml:system/etc/permissions/lineage-hiddenapi-package-whitelist.xml
 
 # Power whitelist
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/lineage-power-whitelist.xml:system/etc/sysconfig/lineage-power-whitelist.xml
+    vendor/bliss/config/permissions/lineage-power-whitelist.xml:system/etc/sysconfig/lineage-power-whitelist.xml
 
 # Include AOSP audio files
-include vendor/lineage/config/aosp_audio.mk
+include vendor/bliss/config/aosp_audio.mk
 
-# Include Lineage audio files
-include vendor/lineage/config/lineage_audio.mk
+# Include Bliss audio files
+include vendor/bliss/config/bliss_audio.mk
 
 ifneq ($(TARGET_DISABLE_LINEAGE_SDK), true)
 # Lineage SDK
-include vendor/lineage/config/lineage_sdk_common.mk
+include vendor/bliss/config/lineage_sdk_common.mk
 endif
 
 # TWRP
 ifeq ($(WITH_TWRP),true)
-include vendor/lineage/config/twrp.mk
+include vendor/bliss/config/twrp.mk
 endif
 
 # Do not include art debug targets
@@ -195,11 +195,11 @@
     charger_res_images
 
 # Custom off-mode charger
-ifeq ($(WITH_LINEAGE_CHARGER),true)
+ifeq ($(WITH_BLISS_CHARGER),true)
 PRODUCT_PACKAGES += \
-    lineage_charger_res_images \
+    bliss_charger_res_images \
     font_log.png \
-    libhealthd.lineage
+    libhealthd.bliss
 endif
 
 # Filesystems tools
@@ -248,126 +248,7 @@
 endif
 endif
 
-PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += vendor/lineage/overlay
-DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/common
-
-PRODUCT_VERSION_MAJOR = 16
-PRODUCT_VERSION_MINOR = 0
-PRODUCT_VERSION_MAINTENANCE := 0
-
-ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true)
-    LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE)
-else
-    LINEAGE_VERSION_MAINTENANCE := 0
-endif
-
-# Set LINEAGE_BUILDTYPE from the env RELEASE_TYPE, for jenkins compat
-
-ifndef LINEAGE_BUILDTYPE
-    ifdef RELEASE_TYPE
-        # Starting with "LINEAGE_" is optional
-        RELEASE_TYPE := $(shell echo $(RELEASE_TYPE) | sed -e 's|^LINEAGE_||g')
-        LINEAGE_BUILDTYPE := $(RELEASE_TYPE)
-    endif
-endif
-
-# Filter out random types, so it'll reset to UNOFFICIAL
-ifeq ($(filter RELEASE NIGHTLY SNAPSHOT EXPERIMENTAL,$(LINEAGE_BUILDTYPE)),)
-    LINEAGE_BUILDTYPE :=
-endif
-
-ifdef LINEAGE_BUILDTYPE
-    ifneq ($(LINEAGE_BUILDTYPE), SNAPSHOT)
-        ifdef LINEAGE_EXTRAVERSION
-            # Force build type to EXPERIMENTAL
-            LINEAGE_BUILDTYPE := EXPERIMENTAL
-            # Remove leading dash from LINEAGE_EXTRAVERSION
-            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
-            # Add leading dash to LINEAGE_EXTRAVERSION
-            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
-        endif
-    else
-        ifndef LINEAGE_EXTRAVERSION
-            # Force build type to EXPERIMENTAL, SNAPSHOT mandates a tag
-            LINEAGE_BUILDTYPE := EXPERIMENTAL
-        else
-            # Remove leading dash from LINEAGE_EXTRAVERSION
-            LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
-            # Add leading dash to LINEAGE_EXTRAVERSION
-            LINEAGE_EXTRAVERSION := -$(LINEAGE_EXTRAVERSION)
-        endif
-    endif
-else
-    # If LINEAGE_BUILDTYPE is not defined, set to UNOFFICIAL
-    LINEAGE_BUILDTYPE := UNOFFICIAL
-    LINEAGE_EXTRAVERSION :=
-endif
-
-ifeq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
-    ifneq ($(TARGET_UNOFFICIAL_BUILD_ID),)
-        LINEAGE_EXTRAVERSION := -$(TARGET_UNOFFICIAL_BUILD_ID)
-    endif
-endif
-
-ifeq ($(LINEAGE_BUILDTYPE), RELEASE)
-    ifndef TARGET_VENDOR_RELEASE_BUILD_ID
-        LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
-    else
-        ifeq ($(TARGET_BUILD_VARIANT),user)
-            ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
-                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
-            else
-                LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
-            endif
-        else
-            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD)
-        endif
-    endif
-else
-    ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
-        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
-            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
-        else
-            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
-        endif
-    else
-        ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true)
-            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
-        else
-            LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD)
-        endif
-    endif
-endif
-
-PRODUCT_EXTRA_RECOVERY_KEYS += \
-    vendor/lineage/build/target/product/security/lineage
-
--include vendor/lineage-priv/keys/keys.mk
-
-LINEAGE_DISPLAY_VERSION := $(LINEAGE_VERSION)
-
-ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),)
-ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey)
-    ifneq ($(LINEAGE_BUILDTYPE), UNOFFICIAL)
-        ifndef TARGET_VENDOR_RELEASE_BUILD_ID
-            ifneq ($(LINEAGE_EXTRAVERSION),)
-                # Remove leading dash from LINEAGE_EXTRAVERSION
-                LINEAGE_EXTRAVERSION := $(shell echo $(LINEAGE_EXTRAVERSION) | sed 's/-//')
-                TARGET_VENDOR_RELEASE_BUILD_ID := $(LINEAGE_EXTRAVERSION)
-            else
-                TARGET_VENDOR_RELEASE_BUILD_ID := $(shell date -u +%Y%m%d)
-            endif
-        else
-            TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID)
-        endif
-        ifeq ($(LINEAGE_VERSION_MAINTENANCE),0)
-            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
-        else
-            LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD)
-        endif
-    endif
-endif
-endif
+PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += vendor/bliss/overlay
+DEVICE_PACKAGE_OVERLAYS += vendor/bliss/overlay/common
 
 -include $(WORKSPACE)/build_env/image-auto-bits.mk
--include vendor/lineage/config/partner_gms.mk
diff --git a/config/common_full.mk b/config/common_full.mk
deleted file mode 100644
index 8a2b02e..0000000
--- a/config/common_full.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Inherit common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common.mk)
-
-PRODUCT_SIZE := full
-
-# Recorder
-PRODUCT_PACKAGES += \
-    Recorder
diff --git a/config/common_full_phone.mk b/config/common_full_phone.mk
deleted file mode 100644
index 224e454..0000000
--- a/config/common_full_phone.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# Inherit full common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_full.mk)
-
-# Required packages
-PRODUCT_PACKAGES += \
-    LatinIME
-
-# Include Lineage LatinIME dictionaries
-PRODUCT_PACKAGE_OVERLAYS += vendor/lineage/overlay/dictionaries
-
-$(call inherit-product, vendor/lineage/config/telephony.mk)
diff --git a/config/common_full_tablet_wifionly.mk b/config/common_full_tablet_wifionly.mk
deleted file mode 100644
index f75d42a..0000000
--- a/config/common_full_tablet_wifionly.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-# Inherit full common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_full.mk)
-
-# Required packages
-PRODUCT_PACKAGES += \
-    LatinIME
-
-# Include Lineage LatinIME dictionaries
-PRODUCT_PACKAGE_OVERLAYS += vendor/lineage/overlay/dictionaries
diff --git a/config/common_full_tv.mk b/config/common_full_tv.mk
deleted file mode 100644
index a921f0a..0000000
--- a/config/common_full_tv.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Inherit full common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_full.mk)
-
-PRODUCT_PACKAGES += \
-    AppDrawer \
-    LineageCustomizer
-
-DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/tv
diff --git a/config/common_mini.mk b/config/common_mini.mk
deleted file mode 100644
index 49caa02..0000000
--- a/config/common_mini.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-# Inherit mini common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common.mk)
-
-PRODUCT_SIZE := mini
diff --git a/config/common_mini_phone.mk b/config/common_mini_phone.mk
deleted file mode 100644
index 6b2c57a..0000000
--- a/config/common_mini_phone.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Inherit mini common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_mini.mk)
-
-# Required packages
-PRODUCT_PACKAGES += \
-    LatinIME
-
-$(call inherit-product, vendor/lineage/config/telephony.mk)
diff --git a/config/common_mini_tablet_wifionly.mk b/config/common_mini_tablet_wifionly.mk
deleted file mode 100644
index 9d803d2..0000000
--- a/config/common_mini_tablet_wifionly.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-# Inherit mini common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_mini.mk)
-
-# Required packages
-PRODUCT_PACKAGES += \
-    LatinIME
diff --git a/config/common_mini_tv.mk b/config/common_mini_tv.mk
deleted file mode 100644
index c23dc87..0000000
--- a/config/common_mini_tv.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-# Inherit mini common Lineage stuff
-$(call inherit-product, vendor/lineage/config/common_mini.mk)
diff --git a/config/data_only.mk b/config/data_only.mk
deleted file mode 100644
index e45a2d5..0000000
--- a/config/data_only.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# World APN list
-PRODUCT_PACKAGES += \
-    apns-conf.xml
-
-# Telephony packages
-PRODUCT_PACKAGES += \
-    Stk \
-    CellBroadcastReceiver
diff --git a/config/lineage_sdk_common.mk b/config/lineage_sdk_common.mk
index cce8d93..6e315cc 100644
--- a/config/lineage_sdk_common.mk
+++ b/config/lineage_sdk_common.mk
@@ -1,13 +1,13 @@
 # Permissions for lineage sdk services
 PRODUCT_COPY_FILES += \
-    vendor/lineage/config/permissions/org.lineageos.audio.xml:system/etc/permissions/org.lineageos.audio.xml \
-    vendor/lineage/config/permissions/org.lineageos.livedisplay.xml:system/etc/permissions/org.lineageos.livedisplay.xml \
-    vendor/lineage/config/permissions/org.lineageos.performance.xml:system/etc/permissions/org.lineageos.performance.xml \
-    vendor/lineage/config/permissions/org.lineageos.profiles.xml:system/etc/permissions/org.lineageos.profiles.xml \
-    vendor/lineage/config/permissions/org.lineageos.settings.xml:system/etc/permissions/org.lineageos.settings.xml \
-    vendor/lineage/config/permissions/org.lineageos.style.xml:system/etc/permissions/org.lineageos.style.xml \
-    vendor/lineage/config/permissions/org.lineageos.trust.xml:system/etc/permissions/org.lineageos.trust.xml \
-    vendor/lineage/config/permissions/org.lineageos.weather.xml:system/etc/permissions/org.lineageos.weather.xml
+    vendor/bliss/config/permissions/org.lineageos.audio.xml:system/etc/permissions/org.lineageos.audio.xml \
+    vendor/bliss/config/permissions/org.lineageos.livedisplay.xml:system/etc/permissions/org.lineageos.livedisplay.xml \
+    vendor/bliss/config/permissions/org.lineageos.performance.xml:system/etc/permissions/org.lineageos.performance.xml \
+    vendor/bliss/config/permissions/org.lineageos.profiles.xml:system/etc/permissions/org.lineageos.profiles.xml \
+    vendor/bliss/config/permissions/org.lineageos.settings.xml:system/etc/permissions/org.lineageos.settings.xml \
+    vendor/bliss/config/permissions/org.lineageos.style.xml:system/etc/permissions/org.lineageos.style.xml \
+    vendor/bliss/config/permissions/org.lineageos.trust.xml:system/etc/permissions/org.lineageos.trust.xml \
+    vendor/bliss/config/permissions/org.lineageos.weather.xml:system/etc/permissions/org.lineageos.weather.xml
 
 # Lineage Platform Library
 PRODUCT_PACKAGES += \
diff --git a/config/partner_gms.mk b/config/partner_gms.mk
deleted file mode 100644
index 78aca8e..0000000
--- a/config/partner_gms.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-ifeq ($(WITH_GMS),true)
-ifeq ($(WITH_GMS_FI),true)
-$(call inherit-product-if-exists, vendor/partner_gms/products/fi.mk)
-else
-ifeq ($(WITH_GMS_MINIMAL),true)
-$(call inherit-product-if-exists, vendor/partner_gms/products/gms_minimal.mk)
-else
-$(call inherit-product-if-exists, vendor/partner_gms/products/gms.mk)
-endif
-endif
-endif
diff --git a/config/telephony.mk b/config/telephony.mk
deleted file mode 100644
index 069e82a..0000000
--- a/config/telephony.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Sensitive Phone Numbers list
-PRODUCT_COPY_FILES += \
-    vendor/lineage/prebuilt/common/etc/sensitive_pn.xml:system/etc/sensitive_pn.xml
-
-# World APN list
-PRODUCT_PACKAGES += \
-    apns-conf.xml
-
-# Telephony packages
-PRODUCT_PACKAGES += \
-    messaging \
-    Stk \
-    CellBroadcastReceiver
-
-# Default ringtone
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-    ro.config.ringtone=Orion.ogg
-
-# Tethering - allow without requiring a provisioning app
-# (for devices that check this)
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
-    net.tethering.noprovisioning=true
diff --git a/prebuilt/common/Android.mk b/prebuilt/common/Android.mk
index 83eecee..c565fce 100644
--- a/prebuilt/common/Android.mk
+++ b/prebuilt/common/Android.mk
@@ -18,10 +18,10 @@
 LOCAL_MODULE := apns-conf.xml
 LOCAL_MODULE_CLASS := ETC
 
-DEFAULT_APNS_FILE := vendor/lineage/prebuilt/common/etc/apns-conf.xml
+DEFAULT_APNS_FILE := vendor/bliss/prebuilt/common/etc/apns-conf.xml
 
 ifdef CUSTOM_APNS_FILE
-CUSTOM_APNS_SCRIPT := vendor/lineage/tools/custom_apns.py
+CUSTOM_APNS_SCRIPT := vendor/bliss/tools/custom_apns.py
 FINAL_APNS_FILE := $(local-generated-sources-dir)/apns-conf.xml
 
 $(FINAL_APNS_FILE): PRIVATE_SCRIPT := $(CUSTOM_APNS_SCRIPT)
diff --git a/prebuilt/common/bin/50-lineage.sh b/prebuilt/common/bin/50-bliss.sh
similarity index 84%
rename from prebuilt/common/bin/50-lineage.sh
rename to prebuilt/common/bin/50-bliss.sh
index 0158744..d4d173b 100755
--- a/prebuilt/common/bin/50-lineage.sh
+++ b/prebuilt/common/bin/50-bliss.sh
@@ -2,8 +2,8 @@
 #
 # ADDOND_VERSION=2
 #
-# /system/addon.d/50-lineage.sh
-# During a LineageOS 16.0 upgrade, this script backs up /system/etc/hosts,
+# /system/addon.d/50-bliss.sh
+# During a Bliss upgrade, this script backs up /system/etc/hosts,
 # /system is formatted and reinstalled, then the file is restored.
 #
 
diff --git a/prebuilt/common/etc/init/lineage-adb.rc b/prebuilt/common/etc/init/bliss-adb.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-adb.rc
rename to prebuilt/common/etc/init/bliss-adb.rc
diff --git a/prebuilt/common/etc/init/lineage-governor.rc b/prebuilt/common/etc/init/bliss-governor.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-governor.rc
rename to prebuilt/common/etc/init/bliss-governor.rc
diff --git a/prebuilt/common/etc/init/lineage-iosched.rc b/prebuilt/common/etc/init/bliss-iosched.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-iosched.rc
rename to prebuilt/common/etc/init/bliss-iosched.rc
diff --git a/prebuilt/common/etc/init/lineage-radio.rc b/prebuilt/common/etc/init/bliss-radio.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-radio.rc
rename to prebuilt/common/etc/init/bliss-radio.rc
diff --git a/prebuilt/common/etc/init/lineage-ssh.rc b/prebuilt/common/etc/init/bliss-ssh.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-ssh.rc
rename to prebuilt/common/etc/init/bliss-ssh.rc
diff --git a/prebuilt/common/etc/init/lineage-system.rc b/prebuilt/common/etc/init/bliss-system.rc
similarity index 96%
rename from prebuilt/common/etc/init/lineage-system.rc
rename to prebuilt/common/etc/init/bliss-system.rc
index 619c6d8..4747c99 100644
--- a/prebuilt/common/etc/init/lineage-system.rc
+++ b/prebuilt/common/etc/init/bliss-system.rc
@@ -1,4 +1,4 @@
-# LineageOS core functionality
+# Bliss core functionality
 on init
     export ANDROID_CACHE /cache
     export TERMINFO /system/etc/terminfo
diff --git a/prebuilt/common/etc/init/lineage-tcp.rc b/prebuilt/common/etc/init/bliss-tcp.rc
similarity index 100%
rename from prebuilt/common/etc/init/lineage-tcp.rc
rename to prebuilt/common/etc/init/bliss-tcp.rc
diff --git a/prebuilt/common/etc/init/lineage-updates.rc b/prebuilt/common/etc/init/bliss-updates.rc
similarity index 71%
rename from prebuilt/common/etc/init/lineage-updates.rc
rename to prebuilt/common/etc/init/bliss-updates.rc
index 3a9b481..eba752c 100644
--- a/prebuilt/common/etc/init/lineage-updates.rc
+++ b/prebuilt/common/etc/init/bliss-updates.rc
@@ -1,4 +1,4 @@
 on post-fs-data
     # Create an additional OTA package directory that unlike /data/ota_package
     # will not be touched by GmsCore.
-    mkdir /data/lineageos_updates 0770 system cache
+    mkdir /data/bliss_updates 0770 system cache
diff --git a/tools/custom_apns.py b/tools/custom_apns.py
index b58ece1..9ba0907 100644
--- a/tools/custom_apns.py
+++ b/tools/custom_apns.py
@@ -21,7 +21,7 @@
 def main(argv):
     reload(sys)
     sys.setdefaultencoding('utf8')
-    original_file = 'vendor/lineage/prebuilt/common/etc/apns-conf.xml'
+    original_file = 'vendor/bliss/prebuilt/common/etc/apns-conf.xml'
 
     if len(argv) == 3:
         output_file_path = argv[1]