* [sisyphus] shell.req @ 2012-08-27 13:39 Denis Kuznetsov 2012-08-27 15:56 ` Alexey Tourbin 0 siblings, 1 reply; 6+ messages in thread From: Denis Kuznetsov @ 2012-08-27 13:39 UTC (permalink / raw) To: ALT Linux Sisyphus discussions Доброго времени суток. Решил попробовать собрать zfs. Сборка завершается с ошибкой: /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: line 176: syntax error near unexpected token `(' /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: line 176: ` ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' shell.req: ERROR: /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: /bin/bash --rpm-requires failed find-requires: ERROR: /usr/lib/rpm/shell.req failed ошибка: /bin/sh не удалось ошибка: Невозможно найти Requires Собственно что в скрипте. 167 # Generate channel/disk layout table for comment header. 168 print_channel_layout() { 169 pushd ${DEV_DISK_DIR} >/dev/null 170 echo "# ----------------- Channel/Disk Layout -------------------" 171 echo "# Channel Disks" 172 if [ ${TOPOLOGY} = "switch" ] ; then 173 for (( i=0; i<${#SWITCH_PORTS[*]}; i++ )); do 174 printf "# %-9s" ${CHANNELS[$i]} 175 p=${SWITCH_PORTS[$i]} 176 ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \ 177 2>/dev/null | cut -f3 -d':' | sort -u -n | \ 178 xargs | tr ' ' ',' 179 done 180 else 181 for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do 182 for (( j=0; j<${#HOST_PORTS[*]}; j++, k++ )); do 183 printf "# %-9s" ${CHANNELS[$k]} 184 ls *:${BUSES[$i]}:*:${HOST_PORTS[$j]}* \ 185 2>/dev/null | cut -f7 -d'-' | \ 186 sort -u -n | xargs | tr ' ' ',' 187 done 188 done 189 fi 190 echo "#" 191 popd > /dev/null 192 } 193 Собственно вопрос как всегда, куда копать? -- Denis Kuznetsov mail: kde{at}kde.kiev.ua gtalk: kde{at}kde.kiev.ua ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] shell.req 2012-08-27 13:39 [sisyphus] shell.req Denis Kuznetsov @ 2012-08-27 15:56 ` Alexey Tourbin 2012-08-27 19:19 ` Denis Kuznietsov 0 siblings, 1 reply; 6+ messages in thread From: Alexey Tourbin @ 2012-08-27 15:56 UTC (permalink / raw) To: ALT Linux Sisyphus discussions On Mon, Aug 27, 2012 at 04:39:38PM +0300, Denis Kuznetsov wrote: > Доброго времени суток. > Решил попробовать собрать zfs. Сборка > завершается с ошибкой: > > /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: line 176: syntax error > near unexpected token `(' > /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: line 176: ` > ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' > shell.req: ERROR: /home/kde/tmp/zfs-buildroot/usr/bin/zpool_layout: > /bin/bash --rpm-requires failed > find-requires: ERROR: /usr/lib/rpm/shell.req failed > ошибка: /bin/sh не удалось > ошибка: Невозможно найти Requires > > > Собственно что в скрипте. > 167 # Generate channel/disk layout table for comment header. > 168 print_channel_layout() { > 169 pushd ${DEV_DISK_DIR} >/dev/null > 170 echo "# ----------------- Channel/Disk Layout -------------------" > 171 echo "# Channel Disks" > 172 if [ ${TOPOLOGY} = "switch" ] ; then > 173 for (( i=0; i<${#SWITCH_PORTS[*]}; i++ )); do > 174 printf "# %-9s" ${CHANNELS[$i]} > 175 p=${SWITCH_PORTS[$i]} > 176 ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \ > 177 2>/dev/null | cut -f3 -d':' | sort -u -n | \ > 178 xargs | tr ' ' ',' > 179 done > 180 else > 181 for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do > 182 for (( j=0; j<${#HOST_PORTS[*]}; j++, k++ )); do > 183 printf "# %-9s" ${CHANNELS[$k]} > 184 ls *:${BUSES[$i]}:*:${HOST_PORTS[$j]}* \ > 185 2>/dev/null | cut -f7 -d'-' | \ > 186 sort -u -n | xargs | tr ' ' ',' > 187 done > 188 done > 189 fi > 190 echo "#" > 191 popd > /dev/null > 192 } > 193 > > Собственно вопрос как всегда, куда > копать? Копать туда, что shell syntax check у этого скрипта не проходит: $ sh -n test.sh test.sh: line 9: syntax error near unexpected token `(' test.sh: line 9: ` ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' Соответственно, rpm не дает запаковать этот скрипт в абсолютно неработающем виде, есть считается, что это /bin/sh или /bin/bash скрипт. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] shell.req 2012-08-27 15:56 ` Alexey Tourbin @ 2012-08-27 19:19 ` Denis Kuznietsov 2012-08-27 21:17 ` Dmitry V. Levin 0 siblings, 1 reply; 6+ messages in thread From: Denis Kuznietsov @ 2012-08-27 19:19 UTC (permalink / raw) To: ALT Linux Sisyphus discussions 27.08.2012 18:56, Alexey Tourbin пишет: > Копать туда, что shell syntax check у этого скрипта не проходит: > > $ sh -n test.sh > test.sh: line 9: syntax error near unexpected token `(' > test.sh: line 9: ` ls ${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' > > Соответственно, rpm не дает запаковать этот скрипт в абсолютно > неработающем виде, есть считается, что это /bin/sh или /bin/bash скрипт. Да это баш. подозреваю что может даже 4-ка ... > _______________________________________________ > Sisyphus mailing list > Sisyphus@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/sisyphus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] shell.req 2012-08-27 19:19 ` Denis Kuznietsov @ 2012-08-27 21:17 ` Dmitry V. Levin 0 siblings, 1 reply; 6+ messages in thread From: Dmitry V. Levin @ 2012-08-27 21:17 UTC (permalink / raw) To: ALT Linux Sisyphus discussions [-- Attachment #1: Type: text/plain, Size: 659 bytes --] On Mon, Aug 27, 2012 at 10:19:17PM +0300, Denis Kuznietsov wrote: > 27.08.2012 18:56, Alexey Tourbin пишет: > >Копать туда, что shell syntax check у этого > >скрипта не проходит: > > > >$ sh -n test.sh > >test.sh: line 9: syntax error near unexpected token `(' > >test.sh: line 9: ` ls > >${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' > > > >Соответственно, rpm не дает запаковать > >этот скрипт в абсолютно > >неработающем виде, есть считается, что > >это /bin/sh или /bin/bash скрипт. > Да это баш. подозреваю что может даже 4-ка Нет, вышепроцитированное не укладывается в синтаксис bash 4-й версии. -- ldv [-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <503C5A46.4010209@kde.kiev.ua>]
* Re: [sisyphus] bash @ 2012-08-28 6:46 ` Alexey Tourbin 2012-08-28 7:14 ` Denis Kuznetsov 0 siblings, 1 reply; 6+ messages in thread From: Alexey Tourbin @ 2012-08-28 6:46 UTC (permalink / raw) To: sisyphus On Tue, Aug 28, 2012 at 08:42:30AM +0300, Denis Kuznetsov wrote: > Таки интересная ситуация... > Согласно: > http://www.gnu.org/software/bash/manual/bashref.html#Quote-Removal > http://www.gnu.org/software/bash/manual/bashref.html#Pattern-Matching > А также: > $ shopt | grep extglob > extglob on > А еще: > $ ls +([0-9A-z]) > $ rpm -qf $SHELL > bash-3.2.51-alt1 > Все укладывается в синтаксис bash-3.2.51 > вошедшего в p6. > > При проверке синтаксиса: > $ echo 'ls +([0-9A-z])' | bash -n > bash: line 1: syntax error near unexpected token `(' > bash: line 1: `ls +([0-9A-z]) Вы правы, это расширенный синтаксис: $ echo 'ls +([0-9A-z])' |bash -n bash: line 1: syntax error near unexpected token `(' bash: line 1: `ls +([0-9A-z])' $ echo 'ls +([0-9A-z])' |bash -O extglob -n $ Выходит что, к сожалению, выполнение текущей команды может влиять на синтаксический разбор последующей команды - получается такой недо-перл (в перле команды, модифицирующие синтаксис, выполняются безусловно, даже в режиме syntax check). Кстати, диапазон [A-z] является некорректным, но никто не жалуется. То есть он к синтаксису не относится, а круглые скобки - относятся. Интересно, как всё это вообще работает. :-) > Возникает вопрос, как это обойти в Sisyphus и > p6? Простого способа передать "-O extglob" в shell.req пока нету. Можно избирательно отключить поиск зависимостей в проблемном скрипте: %add_findreq_skiplist */usr/bin/zpool_layout либо менее избирательно: AutoReq: yes, noshell Тогда часть зависимостей, если в скриптах есть самостоятельные нетривиальные зависимости, нужно будет написать вручную. > Эту же проблему наблюдаю на CentOS 6.1 и FreeBSD > (но они мне побоку). > > > 28.08.2012 00:17, Dmitry V. Levin пишет: > >On Mon, Aug 27, 2012 at 10:19:17PM +0300, Denis Kuznietsov wrote: > >>27.08.2012 18:56, Alexey Tourbin пишет: > >>>Копать туда, что shell syntax check у этого > >>>скрипта не проходит: > >>> > >>>$ sh -n test.sh > >>>test.sh: line 9: syntax error near unexpected token `(' > >>>test.sh: line 9: ` ls > >>>${LABEL}-+([0-9a-f])-switch-port:${p}-slot:+([0-9]) \' > >>> > >>>Соответственно, rpm не дает запаковать > >>>этот скрипт в абсолютно > >>>неработающем виде, есть считается, что > >>>это /bin/sh или /bin/bash скрипт. > >>Да это баш. подозреваю что может даже 4-ка > >Нет, вышепроцитированное не > >укладывается в синтаксис bash 4-й версии. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sisyphus] bash 2012-08-28 6:46 ` [sisyphus] bash Alexey Tourbin @ 2012-08-28 7:14 ` Denis Kuznetsov 0 siblings, 0 replies; 6+ messages in thread From: Denis Kuznetsov @ 2012-08-28 7:14 UTC (permalink / raw) To: ALT Linux Sisyphus discussions 28.08.2012 09:46, Alexey Tourbin пишет: > Интересно, как всё это вообще работает.:-) Видимо, не только делфи парадоксов друг... >> > Возникает вопрос, как это обойти в Sisyphus и >> > p6? > Простого способа передать "-O extglob" в shell.req пока нету. > Можно избирательно отключить поиск зависимостей в проблемном скрипте: > %add_findreq_skiplist */usr/bin/zpool_layout > либо менее избирательно: > AutoReq: yes, noshell > Тогда часть зависимостей, если в скриптах есть самостоятельные > нетривиальные зависимости, нужно будет написать вручную. Спасибо! %add_findreq_skiplist помог. -- Denis Kuznetsov mail: kde{at}kde.kiev.ua gtalk: kde{at}kde.kiev.ua ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-08-28 7:14 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-08-27 13:39 [sisyphus] shell.req Denis Kuznetsov 2012-08-27 15:56 ` Alexey Tourbin 2012-08-27 19:19 ` Denis Kuznietsov 2012-08-27 21:17 ` Dmitry V. Levin 2012-08-28 6:46 ` [sisyphus] bash Alexey Tourbin 2012-08-28 7:14 ` Denis Kuznetsov
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git