Tiny Core Linux
General TC => General TC Talk => Topic started by: aus9 on May 20, 2013, 09:44:49 PM
-
I have a number of tczs to build within one build script.
My old simple way has the formula---where $I and the other letters are defined earlier
mksquashfs $I $I.tcz
md5sum $I.tcz > $I.tcz.md5.txt
cd $I
find usr -not -type d > $I.tcz.list
mv $I.tcz.list /tmp
but as a simple coder, it might be useful for my fav tcz checker that I don't have 17 such strings.
Can anyone point me to a good example of how to do it smarter with a loop or whatever you gurus use please?
thanks for reading
##### trivia
foomatic-db is a massive download, and instead of building a massive TCZ I plan to submit a TCZ for each open source PPD manufacturer. That way, a user may elect to read an info file and the link on what actual models are in side the tcz and then if a match download just that smaller TCZ.
-
Hi aus9
Create a file called tczs.list containing the names you wish to process. Then you can do:
for I in `cat tczs.list`
do
mksquashfs $I $I.tcz
md5sum $I.tcz > $I.tcz.md5.txt
cd $I
find usr -not -type d > $I.tcz.list
mv $I.tcz.list /tmp
done
-
great stuff, I will try that out tomorrow after I check on the other stuff I need to do
cheers
-
Hi aus9
As it stands right now, you will need to add a cd../ between the mv and done lines.
-
Hi
Do you mean?
for I in `cat tczs.list`
do
mksquashfs $I $I.tcz
md5sum $I.tcz > $I.tcz.md5.txt
cd $I
find usr -not -type d > $I.tcz.list
mv $I.tcz.list /tmp
cd ../
done
-
Hi aus9
Yes, like that.
-
well I am trying now to convert that into a inbuilt list, fragments only to give the idea
A=Brother
B=Epson
C=Gestetner
LIST=A B C D E F G H I J K L M N O P Q
for Z in $LIST
do
mksquashfs $Z $Z.tcz
md5sum $Z.tcz > $Z.tcz.md5.txt
cd $Z
find usr -not -type d > $Z.tcz.list
mv $Z.tcz.list /tmp
cd /tmp
done
I am trying to do it manually at this stage, copy and paste each section and it fails
root@box:/tmp# A=Brother
root@box:/tmp# B=Epson
root@box:/tmp# C=Gestetner
root@box:/tmp# D=HP
root@box:/tmp# E=InfoPrint
root@box:/tmp# F=Infotec
root@box:/tmp# G=KONICA_MINOLTA
root@box:/tmp# H=Kyocera
root@box:/tmp# I=Lanier
root@box:/tmp# J=Lexmark
root@box:/tmp# K=NRG
root@box:/tmp# L=Oce
root@box:/tmp# M=Oki
root@box:/tmp# N=Samsung
root@box:/tmp# O=Savin
root@box:/tmp# P=Sharp
root@box:/tmp# Q=Toshiba
root@box:/tmp# VVV=foomatic-db
root@box:/tmp# SRC=foomatic-db-2013*
root@box:/tmp#
root@box:/tmp# LIST=A B C D E F G H I J K L M N O P Q
sh: B: not found
So am I forced to use an external list or am I missing something in my coding skills?
I am cheating off, but not very well the foomatic-db internal list
# List of user-selected driver XMLs to install
DRIVERXMLS=Postscript-Brother.xml Postscript-Epson.xml Postscript-Gestetner.xml (list culled by me its big)
( cd db/source/driver/; \
for d in $(DRIVERXMLS); do \
cp $$d $(DESTDIR)$(LIBDIR)/db/source/driver; \
done )
-
Hi aus9
I think you may need to do something like:
LIST="$A $B $C $D $E $F"
-
Rich
Thats it! Woo hoo
Marked as solved.....thanks heaps
Now to tidy up the script etc
##########
in case other simple coders drop by it now reads.....fragments only to keep list short
#!/bin/sh
# do stuff
A=Brother
B=Epson
C=Gestetner
# etc
LIST="$A $B $C $D $E $F $G $H $I $J $K $L $M $N $O $P $Q"
# do stuff
for Z in $LIST
do
mksquashfs $Z $Z.tcz
md5sum $Z.tcz > $Z.tcz.md5.txt
cd $Z
find usr -not -type d > $Z.tcz.list
mv $Z.tcz.list /tmp
cd /tmp
done
# do stuff