Re: Determining a .deb's intended Debian Version

2005-11-11 Thread Christopher Crammond




Suppose you have a repository stuffed full of binary packages, in this
case Debian Packages.  If you were unlucky enough to have them in a
rather un-organized fashion, I was just wondering if the package file
itself would provide said information to allow me to write a program to
sort them out.

-- christopher

Marc 'HE' Brockschmidt wrote:

  Christopher Crammond <[EMAIL PROTECTED]> writes:
  
  
I was wondering if someone could provide me with some additional
information related to Debian packaging.  Specifically, I would like to
know if there is a way to determine which version of Debian that a
package belongs to?

  
  
No. Almost all packages in stable have been uploaded to unstable, were
migrated to testing and then were released as stable. We would have to
do new uploads for each of these transitions to keep such a field
updated.

Why do you need it, anyway?

Marc
  
  

!DSPAM:4373032e716371204020884!


-- 
Christopher Crammond, Software Engineer
Open Country, Inc.
[EMAIL PROTECTED]
650.591.8080 ext 246




Determining a .deb's intended Debian Version

2005-11-09 Thread Christopher Crammond
Hello:

I was wondering if someone could provide me with some additional
information related to Debian packaging.  Specifically, I would like to
know if there is a way to determine which version of Debian that a
package belongs to?

For instance, the control file of the dpkg_1.10.28_i386.deb file looks
like this:

Package: dpkg
Version: 1.10.28
Section: base
Priority: required
Architecture: i386
Essential: yes
Pre-Depends: dselect, libc6 (>= 2.3.2.ds1-21)
Conflicts: sysvinit (<< 2.82-1), dpkg-iasearch (<< 0.11), dpkg-static, dpkg-dev 
(<< 1.10)
Replaces: dpkg-doc-ja, dpkg-static, manpages-de (<= 0.4-3)
Installed-Size: 5636
Origin: debian
Maintainer: Dpkg Development 
Bugs: debbugs://bugs.debian.org
Description: Package maintenance system for Debian
 This package contains the programs which handle the installation and
 removal of packages on your system.
 .
 The primary interface for the dpkg suite is the `dselect' program;
 a more low-level and less user-friendly interface is available in
 the form of the `dpkg' command.
 .
 In order to unpack and build Debian source packages you will need to
 install the developers' package `dpkg-dev' as well as this one.


I can see that the origin is indeed Debian; however, is there anyway to
determine which version of Debian this is targeted for (ie. 3.0, 3.1,
etc...)?

As a comparison, RPM offers an optional field for Distribution.  While
not required, most packages to fill in this field and it provides of
means of determine the intended flavor of Linux.

Thank-you,
-- christopher

-- 
Christopher Crammond, Software Engineer
Open Country, Inc.
[EMAIL PROTECTED]
650.591.8080 ext 246


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Interfaces for dpkg/deb packages

2005-09-20 Thread Christopher Crammond




Michael,

That little example is very cool and sure do appreciate you taking the
time to help me out.  I got the source code and can take if from here.
Thank-you very much.

-- christopher

Michael Vogt wrote:

  On Thu, Sep 15, 2005 at 02:40:06PM -0700, Christopher Crammond wrote:
  
  
I was curious as to where I might be able to find out what
non-command-line interfaces into .deb packages are available.  For
instance, is there a C interface that could pull out information such as
Name, Version, Release, etc... ?

  
  [..]

libapt_inst (from the apt package) provides a interface in C++ and
python-apt (module apt_inst) provides a interface in python.

Attached is a example using python-apt.

Cheers,
 Michael

  
  

#!/usr/bin/env python
# some example for apt_inst

import apt_pkg
import apt_inst
import sys

def Callback(What,Name,Link,Mode,UID,GID,Size,MTime,Major,Minor):
""" callback for debExtract """

print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u"\
  % (What,Name,Link,Mode,UID,GID,Size, MTime, Major, Minor);


if __name__ == "__main__":
if len(sys.argv) < 2:
print "need filename argumnet"
sys.exit(1)
file = sys.argv[1]

print "Working on: %s" % file
print "Displaying data.tar.gz:"
apt_inst.debExtract(open(file), Callback, "data.tar.gz")

print "Now extracting the control file:"
control = apt_inst.debExtractControl(open(file))
sections = apt_pkg.ParseSection(control)
print sections

print "Maintainer is: "
print sections["Maintainer"]

print
print "DependsOn: "
depends = sections["Depends"]
print apt_pkg.ParseDepends(depends)




  


-- 
Christopher Crammond, Software Engineer
Open Country, Inc.
[EMAIL PROTECTED]
650.591.8080 ext 246




Interfaces for dpkg/deb packages

2005-09-15 Thread Christopher Crammond
Greetings All:

First-time poster, please be gentle.  :)

I was curious as to where I might be able to find out what
non-command-line interfaces into .deb packages are available.  For
instance, is there a C interface that could pull out information such as
Name, Version, Release, etc... ?

I posted the above question on the debian-policy mailing list, and I got
back that .deb is simply an AR file & that writing my own routines
shouldn't be too hard.  While I agree, I figure this is probably already
done/documented somewhere else (say the dpkg project).  Where is the
right place to start asking questions?

For instance, the parse.c file in dpkg-1.10.28/lib looks promising, but
where can I get more information about this?

Thanks,
-- christopher

-- 
Christopher Crammond, Software Engineer
Open Country, Inc.
[EMAIL PROTECTED]
650.591.8080 ext 246


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]