Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 May 2013, 20:14
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Problem scripting with BarryK's mageia2ppm
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
scsijon

Joined: 23 May 2007
Posts: 923
Location: the australian mallee

PostPosted: Sun 18 Mar 2012, 23:30    Post subject:  Problem scripting with BarryK's mageia2ppm  

Part 1: Could one of our coders tell me why this: (part of mageia2ppm file attached) (the mageia version is '2' in this case), and fix it for me if possible please. I'm not much of a coder nowadays!

Code:
echo
mgaPTN0="\\[== [^@]*\\.mga${MAGEIA_VERSION}\\]"
mgaPTN1="s%\\.mga${MAGEIA_VERSION}.*%%"
echo -n "" > /tmp/mageia2ppm-ppm-temp1
cat $SYNTHHDLIST |
while read ONELINE
do
 echo -n '.'
 case $ONELINE in
  @provides@*)
   DB_version="`echo -n "$ONELINE" | grep -o "$mgaPTN0" | cut -f 2 -d ' ' | rev | cut -f 2-9 -d '.' | rev | head -n 1 | cut -f 2 -d ':'`"
   PROVIDES_SO=" `echo -n "$ONELINE" | tr '@' '\n' | tr -s '\n' | grep -E '\.so$|\.so\.[0-9]' | cut -f 1 -d '(' | sort -u | tr '\n' ' '`" #list of shared libs, space-delimited.
  ;;
  @conflicts@*)
   true
  ;;
  @requires@*)
   REQUIRES_SO=" `echo -n "$ONELINE" | tr '@' '\n' | tr -s '\n' | grep -E '\.so$|\.so\.[0-9]' | cut -f 1 -d '(' | sort -u | tr '\n' ' '`" #list of shared libs, space-delimited.
   REQUIRES_PKG=" `echo -n "$ONELINE" | tr '@' '\n' | tr -s '\n' | grep -v -E '\.so$|\.so\.[0-9]|/|requires|\(' | cut -f 1 -d '[' | sort -u | tr '\n' ' '`"
  ;;
  @summary@*)
   DB_description="`echo -n "$ONELINE" | cut -f 3 -d '@' | tr '[|<>]' ' '`"
  ;;
  @info@*)
   FULLNAME="`echo -n "$ONELINE" | cut -f 3 -d '@'`"
   DB_fullfilename="${FULLNAME}.rpm"
   DB_pkgname="`echo -n "$FULLNAME" | sed -e "$mgaPTN1"`"
   vPTN="s%\\-${DB_version}.*%%"
   DB_nameonly="`echo -n "$DB_pkgname" | sed -e "$vPTN"`"
   DB_compileddistro="mageia";DB_compiledrelease="$MAGEIA_VERSION"
   if [ "`echo -n "$FULLNAME" | grep '\.noarch$'`" != "" ];then
    DB_compileddistro=""
    DB_compiledrelease=""
   fi
   sizeBYTES=`echo -n "$ONELINE" | cut -f 5 -d '@'`
   DB_size=$(($sizeBYTES/1024))
   
   categoryORIG="`echo -n "$ONELINE" | cut -f 6 -d '@'`"
   #puppy categories are: Desktop, System, Setup, Utility, Filesystem, Graphic, Document, Business, Personal, Network, Internet, Multimedia, Fun, BuildingBlock, Help, Develop
   case $categoryORIG in
    Development*) DB_category="Development" ;;
    Archiving*|Sciences*|Monitoring*|Terminals*) DB_category="Utility" ;;
    System/Internationalization*|System/Font*) DB_category="System" ;;
    System/Configuration*) DB_category="Setup" ;;
    System*) DB_category="BuildingBlock" ;;
    Office*|Database*) DB_category="Business" ;;
    Networking/Other|Networking/Remote*|Communications*) DB_category="Network" ;;
    Networking*) DB_category="Internet" ;;
    *desktop*|Accessibility*) DB_category="Desktop" ;;
    Video*|Sound*) DB_category="Multimedia" ;;
    Graphics*) DB_category="Graphic" ;;
    Games*|Toys*) DB_category="Fun" ;;
    Text*|Publishing*|Education*|Editors*) DB_category="Document" ;;
    File*) DB_category="Filesystem" ;;
    Books*) DB_category="Help" ;;
    *) DB_category="BuildingBlock" ;;
   esac
   #3 fields on end are temporary...
   echo "$DB_pkgname|$DB_nameonly|$DB_version||$DB_category|${DB_size}K|$DB_path|$DB_fullfilename|$DB_dependencies|$DB_description|${DB_compileddistro}|${DB_compiledrelease}||${PROVIDES_SO}|${REQUIRES_SO}|${REQUIRES_PKG}|" >> /tmp/mageia2ppm-ppm-temp1
   PROVIDES_SO="";REQUIRES_SO="";REQUIRES_PKG="";FULLNAME="";DB_pkgname='';DB_nameonly='';DB_version='';DB_category='';DB_size='';DB_fullfilename='';DB_dependencies='';DB_description=''
  ;;
 esac

-------------------

on this: (part of the Packages-mageia-2-taintedpre db file attached)

Code:
@provides@adplug.so@audacious-adplug[== 5:3.2.1-1.mga2.tainted]@audacious-adplug(x86-32)[== 5:3.2.1-1.mga2.tainted]
@requires@audacious[>= 5:3.2.1]@libaudcore.so.1@libbinio.so.1@libc.so.6@libc.so.6(GLIBC_2.0)@libc.so.6(GLIBC_2.1.3)@libc.so.6(GLIBC_2.3.4)@libc.so.6(GLIBC_2.4)@libgcc_s.so.1@libgcc_s.so.1(GCC_3.0)@libglib-2.0.so.0@libgobject-2.0.so.0@libgtk-3.so.0@libm.so.6@libm.so.6(GLIBC_2.0)@libstdc++.so.6@libstdc++.so.6(GLIBCXX_3.4)@libstdc++.so.6(GLIBCXX_3.4.11)@libstdc++.so.6(GLIBCXX_3.4.15)@libstdc++.so.6(GLIBCXX_3.4.9)@rtld(GNU_HASH)
@summary@AdLib player plugin for audacious
@filesize@164259
@info@audacious-adplug-3.2.1-1.mga2.tainted.i586@5@427376@Sound

-------------------

is outputing this: (second and third fields are wrong).

Code:
audacious-adplug-3.2.1-1|audacious|||Multimedia|417K|tainted/release|audacious-adplug-3.2.1-1.mga2.tainted.i586.rpm||AdLib player plugin for audacious|mageia|2||

--------------------

Instead of this:

Code:
audacious-adplug-3.2.1-1|audacious-adplug|3.2.1-1||Multimedia|417K|tainted/release|audacious-adplug-3.2.1-1.mga2.tainted.i586.rpm||AdLib player plugin for audacious|mageia|2||

-------------------

For the second field, it seems to be cutting at the first '-' instead of the end of the field;
And for the third field it's putting nothing in it!

BUT IT's not always so, just mostly! And most annoying is that if I try it on Mageia's mga1 databases, when it was built by BarryK, it seems that it works every time. But there doesn't seem to be any visable differances between them!

-------------------------------------------------

Part 2:

I also need to have where the .mga2 is, also allow .mga1 or the letter c (for cauldron) to appear.
--------------------------------------------
The attached files need their fake .gz removed before opening, if you need them.

Apologies for the wide fields, but I didn't want to stuff anything up!

Any ideas?

thanks in advance

scsijon
Packages-mageia-2-taintedpre.gz
Description 
gz

 Download 
Filename  Packages-mageia-2-taintedpre.gz 
Filesize  165.41 KB 
Downloaded  57 Time(s) 
mageia2ppm.gz
Description 
gz

 Download 
Filename  mageia2ppm.gz 
Filesize  6.33 KB 
Downloaded  64 Time(s) 
Packages-mageia-2-tainted.gz
Description 
gz

 Download 
Filename  Packages-mageia-2-tainted.gz 
Filesize  39.59 KB 
Downloaded  126 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0566s ][ Queries: 12 (0.0131s) ][ GZIP on ]