- 작성시간 : 2015/06/05 16:07
- 퍼머링크 : mcchae.egloos.com/11170664
- 덧글수 : 2
rsync: recv_generator: failed to stat "/Volumes/CMC2T/mcchae/OneDrive/공부/NIPA/[NIPA-120] 인사이드_이슈_차량용_반도체의_품질_확보를_위한_사양_및_설계_개발_프로세스_수립.pdf" [297] statret=-1: File name too long (63)
식으로 오류가 나는 것이었습니다.
그래서,
$ brew install rsync
명령으로 최신 rsync로 해도 똑같은 오류가 나타났고,
급기야는 소스를 가져다가 살펴봤는데도 동일했습니다.
결국은,
위와 같이 오류가 발생하는 것이 stat() 시스템 콜을 부를 때 발생한다는 것으로 파악되었는데,
맥에 있는 stat 명령을 사용하여
$ stat "/Volumes/CMC2T/mcchae/OneDrive/공부/NIPA/[NIPA-120] 인사이드_이슈_차량용_반도체의_품질_확보를_위한_사양_및_설계_개발_프로세스_수립.pdf"
라고 명령을 주어도 File name too long 이라는 오류가 동일하게 뜨는 것이었습니다.
아무래도 UTF-8-MAC 인코딩 때문에 맥 OS 자체가 가지고 있는 bug 아닌가 싶습니다.
그래서 rsync-3.1.1 소스를 가져다,
generator.c 소스에서
1734번째 라인부터 세줄을 위와 같이 코맨트로 막고 build 한 후에 실행하였더니
이상없이 잘 동작하였습니다.
$ brew install rsync
설치를 한 다음,
(rsync 호는 올라가지 않아 .txt 를 추가하였습니다)
위의 rsync.txt 를 /usr/local/bin/rsync 로 덮어 쓰면 (기존에는 symbolic link로 되어 있습니다)
잘 사용하실 수 있을 것입니다.
brew 를 사용할 경우 다음과 같이 합니다.
(2017.9.28 현재 3.1.1 대신 3.1.2 임)
$ brew install homebrew/dupes/rsync
$ brew uninstall rsync
$ brew fetch rsync --build-from-source
$ cd `brew --cache`
$ tar xvfz rsync-3.1.2.tar.gz
$ vi rsync-3.1.2/generator.c
위와 같이 수정
$ mv rsync-3.1.2.tar.gz rsync-3.1.2.tar.gz.org
$ tar cvfz rsync-3.1.2.tar.gz rsync-3.1.2
$ ll
total 9312
...
-rw-r--r-- 1 mcchae admin 29325 2 17 11:08 rsync--patch-134483ab33fdaa67d503dc4011656913321f9e405639fab96d48ef54e08dfa1f.diff
-rw-r--r-- 1 mcchae admin 25534 2 17 11:08 rsync--patch-396e552b1f51ee10c21f27afc73b75b2d421272443d15d2a5539ac641c32cbb1.diff
-rw-r--r-- 1 mcchae admin 49337 2 17 11:08 rsync--patch-b50f0ad6d2c20e561e17b64f07545b1ecfe7d61481a6e5af192abfe21af01e73.diff
drwxr-xr-x 102 mcchae admin 3468 2 17 11:37 rsync-3.1.1
-rw-r--r-- 1 mcchae admin 881272 2 17 11:38 rsync-3.1.1.tar.gz
-rw-r--r-- 1 mcchae admin 890124 2 17 11:08 rsync-3.1.1.tar.gz.org
$ brew install rsync --build-from-source
==> Installing rsync from homebrew/homebrew-dupes
==> Downloading https://rsync.samba.org/ftp/rsync/rsync-3.1.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/rsync-3.1.1.tar.gz
Error: SHA256 mismatch
Expected: 7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621
Actual: 7eac22fdf1c2506c7a6f6152d8bd21ba43f94638b52fe62ab50a7d205b0dff42
Archive: /Library/Caches/Homebrew/rsync-3.1.1.tar.gz
To retry an incomplete download, remove the file above.
와 같이 오류 나오는데...
$ brew edit rsync
내용 중,
sha256 "7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621"
대신 (위에 보인 것처럼 Actual 로)
sha256 "7eac22fdf1c2506c7a6f6152d8bd21ba43f94638b52fe62ab50a7d205b0dff42"
수정하여,
$ brew install rsync --build-from-source



덧글
iconv의 UTF-8-MAC이라는 것이 풀어쓰기처럼 되어있는(decomposed된) UTF-8 인코딩일꺼에요.
예전에 문자열의 바이트 길이(+특정 위치의 캐릭터)를 보면 아주 다르게 나와서 그것 때문에 골치아팠던 적이 있어서 문제라서 기억에 남네요.
http://ko.wikipedia.org/wiki/유니코드_정규화