Author info in pet.specs file?

There has been some discussion recently on the Forum about the PET package format:
http://murga-linux.com/puppy/viewtopic.php?t=75383

It is very healthy to have this kind of analysis. Yes, the PET format started life in Puppy 2.0, but it has evolved since then. In late 2011 there was a significant improvement in the format of information kept in the "database" entry for a PET package, that is, the content of 'pet.specs'.

In particular, there is now versioning support for dependencies:
http://bkhome.org/blog/?viewDetailed=02368
http://bkhome.org/blog/?viewDetailed=02363

I am currently working on MoManager, which is a tool to internationalize Puppy. When a translation file for a script is created or updated by MoManager, the package to which the script belongs is identified, and if a Woof script, MoManager supplies my email address and gzips the new .mo file ready to send. However, a consistent mechanism is needed to do that for PET packages -- if pet.specs contains author and email address, that would solve that problem.

The way that I implemented the "database", one line per package, fields that are delimited by a | character, it is easy to extend with more fields.

Any thoughts on this are welcome.


Posted on 6 Feb 2012, 8:40


Comments:

Posted on 6 Feb 2012, 9:33 by technosaurus
extra fields
it may sound silly, but puppy runs on a lot of lower resource machines and having a couple of extra fields would be useful on those

resource usage(s) {minimum/normal/max}
on the same token
runtime deps (extra programs that must be running)

btw I have found awk to be ideal for processing these types of flat file database

for instance:
grep -> /string/
cut -d -> FS
print $1 ... $XX
math functions built in


Posted on 7 Feb 2012, 6:04 by mavrothal
Povides/requires
What about a "Provides" and may be a "Requires" field or file in the pet?
Something like that could be added into dir2pet to generate the fields/files
pet_provides() 

{
cd $ADIR
BASE=`pwd`
#echo "$BASEPKG"_files = > /tmp/files.field
find . -type d | sed 's/^.//' > /tmp/dirs # `| grep -v \/share' could excluded this dir
cat /tmp/dirs |
while read ONELINE
do
cd "$BASE""$ONELINE"
FILES=`find . -maxdepth 1 -type f | awk -F/ '{ print $NF }' | tr '\n' ','`
if [ "$FILES" != "" ] ; then
echo "$ONELINE"/{"$FILES"} >> /tmp/files.field
fi
done
PROVIDES=`cat /tmp/files.field`
rm /tmp/files.field
BASE=""
cd $NOW
}

pet_depends() # It does not pick binaries in ../lib subfolders or /usr/share
{
cd $ADIR
BASE=`pwd`
for i in "$BASE"/{bin,sbin,lib}/*
do
ldd $i | grep -v "not\ a\ dynamic" | cut -f 1 -d '=' >> /tmp/deps.field
done

for i in "$BASE"/usr/{bin,sbin,lib}/*
do
ldd $i | grep -v "not\ a\ dynamic" | cut -f 1 -d '=' >> /tmp/deps.field
done

for i in "$BASE"/usr/local/{bin,sbin,lib}/*
do
ldd $i | grep -v "not\ a\ dynamic" | cut -f 1 -d '=' >> /tmp/deps.field
done

for i in "$BASE"/usr/X11R7/{bin,sbin,lib}/*
do
ldd $i | grep -v "not\ a\ dynamic" | cut -f 1 -d '=' >> /tmp/deps.field
done

DEPENDS=`cat /tmp/deps.field | grep -v ld-linux\.so |tr -d '\t'| tr -d ' ' | sort | uniq | tr '\n' ' '`
rm /tmp/deps.field
BASE=""
cd $NOW
}


(I'm sure that coding can be improved ;)