Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93885 - nedit breaks bash scripts
Summary: nedit breaks bash scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Heinrich Wendel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-24 22:30 UTC by Hiel Van Campen
Modified: 2005-06-06 05:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hiel Van Campen 2005-05-24 22:30:49 UTC
if you cut and paste to many times your script breaks 

script:

#!/bin/bash
 
#export name="$(etcat -f ${1} 2>&1 | grep \* | sed -e s/\*//g -e s/" "//g)"
export name="$(equery f ${1} 2>&1 | grep -v \* | grep -v ^/)"
if [ -z "${name}" ]; then echo "No match found for ${1}."; exit 0; fi
echo "Checking ${name}..."
 
echo "Creating directory structure..."
#### 	put in for loop to handle multiple names generated by python==>python,mysql-python,
#		python-docs and python-fchksum. db is a good one. Also. probably gnome, kde and xfce. 

for n in ${name};do
echo "makeing /tmp/deps/"${n}""
rm -rf /tmp/deps/"${n}"
mkdir -p /tmp/deps/"${n}"
rm -rf /tmp/deps/"${n}"/*
done

# replace mutli "grep -v" with awk.If you use KDE remove from awk filter.
echo "Creating file list..."	#|kde|conf|certs|test
# qpkg -l -nc "${name}" 2>&1| grep -v CONT 
qpkg -l -nc "${name}" 2>&1| grep -v CONT \
	|awk '!/doc|man|src|var|conf|certs|test/' \
	|sed -e s/"->.*$"//g -e s/" "//g | sort | uniq > /tmp/deps/"${name}"/files


echo "Creating list of file types..."
#echo " what is the prob /tmp/deps/"${name}"/files"
file -b -L -f /tmp/deps/"${name}"/files 2>&1|grep -v "Checking " |grep -v "cannot open" \
#file -b -L -f /tmp/deps/"${name}"/files 2>&1 |awk '!/Checking|cannot/' \ 
|sort |uniq > /tmp/deps/"${name}"/filetypes

 
echo "Creating links list..."${name}""
for p in $(< /tmp/deps/"${name}"/files);do
   ldd ${p}  
done 2>&1|grep -v "No such file or directory" | grep -v "ldd:" \
	| grep -v "lddlibc.:" | grep -v "not a dynamic executable" \
	| sed -e s/"(0x........)"//g | cut -b 2- | sed -e s/"^.*=>"//g \
	| grep \/ | sed -e s/" "//g | sort | uniq > /tmp/deps/"${name}"/links
 


echo "Creating list of run-time dependencies..."
rm -f /tmp/deps/"${name}"/alldeps
touch /tmp/deps/"${name}"/alldeps
for p in $(< /tmp/deps/${name}/links)
  do qpkg -f -nc ${p} 
done 2>&1 | sed -e s/"\*"//g -e s/" "//g > /tmp/deps/"${name}"/alldeps

 
function script_check() {
  if [ -n "$(grep -i "${1}" /tmp/deps/"${name}"/filetypes)" ]
    then echo "${2}" >> /tmp/deps/"${name}"/alldeps
  fi
}
 
script_check bourne app-shells/bash
script_check guile dev-util/guile
script_check python dev-lang/python
script_check ruby dev-lang/ruby
script_check perl dev-lang/perl
script_check /sbin/runscript sys-apps/baselayout
script_check /bin/sed sys-apps/sed
script_check expect dev-tcltk/expect
script_check awk sys-apps/gawk
 
rm -rf /tmp/qpkg*
cat /tmp/deps/"${name}"/alldeps | sort | uniq > /tmp/deps/"${name}"/deps
echo "#### ${1}" >>rundep.lst
cat /tmp/deps/${name}/deps|cut -f 2 -d "/" -s >>rundep.lst
cat rundep.lst 
############################### END

By editing this section
#file -b -L -f /tmp/deps/"${name}"/files 2>&1 |awk '!/Checking|cannot/' \ 
|sort |uniq > /tmp/deps/"${name}"/filetypes

the |awk segment was on a seperate line and I cut it and put on the file line and doing that caused this prob caused this error: 
nedit-tst.sh: line 31: syntax error near unexpected token `|'
nedit-tst.sh: line 31: `|sort |uniq > /tmp/deps/"${name}"/filetypes'
I commented out "file..awk" and uncommented the "file...grep -v" no joy.
The only way to fix it is delete it all or paste from and earlier version

Here is the hex version of the affected section:
 65 63 68 6F &#9474; 20 22 43 72 &#9474; 65 61 74 69 &#9474; 6E 67 20 6C &#9474; 69 73 74 20  echo "Creating list
000003C0 6F 66 20 66 &#9474; 69 6C 65 20 &#9474; 74 79 70 65 &#9474; 73 2E 2E 2E &#9474; 22 0A 23 65  of file types...".#e
000003D4 63 68 6F 20 &#9474; 22 20 77 68 &#9474; 61 74 20 69 &#9474; 73 20 74 68 &#9474; 65 20 70 72  cho " what is the pr
000003E8 6F 62 20 2F &#9474; 74 6D 70 2F &#9474; 64 65 70 73 &#9474; 2F 22 24 7B &#9474; 6E 61 6D 65  ob /tmp/deps/"${name
000003FC 7D 22 2F 66 &#9474; 69 6C 65 73 &#9474; 22 0A 66 69 &#9474; 6C 65 20 2D &#9474; 62 20 2D 4C  }"/files".file -b -L
00000410 20 2D 66 20 &#9474; 2F 74 6D 70 &#9474; 2F 64 65 70 &#9474; 73 2F 22 24 &#9474; 7B 6E 61 6D   -f /tmp/deps/"${nam
00000424 65 7D 22 2F &#9474; 66 69 6C 65 &#9474; 73 20 32 3E &#9474; 26 31 7C 67 &#9474; 72 65 70 20  e}"/files 2>&1|grep
00000438 2D 76 20 22 &#9474; 43 68 65 63 &#9474; 6B 69 6E 67 &#9474; 20 22 20 7C &#9474; 67 72 65 70  -v "Checking " |grep
0000044C 20 2D 76 20 &#9474; 22 63 61 6E &#9474; 6E 6F 74 20 &#9474; 6F 70 65 6E &#9474; 22 20 5C 0A   -v "cannot open" \.
00000460 23 66 69 6C &#9474; 65 20 2D 62 &#9474; 20 2D 4C 20 &#9474; 2D 66 20 2F &#9474; 74 6D 70 2F  #file -b -L -f /tmp/
00000474 64 65 70 73 &#9474; 2F 22 24 7B &#9474; 6E 61 6D 65 &#9474; 7D 22 2F 66 &#9474; 69 6C 65 73  deps/"${name}"/files
00000488 20 32 3E 26 &#9474; 31 20 7C 61 &#9474; 77 6B 20 27 &#9474; 21 2F 43 68 &#9474; 65 63 6B 69   2>&1 |awk '!/Checki
0000049C 6E 67 7C 63 &#9474; 61 6E 6E 6F &#9474; 74 2F 27 20 &#9474; 5C 20 0A 7C &#9474; 73 6F 72 74  ng|cannot/' \ .|sort
000004B0 20 7C 75 6E &#9474; 69 71 20 3E &#9474; 20 2F 74 6D &#9474; 70 2F 64 65 &#9474; 70 73 2F 22   |uniq > /tmp/deps/"
000004C4 24 7B 6E 61 &#9474; 6D 65 7D 22 &#9474; 2F 66 69 6C &#9474; 65 74 79 70 &#9474; 65 73 0A 0A  ${name}"/filetypes..
000004D8 20 0A 65 63 &#9474; 68 6F 20 22 &#9474; 43 72 65 61 &#9474; 74 69 6E 67 &#9474; 20 6C 69 6E   .echo "Creating lin
Comment 1 Hiel Van Campen 2005-05-25 09:52:06 UTC
Oops I'm useing nedit-5.5 and here is my emerge info

Portage 2.0.51.21-r1 (default-linux/x86/2004.2/gcc34/2.6, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.10-gentoo-r7n i686)
=================================================================
System uname: 2.6.10-gentoo-r7n i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.6.11
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.3
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -fforce-addr -momit-leaf-frame-pointer
-fomit-frame-pointer -frename-registers -fweb -ftracer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -fforce-addr -momit-leaf-frame-pointer
-fomit-frame-pointer -frename-registers -fweb -ftracer -pipe
-fvisibility-inlines-hidden "
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks sandbox sfperms strict userpriv"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/
http://mirror.datapipe.net/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/"
LANG="en_US"
LC_ALL="C"
MAKEOPTS="-j5 "
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/include/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 async avi berkdb bitmap-fonts chroot cpdflib crypt cups
curl dba dillo divx4linux doc emboss encode esd fam fbdev flac foomaticdb fpx
freetype gd gdbm gif gnome gpm gtk gtk2 imagemagick imlib ipv6 java javascript
jpeg kde libwww live lynxkeymap lzw lzw-tiff mad mikmod mmx mmx2 motif mozilla
mp3 mpeg mpeg4 mplayer mysql ncurses network nptl ogg oggvorbis opengl oss
pdflib perl php png ppds python qt quicktime readline real rtc ruby samba sdl
slang spell sqlite sse ssl svga tcpd tiff truetype truetype-fonts type1
type1-fonts unicode vim vorbis xine xml2 xmms xv zlib userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS
Comment 2 Hiel Van Campen 2005-05-25 12:46:19 UTC
I changed my CFLAGS to "-march=athlon-xp -O2 -fomit-frame-pointer -pipe" and
rebuilt nedit. I've been cuting and pasting since, and the problem is not
showing up so far. 
If you want to keep this open for a few days Ill try and figure out which flag
is the culprit.

Thanks Hiel
Comment 3 Hiel Van Campen 2005-06-01 20:03:33 UTC
Ive rebuilt nedit with my full set of CFLAGS and havent had any further
problems. Go figure, close this sucker.
Comment 4 Heinrich Wendel (RETIRED) gentoo-dev 2005-06-06 05:43:35 UTC
close