Troubles with opkg.org repo

Joel Newkirk freerunner at newkirk.us
Tue Mar 10 03:40:32 CET 2009


On Sun, 8 Mar 2009 15:30:36 +0200
"Risto H. Kurppa" <risto at kurppa.fi> wrote:

> On Sat, Mar 7, 2009 at 10:09 AM, Tobias Kündig
> <tobias.kuendig at gmail.com> wrote:
> > This is a little summary of what I do: http://www.opkg.org/repo.html
> 
> Thanks Tobias!
> 
> At #openmoko tried to figure out what's wrong. Someone pointed out
> that ftp uses ascii mode by default - I suppose you're uploading at
> least the Packages -ascii file. How about packages.gz. Man ftp says
> that ascii upload of binary files might corrupt it -> this might be
> the problem - using binary format shouldn't corrupt the .gz
> 
> Another find was that 22 packages out of 93 were other than Debian
> Binary when checked with file *ipk. The list file types listed below:
> 
> DEBIAN BINARY – CORRECT!!!
{snipped package names}
> DATA

> EMPTY

> GZIP

> So things seem to fail because:
> - Empty file is an empty file, not much to discuss about that. Only
> need to find out the reason for that: did the authors really upload an
> empty package or did the upload fail but an empty file was created?

Nothing to add here.

> - ar isn't able to extract gzip files so all files recognized as gzip
> will not get listed properly in the Packages file. Again the reason
> for the wrong file type should be found: did the packages package it
> wrong or did the type/mime/something get corrupted along the way,
> during the upload or on the server?

It is perfectly acceptable for an ipk to be a tarball (.tar.gz) instead
of an ar archive.  'opkg install' happily works with them.  So the
'fix' needs to be in create_repo.

j

{!!untested!!}

#!/bin/sh

cd /root/opkg.org/packages/
echo -n  >Packages

for file in `ls -1 *.ipk *.opk`; do
 echo $file
 sum=`md5sum $file | awk '{print $1}'`
 pkgtype=`file $file | cut -d' ' -f2`
 case "$pkgtype" in
  Debian)
   ar x $file control.tar.gz
   tar xzf ./control.tar.gz ./control
   cat control|grep -e "[:alnum:]" >> Packages
   echo Filename: $file >> Packages
   echo MD5Sum: $sum >> Packages
   echo  >> Packages
   echo  >> Packages
   rm
-f /root/opkg.org/packages/control.tar.gz /root/opkg.org/packages/control
  ;;
  gzip)
   tar xzf $file ./control.tar.gz
   tar xzf ./control.tar.gz ./control
   cat control|grep -e "[:alnum:]" >> Packages
   echo Filename: $file >> Packages
   echo MD5Sum: $sum >> Packages
   echo  >> Packages
   echo  >> Packages
   rm
-f /root/opkg.org/packages/control.tar.gz /root/opkg.org/packages/control
  ;;
  *)
   echo "Problem extracting $file"
  ;;
esac
done

gzip -c /root/opkg.org/packages/Packages
>/root/opkg.org/packages/Packages.gz

#Upload
ftp -v -n ftp.opkg.org < /root/opkg.org/ftp2.input




More information about the community mailing list