FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-06-2012, 10:08 AM
Malte Forkel
 
Default How to retrieve package source from arbitrary repository

Hi,

In order to rebuild or patch a package, I sometimes have to download its
source from a repository which is not on my APT sources list. I'm
looking for a tool to make retrieving the source as easy as possible.

Until now, I have been using dget (from the devscripts package). With
the URI of a .dsc file as its argument, dget will download all source
files of a package (typically, .dsc, .diff.gz., and .orig.tar.gz).

In order to use dget, I have to determine the .dsc file's URI, either by
browsing the repository contents or by looking at the repository's
control files. This task I would like to automate.

Is there a tool that will determine the .dsc file's URI given the
repository's base URI, the distribution name, and the package name? I
guess it would have to download and parse the Source control files,
ideally caching them for later use.

Thanks in advance,
Malte


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jlmfb0$202$1@dough.gmane.org">http://lists.debian.org/jlmfb0$202$1@dough.gmane.org
 
Old 04-06-2012, 05:03 PM
Andrei POPESCU
 
Default How to retrieve package source from arbitrary repository

On Vi, 06 apr 12, 12:08:31, Malte Forkel wrote:
>
> Is there a tool that will determine the .dsc file's URI given the
> repository's base URI, the distribution name, and the package name? I
> guess it would have to download and parse the Source control files,
> ideally caching them for later use.

Not what you're asking for, but debcheckout (in package devscripts) may
be useful for you.

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 04-11-2012, 07:23 AM
Malte Forkel
 
Default How to retrieve package source from arbitrary repository

Am 06.04.2012 19:03, schrieb Andrei POPESCU:
>
> Not what you're asking for, but debcheckout (in package devscripts) may
> be useful for you.
>

Thanks, Andrei. Not quite what I need, unfortenately.

I'm still looking for a tool that will determine the URI of the source
package's .dsc file, given a repository base URI and a package name.

Malte


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jm3bhc$d27$1@dough.gmane.org">http://lists.debian.org/jm3bhc$d27$1@dough.gmane.org
 
Old 04-11-2012, 01:59 PM
Camaleón
 
Default How to retrieve package source from arbitrary repository

On Wed, 11 Apr 2012 09:23:26 +0200, Malte Forkel wrote:

> Am 06.04.2012 19:03, schrieb Andrei POPESCU:
>>
>> Not what you're asking for, but debcheckout (in package devscripts) may
>> be useful for you.
>>
>>
> Thanks, Andrei. Not quite what I need, unfortenately.
>
> I'm still looking for a tool that will determine the URI of the source
> package's .dsc file, given a repository base URI and a package name.

If the repository does not follow Debian mirror rules nor package naming,
it's almost impossible to decipher the URI from a given ".dsc" file, it
can be hosted anywhere in the server.

Otherwise, if it uses conventional Debian packaging rules, you can use
the static information to make a guess:

uri="ftp.de.debian.org/debian/pool/main/g" pkg="gedit" ver="_3.2.6-1" wget $uri/$pkg/$pkg$ver.dsc

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jm42n7$3l4$4@dough.gmane.org">http://lists.debian.org/jm42n7$3l4$4@dough.gmane.org
 
Old 04-11-2012, 08:31 PM
Bob Proulx
 
Default How to retrieve package source from arbitrary repository

Malte Forkel wrote:
> I'm still looking for a tool that will determine the URI of the source
> package's .dsc file, given a repository base URI and a package name.

You could create a second sources.list with the repository listed in
it. Then point to that configuration file on the command line. You
could use this secondary configuration for downloading the file.

See the 'apt-get --config-file' option. It would go something like
this (off the top of my head, is certainly incomplete, and would need
some tinkering, but good for illustration):

cat >$tmpfile <<-EOF
APT::Get::List-Cleanup "false";
Dir::Etc::SourceList "$cnf_dir/sources.list";
EOF
config=$tmpfile
apt-get --config-file $config update -qq
apt-get --config-file $config download $packagename
apt-get update -qq

I am doing something like this for a different purpose and I pulled
that out of a script of mine.

Doing this will avoid needing to change your global sources.list file
and allow you to maintain your own copy for this purpose.

In my case I am also setting these options which you might want to
investigate setting to local private locations too. YMMV, just
supplied as a hint, and all of that.

Acquire::http::No-Cache "true";
APT::Quiet "true";
APT::Get::List-Cleanup "false";
Dir::Etc::SourceList "$cnf_dir/sources.list";
Dir::State::Lists "$cache_dir/lists";
Dir::Cache "$cache_dir/cache";

Bob
 
Old 04-12-2012, 04:00 PM
Malte Forkel
 
Default How to retrieve package source from arbitrary repository

Am 11.04.2012 15:59, schrieb Camaleón:
>
> If the repository does not follow Debian mirror rules nor package naming,
> it's almost impossible to decipher the URI from a given ".dsc" file, it
> can be hosted anywhere in the server.
>
> Otherwise, if it uses conventional Debian packaging rules, you can use
> the static information to make a guess:
>
> uri="ftp.de.debian.org/debian/pool/main/g" pkg="gedit" ver="_3.2.6-1" wget $uri/$pkg/$pkg$ver.dsc
>

Unfortenately, guessing would be hard: I don't know the package's
version number, plus I can't be sure about the repository's directory
structure (trivial or automatic repository).

Still, thanks a lot,
Malte





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jm6u6t$r08$1@dough.gmane.org">http://lists.debian.org/jm6u6t$r08$1@dough.gmane.org
 
Old 04-12-2012, 04:23 PM
Malte Forkel
 
Default How to retrieve package source from arbitrary repository

Am 11.04.2012 22:31, schrieb Bob Proulx:
> You could create a second sources.list with the repository listed in
> it. Then point to that configuration file on the command line. You
> could use this secondary configuration for downloading the file.
>
> See the 'apt-get --config-file' option. It would go something like
> this (off the top of my head, is certainly incomplete, and would need
> some tinkering, but good for illustration):
>
> cat >$tmpfile <<-EOF
> APT::Get::List-Cleanup "false";
> Dir::Etc::SourceList "$cnf_dir/sources.list";
> EOF
> config=$tmpfile
> apt-get --config-file $config update -qq
> apt-get --config-file $config download $packagename
> apt-get update -qq
>
> I am doing something like this for a different purpose and I pulled
> that out of a script of mine.
>
> Doing this will avoid needing to change your global sources.list file
> and allow you to maintain your own copy for this purpose.
>
> In my case I am also setting these options which you might want to
> investigate setting to local private locations too. YMMV, just
> supplied as a hint, and all of that.
>
> Acquire::http::No-Cache "true";
> APT::Quiet "true";
> APT::Get::List-Cleanup "false";
> Dir::Etc::SourceList "$cnf_dir/sources.list";
> Dir::State::Lists "$cache_dir/lists";
> Dir::Cache "$cache_dir/cache";

In lieu of a specialized tool, that's a very clever idea. I just wonder:
How can I make sure nothing strange happens because another process uses
apt-get during the source list redirection, i.e. after the first and
before the second update? Or is that paranoid?

Thanks, Malte




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jm6vhv$8pv$1@dough.gmane.org">http://lists.debian.org/jm6vhv$8pv$1@dough.gmane.org
 
Old 04-12-2012, 05:00 PM
Bob Proulx
 
Default How to retrieve package source from arbitrary repository

Malte Forkel wrote:
> > Dir::Etc::SourceList "$cnf_dir/sources.list";
> > Dir::State::Lists "$cache_dir/lists";
> > Dir::Cache "$cache_dir/cache";
>
> In lieu of a specialized tool, that's a very clever idea. I just wonder:
> How can I make sure nothing strange happens because another process uses
> apt-get during the source list redirection, i.e. after the first and
> before the second update? Or is that paranoid?

If you set up the above options then you will be working in your own
private sandbox. Then it won't matter.

Bob
 
Old 04-17-2012, 08:58 AM
Malte Forkel
 
Default How to retrieve package source from arbitrary repository

Am 12.04.2012 19:00, schrieb Bob Proulx:
> Malte Forkel wrote:
>>> Dir::Etc::SourceList "$cnf_dir/sources.list";
>>> Dir::State::Lists "$cache_dir/lists";
>>> Dir::Cache "$cache_dir/cache";
>>
>> In lieu of a specialized tool, that's a very clever idea. I just wonder:
>> How can I make sure nothing strange happens because another process uses
>> apt-get during the source list redirection, i.e. after the first and
>> before the second update? Or is that paranoid?
>
> If you set up the above options then you will be working in your own
> private sandbox. Then it won't matter.
>
> Bob

Just wanted to say thanks for your good advice and report on what I did.

Using an APT sandbox made things pretty simple. I can directly use the
apt-get commands 'source' and 'download' after setting up the temporary
source list. With the --simulate option for the initial apt-get update,
the script works for non-root users as well. And as far as I can tell, I
don't need the closing update, because the system-wide source list is
not changed.

Malte


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jmjban$tsi$1@dough.gmane.org">http://lists.debian.org/jmjban$tsi$1@dough.gmane.org
 

Thread Tools




All times are GMT. The time now is 12:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org