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

Re: debian-cd and new packages



On Tue, Mar 21, 2006 at 03:15:23PM -0800, philagui wrote:
> 
> Hello,
> 
> Paras > I sent you the modified script by email, hope you have it and it
> helped.
> 
> All right I did an apt-get -d (download-only option) install apache
> mysql-server. It redownloaded all the packages needed for apache and
> mysql-server and now when I run make mirrorcheck it tells me something
> different, saying that apache and mysql-server have dependencies that are
> not installable and it removes the packages from the list.

apt-get -d only counts package that are not from a local source.

This is nice if you want to put your packages in a local source and
ignore them. I oriignally used such an iterative and manual process.

However, now I'm looking at a differeny way. apt-get install --dry-run .
This allows me to not only get the list of installed packages, but also
find from which source they came. And also get packages that came from a
local source.

The attached script is part of what I'm working on. It gets as an input
the output of 'apt-get install --dry-run' (with some options to limit it
to a directory under my control, of course) and generates lists suitable
for reprepro's conf/update FilterList .

I'm using reprepro 0.8

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen@xorcom.com  http://www.xorcom.com
#!/usr/bin/perl -w

# convert apt-get --dry-run install output to repository listing
# 
# inputs:
#
# 1. a repository updates file ($updates_file below) for themetadata
# 2. The output of apt-get install --dry-run in the standard input
#
# Outputs: List of packages to update from each repository

use strict;

my $updates_file='repo/conf/updates';

$/="\n\n";

my %repos_labels = ();

my %packages = ();

open(REPO,$updates_file) or 
	die ("Failed to open repositories updates file: $!");
	
while (<REPO>) {
	# we got a complete block:
	my @records = split(/[\n]/,$_);
	my %source = ();
	foreach (@records) {
		m/^(\S*):\s*(\S.*)/;    
		$source{$1} = $2;
	}
	$repos_labels{$source{Label}} = $source{Name};
	$packages{$source{Name}} = [];
}
close REPO;

$/ = "\n";

while (<STDIN>) {
	if      (m|^Inst ([\w.+-]*) \([\w.:+-]* ([\w-]*):[^/]*/[^)]*\)|) {
		push @{$packages{$repos_labels{$2}}},($1);
	}
}

foreach my $dist (keys %packages) {
	my $updates_file = "repo/conf/$dist.updates"; 
	open UPDATES,">$updates_file" or 
		die "Failed to open updates file $updates_file for writing: $!";
	foreach my $package (@{$packages{$dist}}) {
		print UPDATES  "$package\t\tinstall\n";
	}
	close UPDATES;
}


Reply to: