index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-04-05 00:48:36 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-05 00:49:30 -0500 |
commit | c5addd94e3a817504688e684bf62786df7faa3e7 (patch) | |
tree | 0f15c4c3ea66d617709e1f3408ea045a38463b1e /scripts | |
parent | 2f71d1dc0084f7ee44afb9766e81847974820420 (diff) | |
parent | 272e9b355b17ab663ac4a0d9515d381dcf6f03ec (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 25 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 15cb1844..c8e987ca 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -287,11 +287,10 @@ check_buildenv() { # ? - not found ## in_opt_array() { - local needle=$(tr '[:upper:]' '[:lower:]' <<< $1); shift + local needle=$1; shift local opt for opt in "$@"; do - opt=$(tr '[:upper:]' '[:lower:]' <<< $opt) if [[ $opt = $needle ]]; then echo 'y' # Enabled return @@ -579,7 +578,6 @@ generate_checksums() { local integ for integ in ${integlist[@]}; do - integ=$(tr '[:upper:]' '[:lower:]' <<< "$integ") case "$integ" in md5|sha1|sha256|sha384|sha512) : ;; *) @@ -1040,13 +1038,12 @@ create_package() { local comp_files=".PKGINFO" # check for changelog/install files - for i in 'changelog' 'install'; do - orig=${!i} - dest=$(tr '[:lower:]' '[:upper:]' <<<".$i") + for i in 'changelog/.CHANGELOG' 'install/.INSTALL'; do + IFS='/' read -r orig dest <<< "$i" - if [[ -n $orig ]]; then - msg2 "$(gettext "Adding %s file...")" "$i" - cp "$startdir/$orig" "$dest" + if [[ -n ${!orig} ]]; then + msg2 "$(gettext "Adding %s file...")" "$orig" + cp "$startdir/${!orig}" "$dest" chmod 644 "$dest" comp_files+=" $dest" fi @@ -1293,7 +1290,7 @@ check_sanity() { local provides_list=() eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \ - sed -e "s/provides=/provides_list+=/" -e "s/#.*//") + sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//') for i in ${provides_list[@]}; do if [[ $i != ${i//</} || $i != ${i//>/} ]]; then error "$(gettext "Provides array cannot contain comparison (< or >) operators.")" @@ -1303,7 +1300,7 @@ check_sanity() { local backup_list=() eval $(awk '/^[[:space:]]*backup=/,/\)/' "$BUILDFILE" | \ - sed -e "s/backup=/backup_list+=/" -e "s/#.*//") + sed -e "s/backup=/backup_list+=/" -e "s/#.*//" -e 's/\\$//') for i in "${backup_list[@]}"; do if [[ ${i:0:1} = "/" ]]; then error "$(gettext "Backup entry should not contain leading slash : %s")" "$i" @@ -1312,8 +1309,8 @@ check_sanity() { done local optdepends_list=() - eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(|#.*)$/' "$BUILDFILE" | \ - sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//") + eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(#.*)?$/' "$BUILDFILE" | \ + sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//') for i in "${optdepends_list[@]}"; do local pkg=${i%%:*} if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]+$ ]]; then @@ -1338,7 +1335,7 @@ check_sanity() { local valid_options=1 local known kopt options_list eval $(awk '/^[[:space:]]*options=/,/\)/' "$BUILDFILE" | \ - sed -e "s/options=/options_list+=/" -e "s/#.*//") + sed -e "s/options=/options_list+=/" -e "s/#.*//" -e 's/\\$//') for i in ${options_list[@]}; do known=0 # check if option matches a known option or its inverse |