Bug#639859: apt-build uses outdated apt configuration settings
Neil Williams <codehelp@debian.org> wrote:
> This is another instance of #637434 and may well need a similar patch
> which can be seen in Emdebian SVN:
> http://www.emdebian.org/trac/changeset/8062
It seems to me it's really something else.
> AFAICT if the test system does not use a Default-Release, this bug
> won't occur. apt-build *might* have to assert unstable as the
> Default-Release or try to replicate the system setting somehow. I don't
> use apt-build.
In fact, there is no problem with "apt-get update". The command that fails
is "apt-get -t apt-build install hello", and it still appears to me as an
apt bug.
APT::Default-Release is not set on my system, AFAIK, and I changed
temporarily my aptpinning file as below. Here is an illustration:
# cat /etc/apt/preferences.d/aptpinning
Package: *
Pin: release a=apt-build
Pin-Priority: 800
Package: *
Pin: release n=apt-build
Pin-Priority: 800
Package: *
Pin: release o=apt-build
Pin-Priority: 800
Package: *
Pin: release l=apt-build
Pin-Priority: 800
# cat /etc/apt/sources.list.d/apt-build.list
deb file:/var/cache/apt-build/repository apt-build main
# cat /var/cache/apt-build/repository/Release
Archive: apt-build
Component: main
Origin: apt-build
Label: apt-build
Architecture: amd64
# apt-get update > /dev/null ; echo $?
0
# LANG=C apt-cache policy hello
hello:
Installed: (none)
Candidate: 2.7-2
Version table:
2.7-2 0
500 http://ftp.be.debian.org/debian/ testing/main amd64 Packages
2.7-2 0
500 file:/var/cache/apt-build/repository/ apt-build/main amd64 Packages
2.6-1 0
500 http://ftp.by.debian.org/debian/ stable/main amd64 Packages
2.2-2 0
500 http://ftp.dk.debian.org/debian/ lenny/main amd64 Packages
# LANG=C apt-get -s install -t apt-build hello
Reading package lists... Done
E: The value 'apt-build' is invalid for APT::Default-Release as such a release
is not available in the sources
( -o APT::Default-Release=* doesn't help here )
What are the "sources" here ? The "sources.list" or the apt code ? How are
defined release values ? How can I set "apt-build" as a valid distribution
name ? How can I force, with apt-get, the installation of the apt-build
version ?
I'm not so interested in apt-build itself. But I have several local
repositories with arbitrary distribution names and I can't define a
Pin-Priority to one of them or use "apt-get install -t foo ...". That's the
same problem.
> apt-build is an orphaned package (and has been orphaned for a v.long
> time) and has no maintainer. If you're doing this much work on
> apt-build, maybe you should read the orphaning bug (#365427) and see if
> you can work with those who have also expressed an interest but not
> actually made the upload as maintainer. Maybe even form a team.
Unfortunately, I'm afraid my interest with apt-build itself will vanish
shortly.
Anyway, here is an improved patch that can be used to make it work,
using dpkg instead of apt.
########## BEGIN apt-build-0.12.38-bug639859.patch ##########
# Patch for apt-build-0.12.38
# Closes bugs #639859 and #528338
# for personnal use but...
# unworthy for an official distribution
diff -Naur apt-build-0.12.38.orig/apt-build apt-build-0.12.38/apt-build
--- apt-build-0.12.38.orig/apt-build 2008-07-01 08:29:43.000000000 +0200
+++ apt-build-0.12.38/apt-build 2011-08-31 20:38:26.000000000 +0200
@@ -101,9 +101,9 @@
update-source - Update all sources and rebuild them
remove - Remove packages
build-repository - Rebuild the repository
- clean-sources - Clean up all object files in source directories
clean-build - Erase downloaded packages and temporary build files
- clean-repository - Erase downloaded packages and temporary build files
+ clean-repository - Erase built packages
+ clean-sources - Clean up all object files in source directories
world - Rebuild and reinstall all packages on your system
info - Build-related package information
@@ -337,10 +337,10 @@
chdir $conf->repository_dir;
my $arch = $_config->get("APT::Architecture");
- system "ln -s . main" unless -e "main";
- system "ln -s . apt-build" unless -e "apt-build";
- system "ln -s . dists" unless -e "dists";
- system "ln -s . binary-$arch" unless -e "binary-$arch";
+ system "mkdir dists" unless -e "dists";
+ system "mkdir dists/apt-build" unless -e "dists/apt-build";
+ system "mkdir dists/apt-build/main" unless -e "dists/apt-build/main";
+ system "ln -s ../../.. dists/apt-build/main/binary-$arch" unless -e
"dists/apt-build/main/binary-$arch";
make_release_file() unless -e "Release";
system "apt-ftparchive packages . | gzip -9 > Packages.gz";
@@ -457,7 +457,15 @@
my $deb_file;
# Build the .deb name
- my $arch = $_config->get("APT::Architecture");
+ # FIXME (dirty hack here)
+ # my $arch = $_config->get("APT::Architecture");
+ # --> is not good because the arch component can be "all"
+ # but the following may be improved
+ my $arch = `apt-get --print-uris download $pkg_name`;
+ chomp $arch;
+ $arch =~ s/.*${pkg_name}_.*_//;
+ $arch =~ s/.deb.*//;
+
my $pkg_version_file; $pkg_version_file = $pkg_version;
# dpkg-buildpackage doesn't put epoch in file name, so remove it.
@@ -552,7 +560,13 @@
if(@pkgs && !($conf->build_only))
{
update() if $conf->update;
- system($conf->apt_get . " -t apt-build @apt_args install @pkglist");
+ # FIXME (dirty hack here)
+ # We use dpkg as a work-around because
+ # "apt-get -t apt-build ..." doesn't work anymore.
+ # <system($conf->apt_get . " -t apt-build @apt_args install @pkglist");>
+ # is replaced by:
+ chdir ("$conf{repository_dir}");
+ system "dpkg -i @pkgs";
wait;
}
return 1;
@@ -654,7 +668,13 @@
if( @pkgs && !($conf->build_only) )
{
update() if $conf->update;
- system($conf->apt_get . " -t apt-build @apt_args install @pkglist");
+ # FIXME (dirty hack here)
+ # We use dpkg as a work-around because
+ # "apt-get -t apt-build ..." doesn't work anymore.
+ # <system($conf->apt_get . " -t apt-build @apt_args install @pkglist");>
+ # is replaced by:
+ chdir ("$conf{repository_dir}");
+ system "dpkg -i @pkgs";
}
}
diff -Naur apt-build-0.12.38.orig/debian/postinst
apt-build-0.12.38/debian/postinst
--- apt-build-0.12.38.orig/debian/postinst 2011-03-13 16:55:00.000000000 +0100
+++ apt-build-0.12.38/debian/postinst 2011-08-31 01:19:41.000000000 +0200
@@ -79,13 +79,8 @@
# Create repository_dir
if [ ! -e "$repository_dir" ]; then
- mkdir -p "$repository_dir"
- cd "$repository_dir"
- ln -s . stable
- ln -s . dists
- ln -s . apt-build
- ln -s . main
- ln -s . binary-`dpkg --print-architecture`
+ mkdir -p "$repository_dir"/dists/apt-build/main
+ ln -s ../../.. "$repository_dir"/dists/apt-build/main/binary-`dpkg
--print-architecture`
fi
sed s/__arch__/`dpkg --print-architecture`/ /usr/share/apt-build/Release >
"$repository_dir/Release"
diff -Naur apt-build-0.12.38.orig/debian/README.Debian
apt-build-0.12.38/debian/README.Debian
--- apt-build-0.12.38.orig/debian/README.Debian 2008-02-25 15:07:27.000000000
+0100
+++ apt-build-0.12.38/debian/README.Debian 2011-08-31 20:11:11.000000000 +0200
@@ -1,6 +1,9 @@
apt-build for Debian
--------------------
+apt-build is an orphan package. If you want to adopt it, see
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365427
+
WARNING:
--------
-> Do not upload packages on Debian:
@@ -14,10 +17,12 @@
The deb line of apt-build repository must be the first line if
you want apt-get to prefer built packages than other packages.
To avoid conflicts with the `/etc/apt/preferences' mechanism,
- you may add the following entry in the `/etc/apt/preferences' file:
+ you may add the following entry in the '/etc/apt/preferences' file,
+ or the '/etc/apt/preferences.d/aptpinning' file:
+# Set Pin-Priority 800 to all local files
Package: *
-Pin: release o=apt-build
+Pin: origin ""
Pin-Priority: 800
----------------------------------------------------------------------
########## END apt-build-0.12.38-bug639859.patch ##########
Reply to: