Skip to Content.
Sympa Menu

sm-sorcery-bugs - [Sm-Sorcery-Bugs] [Bug 1548] New: [:space:] needs to be "[:space:]" or else bad things happen.

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT metalab.unc.edu
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [Sm-Sorcery-Bugs] [Bug 1548] New: [:space:] needs to be "[:space:]" or else bad things happen.
  • Date: Fri, 1 Nov 2002 02:04:09 -0500

http://bugs.sourcemage.org/show_bug.cgi?id=1548

Summary: [:space:] needs to be "[:space:]" or else bad things
happen.
Product: Sorcery
Version: Devel
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Cast
AssignedTo: sm-sorcery-bugs AT lists.ibiblio.org
ReportedBy: seth AT tautology.org


> > cd /tmp; touch s; cast Hermes
> Checking dependencies for Hermes
> Gathering spells to cast...
> In order to cast Hermes, the following spells are going to be cast:
> Hermes
> Do you wish these cast? [y] y
> Sorting spells and saving dependency information...
> Done sorting.
> Unable to find spell Herme in grimoire(s): /var/lib/sorcery/codex/test
> Unable to find spell Herme in grimoire(s): /var/lib/sorcery/codex/test
> I choose a different letter of the alphabet and ... everything works
+normally (for reference it was 'm')


> cd /tmp; touch s e m; cast Hermes
Checking dependencies for Hermes
Gathering spells to cast...
In order to cast Hermes, the following spells are going to be cast:
Hermes
Do you wish these cast? [y] y
Sorting spells and saving dependency information...
Done sorting.
tr: only one string may be given when deleting without squeezing repeats
/tmp/casting.13720: line 103: .: /etc/sorcery/local/depends/: is a directory
Unable to find spell in grimoire(s): /var/lib/sorcery/codex/test
Unable to find spell in grimoire(s): /var/lib/sorcery/codex/test


<duff|UT> # touch e r m
<duff|UT> root@pizzaz:/usr/share/webmin# cast Hermes
<duff|UT> Checking dependencies for Hermes
<duff|UT> Gathering spells to cast...
<duff|UT> In order to cast Hermes, the following spells are going to be cast:
<duff|UT> Hermes
<duff|UT> Do you wish these cast? [y] y
<duff|UT> Sorting spells and saving dependency information...
<duff|UT> Done sorting.
<duff|UT> tr: only one string may be given when deleting without squeezing
+repeats
<duff|UT> Unable to find spell in grimoire(s): /var/lib/sorcery/codex/devel
<duff|UT> H and s were already there.
> hehe.
<duff|UT> If you would, include that info in the report, it gives a good
+starting point.


> cd /tmp; touch m; cast Hermes
Checking dependencies for Hermes
Gathering spells to cast...
In order to cast Hermes, the following spells are going to be cast:
Hermes
Do you wish these cast? [y] y
Sorting spells and saving dependency information...
Done sorting.
Waiting for any Solo spells to complete... done.
Waiting for any other casts of Hermes to complete... done
Building Hermes
<snip>

> cd /tmp; touch e; cast Hermes
Checking dependencies for Hermes
Gathering spells to cast...
In order to cast Hermes, the following spells are going to be cast:
Hermes
Do you wish these cast? [y]
Sorting spells and saving dependency information...
Done sorting.
Unable to find spell Hrms in grimoire(s): /var/lib/sorcery/codex/test
Unable to find spell Hrms in grimoire(s): /var/lib/sorcery/codex/test
Finished processing install requests.

Spells installed successfully:
------------------------------

Spells that encountered problems:
---------------------------------
Hrms


> touch c
root AT sethlaptop.lambsonic.com:/tmp 9 74 -> cast glibc
glibc is already cast. Try cast -c glibc.
Gathering spells to cast...
Nothing to cast!
root AT sethlaptop.lambsonic.com:/tmp 9 75 -> cast -c glibc
Would you like to select locales [n]
Would you like to select locales [n] n
Checking dependencies for glibc
Gathering spells to cast...
In order to cast glibc, the following spells are going to be cast:
glibc
Do you wish these cast? [y] y
Sorting spells and saving dependency information...
Done sorting.
Waiting for any Solo spells to complete... done.
Waiting for any other casts of glib to complete... done
Building glib
Using gcc version: 3.2
Installing in dir: /usr/src/glib-1.2.10
glib 1.2.10
Do you wish to add -- options to ./configure? [n]

for some reason `m' is an odd-character out, it won't cause the bug to show
itself. H won't either.

> if you do multiple characters you get the "tr" error.
<dufflebunk> Just make a spell dir, and put in the minimum DETAILS
<dufflebunk> touch es doesn't break anything.
> no, touch e s
<dufflebunk> I know, I was wondering if es would stop Herm(es) from working.
> oh.

> cat
> /var/lib/sorcery/codex/test/z-rejected/abcdefghijklmnopqrstuvwxyz/DETAILS
SPELL=abcdefghijklmnopqrstuvwxyz
VERSION=0
WEB_SITE=http://google.com
ENTERED=20020125
UPDATED=20020528
LICENSE[0]=GPL
MAINTAINER=seth AT tautology.org
SHORT="bug fix spell"
cat << EOF
bug fix spell
EOF


> for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do touch $i;
> if
[ `cast abcdefghijklmnopqrstuvwxyz 2> /dev/null | grep Unable | wc -l` == 2 ];
then echo $i yes; else echo $i no; fi; rm $i; done

a yes
b no
c yes
d no
e yes
f no
g no
h no
i no
j no
k no
l no
m no
n no
o no
p yes
q no
r no
s yes
t no


> a, c, e, p, s
> paces
> space
> SPACE!
> there's a message!
> aliens from outer SPACE!
<dufflebunk> tr -d [:space:] ?
> [:space:]
> all horizontal or vertical whitespace
<dufflebunk> Someone here at least is good at boggle.
<dufflebunk> I would have had to pipe all combos into ispell or something.
> hehe.
> should it be tr -d "[:space:]" instead?
> like the [ isn't getting sent as an argument, but is interpreted?
<dufflebunk> I havbe zero idea; however, of how the existance of files could
+do anything...
<dufflebunk> [ ... ] is not interpreted.
<dufflebunk> Nor are :.
<dufflebunk> Unless the [..] are in a ${VAR[...]}
> I guess you are right.
> > echo [:space:]
> [:space:]
> yeah, why would the existence of files matter at all?

root AT sethlaptop.lambsonic.com:/tmp 9 118 -> echo Hermes | tr -d [:space:];
echo
Hermes
root AT sethlaptop.lambsonic.com:/tmp 9 119 -> touch s; echo Hermes | tr -d
[:space:]; echo
Herme

<dufflebunk> what happens if the file isn't empty?>
> > echo Hermes | tr -d [:space:]; echo
> Hermes
> > touch s; echo Hermes | tr -d [:space:]; echo
> Herme
> WTF
> > echo HERMES > s
> > echo Hermes | tr -d [:space:]; echo
> Herme
> same thing.
> Did I find a bug in tr?
> > echo [:space:]
> s
> > touch c
> > echo [:space:]
> c s
> Duff: IT DOES INTERPRET THAT!
> > echo "[:space:]"
> [:space:]
> Bash is treating it like a glob.
> but man bash lists [:space:] as a special glob as defined in the POSIX.2
+standard.


[...] Matches any one of the enclosed characters. A pair of charac-
ters separated by a hyphen denotes a range expression; any char-
acter that sorts between those two characters, inclusive, using
the current locale's collating sequence and character set, is
matched. If the first character following the [ is a ! or a ^
then any character not enclosed is matched. The sorting order
of characters in range expressions is determined by the current
locale and the value of the LC_COLLATE shell variable, if set.
A - may be matched by including it as the first or last charac-
ter in the set. A ] may be matched by including it as the first
character in the set.

Within [ and ], character classes can be specified using the
syntax [:class:], where class is one of the following classes
defined in the POSIX.2 standard:
alnum alpha ascii blank cntrl digit graph lower print punct
space upper word xdigit

I suspect man bash is lying!

starting at /usr/sbin/cast line 1010:
cast_spells() {

local SOME_CAST_FAILED=0
local must_recompile="${COMPILE}${RECONFIGURE}"
SUCCESSFUL_CASTS=""
FAILED_CASTS=""

for SPELL in $SPELLS; do
SPELL=`echo "$SPELL" | tr -d [:space:]`

change line 1018 to:
SPELL=`echo "$SPELL" | tr -d "[:space:]"`

and it works again!



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



  • [Sm-Sorcery-Bugs] [Bug 1548] New: [:space:] needs to be "[:space:]" or else bad things happen., bugzilla-daemon, 11/01/2002

Archive powered by MHonArc 2.6.24.

Top of Page