차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linuxfromscratch:auto-lfs [2024/05/15 01:35] – [Host에서 LFS 디렉토리로 chroot] baecylinuxfromscratch:auto-lfs [2024/06/07 20:14] (현재) – [파일 다운로드 링크 처리] baecy
줄 124: 줄 124:
   - alias 등록 확인   - alias 등록 확인
   - wget, git, gawk 설치 여부 확인   - wget, git, gawk 설치 여부 확인
 +
 +수정할 사항
 +  - git clone 사용 할 때 작업 디렉터리에 먼저 받고 source 디렉터리에 복사하는 방식으로 변경 필요.
  
  
줄 133: 줄 136:
 <code lang=bash> <code lang=bash>
 #!/bin/bash #!/bin/bash
 +
 +Green='\033[0;32m'
 +BIGreen='\033[1;32m'
 +Red='\033[0;31m'
 +Yellow='\033[0;33m'
 +Color_Off='\033[0m'
 +
 +if [ "$(type -t p4c)" != 'alias' ] ; then
 +        echo -e "p4c is not ${Yellow}alias registered${Color_Off}, so the functionality is not available."
 +        source ${HOME}/.bash_aliases
 +        return 2>&/dev/null
 +fi
 +
 if [ -z "$1" ]; then echo -e "${Green}An appropriate factor (file name or download link) is required.${Color_Off}"; return; fi if [ -z "$1" ]; then echo -e "${Green}An appropriate factor (file name or download link) is required.${Color_Off}"; return; fi
 InputStringType=$(echo "$1" | awk 'BEGIN { FS = ":" } ; { print $1 }') InputStringType=$(echo "$1" | awk 'BEGIN { FS = ":" } ; { print $1 }')
줄 141: 줄 157:
 GitCheck=${TargetFile: -3} GitCheck=${TargetFile: -3}
 ZipCheck=${TargetFile: -3} ZipCheck=${TargetFile: -3}
 +TargetDir=$(echo "$TargetFile" | sed -e 's/\.tar.*$//' -e 's/\.tgz*$//' -e 's/\.src*$//' -e 's/\.zip*$//' -e 's@^.*/@@')
 NotFoundMsg1="The directory derived from the filename is ${BIGreen}$TargetDir${Color_Off}.\n\ NotFoundMsg1="The directory derived from the filename is ${BIGreen}$TargetDir${Color_Off}.\n\
 However, it does not exist, so it will move to the ${Yellow}most recent directory created${Color_Off}.\n\ However, it does not exist, so it will move to the ${Yellow}most recent directory created${Color_Off}.\n\
 Please check if it is correct." Please check if it is correct."
-TargetDir=$(echo "$TargetFile" | sed -e 's/\.tar.*$//' -e 's/\.tgz*$//' -e 's/\.src*$//' -e 's/\.zip*$//' -e 's@^.*/@@') 
  
-if [ $(stat -c %u $BuildBase) -ne $(id -u) ] ; then echo "Check $BuildBase Ownership"; return; fi+if [ $(stat -c %u $BuildBase) -ne $(id -u) ] ; then echo -e "Check ${Red}$BuildBase${Color_Off} Ownership"; return; fi
  
 function chg_dir() { function chg_dir() {
줄 183: 줄 199:
 case "$InputStringType" in case "$InputStringType" in
         https|http|ftp)         https|http|ftp)
-            wget --no-verbose --no-clobber --directory-prefix="$SourceBase" "$1"+            wget --no-verbose -nc --directory-prefix="$SourceBase" "$1"
         ;;         ;;
         *)         *)
줄 202: 줄 218:
  
 fi fi
 +
 +unset  InputStringType BuildBase SourceBase TargetFile GitDirCheck GitCheck ZipCheck TargetDir NotFoundMsg1
 </code>  </code> 
  
  • linuxfromscratch/auto-lfs.1715736915.txt.gz
  • 마지막으로 수정됨: 2024/05/15 01:35
  • 저자 baecy