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

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

Reply to: