[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 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

Attachment: signature.asc
Description: Digital signature


Reply to: