Skip to content

Commit

Permalink
[helpers] fix path to configs directory
Browse files Browse the repository at this point in the history
Signed-off-by: Simonas Leleiva <simonas.leleiva@jollamobile.com>

Conflicts:
	helpers/add_new_device.sh
	helpers/amibehind.sh
  • Loading branch information
sledges committed Apr 21, 2015
1 parent c1eef3b commit b8f68b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
15 changes: 8 additions & 7 deletions helpers/add_new_device.sh
Expand Up @@ -8,17 +8,18 @@ if [ -z $DEVICE ]; then
exit 1
fi

CONFIG_DIR=hybris/droid-configs
ROOTFS_DIR=sparse
PATTERNS_DIR=patterns
PATTERNS_DEVICE_DIR=$PATTERNS_DIR/$DEVICE
PATTERNS_TEMPLATES_DIR=dhd/$PATTERNS_DIR/templates
PATTERNS_DIR=droid-configs-device/patterns
PATTERNS_DEVICE_DIR=patterns
PATTERNS_TEMPLATES_DIR=$CONFIG_DIR/$PATTERNS_DIR/templates

if [ ! -d rpm/$PATTERNS_TEMPLATES_DIR ]; then
if [ ! -d $PATTERNS_TEMPLATES_DIR ]; then
echo $0: launch this script from the $ANDROID_ROOT directory
exit 1
fi

cd rpm/
cd $CONFIG_DIR

if [[ -e $ROOTFS_DIR && ! $1 == "-y" ]]; then
read -p "Device $DEVICE appears to be already created. Re-generate patterns? [Y/n] " -n 1 -r
Expand All @@ -43,11 +44,11 @@ for pattern in $(find $PATTERNS_DIR/{common,hybris,templates} -name *.yaml); do
echo $PATTERNS_FILE
cat <<'EOF' >$PATTERNS_FILE
# Feel free to disable non-critical HA parts during devel by commenting out
# Generated in hadk by executing: cd $ANDROID_ROOT; rpm/helpers/add_new_device.sh
# Generated in hadk by executing: cd $ANDROID_ROOT; rpm/dhd/helpers/add_new_device.sh
EOF
sed -e 's|@DEVICE@|'$DEVICE'|g' $pattern >>$PATTERNS_FILE
done

cd ..
cd -

12 changes: 6 additions & 6 deletions helpers/amibehind.sh
Expand Up @@ -14,14 +14,14 @@ fi

# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.
CONFIG_DIR=hybris/droid-configs

while getopts "ps:" opt; do
while getopts "ps" opt; do
case "$opt" in
p) cd rpm
dhd/helpers/add_new_device.sh -y
git diff
echo "Patterns updated. Do cd rpm/; git diff to accept changes you're happy with"
cd ..
p) rpm/dhd/helpers/add_new_device.sh -y
git --no-pager --git-dir=$CONFIG_DIR/.git --work-tree=$CONFIG_DIR diff
echo
echo "Patterns updated. Do cd $CONFIG_DIR/ and commit changes you're happy with"
;;
s) echo Comparing submodules currently unsupported
;;
Expand Down

0 comments on commit b8f68b0

Please sign in to comment.