728x90

original link : http://techqa.info/programming/question/28285850/Opensuse-13-1-build-envsetup-sh--syntax-error-near-unexpected-token------r--



Error:

bash: build/envsetup.sh: line 1: syntax error near unexpected token $'{\r'' 'ash: build/envsetup.sh: line 1:function hmm() {


Solve:

The problem comes from Windows end-of-lines (EOL) so you'll have to convert all scripts to unix-style EOL through dos2unix (run apt-get install dos2unix on Ubuntu) and then convert your scripts:

dos2unix build/envsetup.sh sdk/bash_completion/adb.bash

Then all vendorsetup.sh (that will prevent the "command not found" error you get):

find device/ -name vendorsetup.sh -exec dos2unix {} \;

And one last to run the choosecombo script:

dos2unix build/core/find-jdk-tools-jar.sh

EDIT: In order to finish the overall compilation, the exhaustive conversion:

find . -name '*.sh' -exec dos2unix {} \;
find . -name '*.py' -exec dos2unix {} \;
find . -name '*.c' -exec dos2unix {} \;
find . -name '*.h' -exec dos2unix {} \;
find . -name '*.cpp' -exec dos2unix {} \;
find . -name '*.hpp' -exec dos2unix {} \;
find . -name '*.txt' -exec dos2unix {} \;
find . -name 'Config.in' -exec dos2unix {} \;
find . -name 'Config.src' -exec dos2unix {} \;
find . -name 'Makefile' -exec dos2unix {} \;
find . -name 'mkmakefile' -exec dos2unix {} \;
find . -name 'Kconfig*' -exec dos2unix {} \;
find . -name rmtypedefs -exec dos2unix {} \;
find . -name apicheck -exec dos2unix {} \;
find . -name seapp_contexts -exec dos2unix {} \;
dos2unix external/busybox/scripts/* external/busybox/applets/* kernel/scripts/* dalvik/dx/etc/* prebuilts/sdk/tools/*

The *.sh for all shell scripts, and *.py for all python scripts (used during make compilation), as well as .c and .cpp file (obviously) and other files used by makefiles.

Of course you could go the over-overkill find . -type f -exec dos2unix -s -k -o {} \; and let dos2unix decide which files are text and which are binary.

There might be other. I'll edit this answer as I find new ones...

728x90
728x90

Error:


Checking API: checkapi-last

out/target/common/obj/PACKAGING/public_api.txt:23556: error 12: Class android.telephony.gsm.SmsMessage changed static qualifier

prebuilts/sdk/api/19.txt:23513: error 9: Removed public constructor SmsMessage()

prebuilts/sdk/api/19.txt:23514: error 9: Removed public method android.telephony.gsm.SmsMessage.calculateLength

prebuilts/sdk/api/19.txt:23515: error 9: Removed public method android.telephony.gsm.SmsMessage.calculateLength

prebuilts/sdk/api/19.txt:23516: error 9: Removed public method android.telephony.gsm.SmsMessage.createFromPdu

prebuilts/sdk/api/19.txt:23517: error 9: Removed public method android.telephony.gsm.SmsMessage.getDisplayMessageBody

prebuilts/sdk/api/19.txt:23518: error 9: Removed public method android.telephony.gsm.SmsMessage.getDisplayOriginatingAddress

prebuilts/sdk/api/19.txt:23519: error 9: Removed public method android.telephony.gsm.SmsMessage.getEmailBody

prebuilts/sdk/api/19.txt:23520: error 9: Removed public method android.telephony.gsm.SmsMessage.getEmailFrom

prebuilts/sdk/api/19.txt:23521: error 9: Removed public method android.telephony.gsm.SmsMessage.getIndexOnSim

prebuilts/sdk/api/19.txt:23522: error 9: Removed public method android.telephony.gsm.SmsMessage.getMessageBody

prebuilts/sdk/api/19.txt:23523: error 9: Removed public method android.telephony.gsm.SmsMessage.getMessageClass

prebuilts/sdk/api/19.txt:23524: error 9: Removed public method android.telephony.gsm.SmsMessage.getOriginatingAddress

prebuilts/sdk/api/19.txt:23525: error 9: Removed public method android.telephony.gsm.SmsMessage.getPdu

prebuilts/sdk/api/19.txt:23526: error 9: Removed public method android.telephony.gsm.SmsMessage.getProtocolIdentifier

prebuilts/sdk/api/19.txt:23527: error 9: Removed public method android.telephony.gsm.SmsMessage.getPseudoSubject

prebuilts/sdk/api/19.txt:23528: error 9: Removed public method android.telephony.gsm.SmsMessage.getServiceCenterAddress

prebuilts/sdk/api/19.txt:23529: error 9: Removed public method android.telephony.gsm.SmsMessage.getStatus

prebuilts/sdk/api/19.txt:23530: error 9: Removed public method android.telephony.gsm.SmsMessage.getStatusOnSim

prebuilts/sdk/api/19.txt:23531: error 9: Removed public method android.telephony.gsm.SmsMessage.getSubmitPdu

prebuilts/sdk/api/19.txt:23532: error 9: Removed public method android.telephony.gsm.SmsMessage.getSubmitPdu

prebuilts/sdk/api/19.txt:23533: error 9: Removed public method android.telephony.gsm.SmsMessage.getTPLayerLengthForPDU

prebuilts/sdk/api/19.txt:23534: error 9: Removed public method android.telephony.gsm.SmsMessage.getTimestampMillis

prebuilts/sdk/api/19.txt:23535: error 9: Removed public method android.telephony.gsm.SmsMessage.getUserData

prebuilts/sdk/api/19.txt:23536: error 9: Removed public method android.telephony.gsm.SmsMessage.isCphsMwiMessage

prebuilts/sdk/api/19.txt:23537: error 9: Removed public method android.telephony.gsm.SmsMessage.isEmail

prebuilts/sdk/api/19.txt:23538: error 9: Removed public method android.telephony.gsm.SmsMessage.isMWIClearMessage

prebuilts/sdk/api/19.txt:23539: error 9: Removed public method android.telephony.gsm.SmsMessage.isMWISetMessage

prebuilts/sdk/api/19.txt:23540: error 9: Removed public method android.telephony.gsm.SmsMessage.isMwiDontStore

prebuilts/sdk/api/19.txt:23541: error 9: Removed public method android.telephony.gsm.SmsMessage.isReplace

prebuilts/sdk/api/19.txt:23542: error 9: Removed public method android.telephony.gsm.SmsMessage.isReplyPathPresent

prebuilts/sdk/api/19.txt:23543: error 9: Removed public method android.telephony.gsm.SmsMessage.isStatusReportMessage

prebuilts/sdk/api/19.txt:23544: error 10: Removed field android.telephony.gsm.SmsMessage.ENCODING_16BIT

prebuilts/sdk/api/19.txt:23545: error 10: Removed field android.telephony.gsm.SmsMessage.ENCODING_7BIT

prebuilts/sdk/api/19.txt:23546: error 10: Removed field android.telephony.gsm.SmsMessage.ENCODING_8BIT

prebuilts/sdk/api/19.txt:23547: error 10: Removed field android.telephony.gsm.SmsMessage.ENCODING_UNKNOWN

prebuilts/sdk/api/19.txt:23548: error 10: Removed field android.telephony.gsm.SmsMessage.MAX_USER_DATA_BYTES

prebuilts/sdk/api/19.txt:23549: error 10: Removed field android.telephony.gsm.SmsMessage.MAX_USER_DATA_SEPTETS

prebuilts/sdk/api/19.txt:23550: error 10: Removed field android.telephony.gsm.SmsMessage.MAX_USER_DATA_SEPTETS_WITH_HEADER


******************************

You have tried to change the API from what has been previously released in

an SDK.  Please fix the errors listed above.

******************************


Solution:


1. change javadoc

$sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/local/jdk1.6.0_45/bin/javadoc" 1;


$sudo update-alternatives --config javadoc


2. update API

$make update-api



728x90
728x90

vim에서 backspace 되지 않을

~/.bashrc 또는 ~/.bash_profile 추가

stty erase '^?'

 

vim에서 .vimrc 가져오지 못을

~/.bashrc 또는 ~/.bash_profile 추가

alias vim="vim -S ~/.vimrc"

 

 

vim source insight처럼 사용하기(taglist, SrcExpl, nerdTree)

* SrcExpl: http://www.vim.org/scripts/script.php?script_id=2179
* taglist: http://www.vim.org/scripts/script.php?script_id=273
*nerdTree: http://www.vim.org/scripts/script.php?script_id=1658

~/.vim/ 하위에 설치


~/.vimrc 수정

set tabstop=2

set shiftwidth=2

set softtabstop=2

set cindent

set autoindent

set smartindent

set incsearch

syntax on

filetype on

set background=dark

colorscheme evening

set backspace=eol,start,indent

set history=1000

set hlsearch

set showmatch

set nu

"============= Like a Source Insight =============”

"=== Taglist ===

" // The switch of the Taglist

nmap <F7> :TlistToggle<CR>

let Tlist_Ctags_Cmnd = "/usr/bin/ctags"

let Tlist_Inc_Winwidth = 0

let Tlist_Exit_OnlyWindow = 0

let Tlist_Auto_Open = 0

let Tlist_Use_Left_Window = 1

"=== NERDTree ===

" // The switch of the NERDTree

nmap <F9> :NERDTreeToggle<CR>

let NERDTreeWinPos = "right"

"=== Source explorer ===

" // The switch of the Source Explorer

nmap <F8> :SrcExplToggle<CR>

"// Map the keys below to jump from one window to another:

nmap <C-H> <C-W>h

nmap <C-J> <C-W>j

nmap <C-K> <C-W>k

nmap <C-L> <C-W>l

let g:SrcExpl_winHeight = 8

let g:SrcExpl_refreshTime = 100

let g:SrcExpl_isUpdateTags = 0

" // Set “Enter” key to jump into the exact definition context

let g:SrcExpl_jumpKey = "<ENTER>"

" // Set “Space” key for back from the definition context

let g:SrcExpl_gobackKey = "<SPACE>"

map <F3> :tnext^M

map <F2> :tprevious^M

 

경우 F7, F8, F9 이용하여 켜고 있음.


Tag 생성

mktrace.sh

#!/bin/sh

rm -rf cscope.files cscope.files

rm -rf tags


find . \( -name  *.c  -o -name  *.cpp  -o -name  *.cc  -o -name  *.h  -o -name  *.s  -o -name  *.S  -o -name  *.asm  \) -print > cscope.files

ctags -R


cscope -i cscope.files 


728x90
728x90

bash를 주로 사용하는데 sh로 초기 shell이 적용되어 color가 맞지 않는다거나 하는 경우


# echo $SHELL

output : 

/bin/sh


chsh -s {shell-name} {user-name}

#sudo chsh -s /bin/bash john



728x90

'Programming > linux왕초보' 카테고리의 다른 글

[Linux] print file path  (0) 2021.12.22
[python] read file, write file  (0) 2021.12.15
ssh사용 시 diffie-hellman-group1-sha1 관련  (0) 2018.01.30
pthread min, max priority on linux  (0) 2017.06.12
use vim like as source insight  (0) 2016.04.06
GDB를 사용한 CORE 파일의 분석  (0) 2016.02.05
kernel make menuconfig error  (0) 2016.01.21
Caching your GitHub password in Git  (0) 2016.01.08
Serial ports usage on Linux  (0) 2016.01.08
process 종료  (0) 2015.05.28

+ Recent posts