Commit Graph

54 Commits

Author SHA1 Message Date
Paul Barker
eae0d8fa44 opkg-build: Fix spelling mistake
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-06-05 19:54:00 +00:00
Paul Barker
afcc8f0a59 opkg-build: Fix logical error in comment
I knew what I meant, but hit commit too fast!

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-06-05 19:50:58 +00:00
Thomas Ingleby
f7bfdb14de opkg-build: Detect if tar supports '--format' option
* Some options of GNU tar do not exist on other implementations

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-06-05 19:31:08 +00:00
Paul Barker
d14458499a opkg-update-index: Emit relative path to package file
The new relpath argument of the Package object constructor is used so that the
relative path from pkg_dir to the package file will be placed in the package
index. The allows the package file to be in a subdirectory of pkg_dir.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-06 00:04:49 +00:00
Paul Barker
e0b081d290 opkg-make-index: Recursively scan for packages
The new 'relpath' argument to the initialiser of a Package object is used so
that file paths will be given relative to the base packages directory.

Paths are given relative to pkg_dir as that seems to make the most sense. It
certainly works when the 'Packages' file is written to pkg_dir. If the
'Packages' file is written elsewhere it is assumed that the user will know what
the paths are relative to. This is similar to debian feeds where the paths in a
'Packages' file is not stored in the packages pool but is stored in a separate
directory, yet paths are given relative to the common base of these directories.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-06 00:04:49 +00:00
Paul Barker
7ce5796e9c opkg.py: Allow filename to be a relative path
In order to support package files residing in a different directory to the
'Packages' index file, we need to allow filename entries in the index to be
relative paths. In order to not break existing code, filename remains the
basename of fn by default. However, if the new relpath argument is set then
filename is the path of fn relative to relpath.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-06 00:04:49 +00:00
Paul Barker
5beb5b4539 .gitignore: Ignore compiled python files
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-06 00:04:22 +00:00
Paul Barker
d0ae907613 opkg-compare-indexes: Fix usage message
The usage message had the name of the program wrong.

If the number of arguments is not correct then the current code does not show
the usage message as indended. Instead it gives an index out of range error if
too few arguments are provided or silently ignores extra arguments. This code is
fixed so that the length of the arguments list is checked before arguments are
accessed, preventing errors and allowing the usage message to be shown
correctly.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-05 23:10:57 +00:00
Paul Barker
423970dfe7 .gitignore: Ignore vim swp files
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-05-05 22:56:45 +00:00
Thilo Cestonaro
c33b217016 opkg-build: create dpkg-deb compatible ipks/opks again
With a change from last august in dpkg-deb, the packages generated by opkg-build will not be accepted by dpkg-deb anymore.
The change disallows that the data.tar.gz is packed into the ipk/opk before the control.tar.gz.
For details have a look here:
http://anonscm.debian.org/gitweb/?p=dpkg/dpkg.git;a=commitdiff;h=547dca4c3ff23df5dfa554f1943b371cd7056ee4

For details which order is correct, see "man 5 deb", but in short it is:
debian-binary, control.tar.gz and data.tar.gz

Signed-off-by: Thilo Cestonaro <thilo@cestona.ro>
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-03-01 13:44:16 +00:00
Paul Barker
fd4a3a4c20 update-alternatives: Script copied from opkg
The update-alternatives script is being moved from opkg to opkg-utils to break
possible circular dependencies in openembedded. As opkg will depend on
libarchive soon, and may depend on other packages if certain options are
enabled, opkg cannot itself provide update-alternatives if its dependencies
require update-alternatives.

opkg-utils has minimal build-time dependencies and so is a good place to put the
update-alternatives script.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2014-01-14 20:13:58 +00:00
Paul Barker
0f6a67bc15 CONTRIBUTING: New file
Added instructions for potential contributors.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2013-12-20 17:38:04 +00:00
Paul Barker
82ab84e147 AUTHORS: New file
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
2013-12-03 13:19:19 +00:00
Richard Purdie
757a1664a4 opkg-build: Remove bashism in sh script
Otherwise this fills logs with output on systems with dash as /bin/sh,
we might as well execute cleanly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 13:56:29 +00:00
Steffen Sledz
f1a9d67019 opkg.py/opkg-build: fix creation of tar archives
Since openSUSE 12.2 the installed tar uses posix instead of gnu encoding
by default. This format is not fully supported by opkg and results in
ipk packages not installable at the target.

Collected errors:
 * get_header_tar: Unknown typeflag: 0x78: Success.
 * get_header_tar: Unknown typeflag: 0x78: Success.
 * get_header_tar: Unknown typeflag: 0x78: Success.
 * extract_archive: Don't know how to handle /var/lib/opkg/tmp/opkg-mg997m/chicken-bin-fGRvr4/PaxHeaders.17512/.: No such file or directory.
 * get_header_tar: Unknown typeflag: 0x78: No such file or directory.
 * get_header_tar: Unknown typeflag: 0x78: No such file or directory.
 ...

Signed-off-by: Steffen Sledz <sledz@dresearch-fe.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-24 12:13:04 +01:00
Marc Olzheim
3d62b08bab opkg-make-index: fix mis-indented else:
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-10-24 12:13:04 +01:00
Richard Purdie
49cc783d8e opkg.py: Add check_output defintion so it works on python 2.6
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 16:55:12 +01:00
Chris Diamand
423ecd36b4 Changed call to subprocess.check_output which isn't compatible with Python 2.6
subprocess.check_output is not present in Python 2.6. Since the return value
is not being used anyway, replace it with subprocess.call(), which is.

Signed-off-by: Chris Diamand <chris@diamand.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-19 08:34:48 +01:00
Ondics Githubler
0dd51b9063 Option "C" ist shown in usage() and implemented, but was missing in getopts. Added "C".
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-19 08:34:35 +01:00
Martin Jansa
44df9dd3dc opkg-make-index: disable filelist by default
* user has to specify filename with -l to enable it

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
3578f32a3a opkg.py: get_file_list_dir: fix empty output from find if package disappers
* if .ipk disappers before parsing Packages.old then it's fine and it's not used at all
* but if it disappers between parsing Packages.old and generating Packages.filelist then
  it would fail to split() empty output

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
6b62cfb4c8 opkg-make-index: generate complete filelist
* when '-l Packages.filelist' option is used together with '-r Packages.old',
  then only 'new' packages are processed to create Packages.filelist
  packages found in Packages.old doesn't have fn set so get_file_list()
  was returning empty
* now added get_file_list_dir() looks for filename in pkg_dir and if it
  finds correct .ipk file it will use that to read its filelist, but it
  also means that it will always unpack *all* Packages - very slow.
* it would be nice to add new param for Packages.filelist.old and then
  filter filelist for packages used from Packages.old and merge it
  together with new Packages.filelist, but that's more difficult because
  of files structure.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
aa268baf4f opkg.py: improve test so it prints temporary control file with long description and then reads it back
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
7f0a7976c2 opkg.py: use textwrap for description writing
* description field in oe-core sometimes has extra line-feeds and is long
* extra line-feeds breaks read_control, because empty line means next Package
* long descriptions should be wrapped and properly indented, so they are parsed back properly

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
c30dcd27d4 opkg.py: fix write_package when called from main test
* there is no self.meta_dir before self._setup_scratch_area
* control file needs to be closed before packing it with tar, otherwise it could be empty

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
2bb6037ead opkg.py: computeFileMD5 only when we have fn, otherwise fails to read None file
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
28c706b41e opkg.py: cast lines from controlfile as string
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
b9eec00a67 opkg-make-index: don't use stdout for Packages output and use __str__ instead of __repr__
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
554da94178 arfile: fix test
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
e2de780ae5 opkg.py: catch TypeError when reading control file, to show which one is failing
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:42 +01:00
Martin Jansa
5742435b33 opkg.py: use string funtcions directly on string variable
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
deabe73a40 opkg-make-index: show OSError/IOError
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
9a4f0a0eb8 2to3: exception handling fixes
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
a9e112ae51 2to3: dictionary fixes
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
76ed799fa0 2to3: print fixes
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
83d2c065da 2to3: use subprocess instead of commands
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
cc08d0e3ae arfile: decode read lines as ascii string before getting fields from it
* python3 returns them as byte sequence

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
0e5f4c9277 opkg.py, arfile.py: report which file has wrong format and use the same test
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Martin Jansa
97bfc2dc14 opkg.py: use hashlib instead of old md5 module
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Christopher Larson
efe66d374d Use python via the PATH, rather than hardcoding /usr/bin/python
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Scott Anderson
4b04e41eb6 arfile.py: handle six digit UIDs
* Essentially, the problem is that arfile.py is splitting the ar header with
  white-space instead of fixed-width fields, so two fields would get treated
  as a single field.  This makes things better than before as it now honors
  the fixed field widths.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Khem Raj
74fc0c6a7c opkg.py: Add knowledge about License field in ipk headers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:41 +01:00
Enrico Scholz
a917774fb1 opkg-make-index: convert mtime to int before comparing it
* The st_mtime attribute (which is a float) is compared against a value
  from the timestamp database, which was stored as an integer there.

* When working on a filesystem with precise timestamps the comparision
  will fail nearly everytime hence.

* Although it might be possible to enhance the database to store the
  fractional part too, this will complicate things more than we would
  gain by this change.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:40 +01:00
Richard Purdie
c1033c9d5c opkg-make-index: don't error out when some package disappears
* If we're building an image and some package rebuilds while this is
  happening some package can be removed/added to the ipk deploy
  directory. The image will not depend on this package so we can
  safely ignore these cases rather than error out.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2012-04-26 11:39:40 +01:00
Lianhao Lu
16665959c3 opkg-compare-versions: Adapted to the latest opkg upstream.
Adapted to the latest opkg upstream implemenation for comparing
versions.

This is part of the bug fixing [YOCTO #2233].

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-13 14:54:37 +01:00
Tick Chen
002d29bc60 [opkg-utils] fix install fail problem
Thanks for khorben's patch :-)
 https://docs.openmoko.org/trac/attachment/ticket/2072/patch-opkg-utils_Makefile_install_path.diff
2008-11-03 03:59:59 +00:00
Tick Chen
85409083af [opkg-util] adding Size support when creating Packages 2008-08-12 04:11:25 +00:00
Holger 'Zecke' Freyther
27eb95490d [opkg-utils] Print the "Tags" field. Patch from OE and authored by John Lee 2008-08-07 10:11:38 +00:00
Holger 'Zecke' Freyther
92a2dad4aa ipkg-utils: fix ipk (ar) file processing to handle odd-length data blocks.
Closes bug #4350.

This was authored by mwester and comes from OE.
2008-08-07 10:07:28 +00:00
Holger 'Zecke' Freyther
8b83ffaf7d [opkg-build] Add -O to the getopt list to make it a valid option
- -O is now a honored option.
2008-08-02 20:25:10 +00:00