LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-28-2008, 01:46 PM   #1
ProtoformX
Member
 
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334

Rep: Reputation: 34
Stumped, scripts are self aware?


Hey guys! I was doing some recompiling and such and am using my own build scripts, the thing is these build scripts have a mind of there own, I can copy a file inside bas as normal, but if i do it in the build script it tells me it can't find the file in a directory it shouldn't be in in the first place, it's like it just doesn't want to do it.

Below is my buildscript, maybe someone can point out what i am doing so wrong. (Note: my slack-desc are desc files, I patched pkgtool). Everything works accept copying over the desc file, it tells me it can't find it in $PRG-$VERSION, even though that is not the current working directory!. It doesn't matter if I try to copy the file at the beginning of the script or later on in the script, it just refuses to do it. it's like it's almost making an excuse up.

Code:
#!/bin/sh
 
CWD=`pwd`
TMP=/tmp

if [ ! -d $TMP ] ; then
  mkdir -pv $TMP
fi

. build_flags
PRG=binutils
VERSION=2.18
ARCH=i686
BUILD=1
PKG=$TMP/pkg-$PRG-$VERSION
rm -rf {$TMP/$PRG-$VERSION,$PKG} 

cd $TMP
tar -xjvf $CWD/$PRG-$VERSION.tar.bz2 
cd $PRG-$VERSION
patch -Np1 -i $CWD/binutils-2.18-configure-1.patch
mkdir -v ../binutils-build
cd ../binutils-build
../binutils-2.18/configure --prefix=/usr \
    --enable-shared
make
make check 2> error.log
make install DESTDIR=$PKG
cp -v ../binutils-2.18/include/libiberty.h $PKG/usr/include

### Compress the man pages and info then put them in there correct place. 
gzip -9 $PKG/usr/man/man*/*
gzip -9 $PKG/usr/info/*
mv -v $PKG/usr/info $PKG/usr/share/info 
mv -v $PKG/usr/man $PKG/usr/share/man

### Copy the description over and build the package.
cat $CWD/desc > $PKG/install/desc
chown -R root.root $PKG/install/*
cd $PKG
/sbin/makepkg -l y -c n $TMP/$PRG-$VERSION-$ARCH-$BUILD.tgz

Last edited by ProtoformX; 09-28-2008 at 01:50 PM.
 
Old 09-28-2008, 02:11 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You need to create the dir first:
Code:
mkdir -p $PKG/install
cat $CWD/desc > $PKG/install/desc
You should make a habit of creating dirs you are going to use. An extra line or two of code doesn't hurt.
I have another suggestion -you should probably avoid this construction:
$PRG-$VERSION
Instead use:
$PRG_$VERSION
You'll need to change this usage:
tar -xjvf $CWD/$PRG-$VERSION.tar.bz2
so that it uses something like:
tar -xjvf $CWD/$TARBALL-NAME.tar.bz2

Using the '-' as a separator between two variables is going to cause some funny problems later which are hard to spot.
If I remember correctly, installpkg and makepkg will already handle 'desc' files. This is hold-over legacy from the earliest versions.
 
Old 09-28-2008, 03:55 PM   #3
ProtoformX
Member
 
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334

Original Poster
Rep: Reputation: 34
Thanks for the tips, it was indeed the install directory that was the problem, for some reason i was sure I didn't have to create the directory first, but it seems in fact that is just the case, I have to make the directory first! DOH!

But what is intristing is the error it gives you, is has nothing to do with the problem.
It's kinda liek the older quick basic if do try to do what is in this code it will say DO without LOOP

DO until blah
for x = blah to blah
for y = blah to blah
do something important
next y
LOOP


This won't tell you whats wrong it will just say DO without LOOP
 
Old 09-29-2008, 02:13 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The error goes something like 'no such file or directory' -it's reporting that there is no 'install' dir.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
be aware of ip stealing bujecas Linux - Networking 4 07-11-2007 12:48 PM
Which distributions are NUMA aware? mlsbraves Linux - Distributions 1 12-13-2004 12:16 PM
RAID aware wayloud Linux - General 2 07-27-2004 03:02 AM
New Linux distro I wasn't aware of? Hal General 3 12-08-2003 03:15 PM
Is 2.4.18 RAID-aware? Sigmund Gudvang Linux - General 3 05-14-2002 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration