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

Re: emsetup bug





Neil Williams wrote:
What if I could add a line '#include apt.conf-unstable.local' that
could include a separate file? (Along the lines of how bind handles
named.conf.local?) It is probably the better solution, overall.

You could then leave apt-cross to manage
~/.dpkg-cross/apt.conf-unstable and have your proxy setting in
~/.dpkg-cross/apt.conf-unstable.local

I don't have a proxy setup to test, could you try this at your end? Any
additional content in these files is managed in the setup_config()
routine of apt-cross. Adding the include instruction at line 327 should
do the job. I need to know also if the absence of the .local file
causes any error messages, i.e. whether apt-cross should touch
the .local file or whether it can be left entirely to the user. It's
probably best if the #include doesn't specify a full path, I'd expect
it to work with a relative path or no path at all (as above). The
filename may need to be quoted though. Whilst testing, you may need to
put your own proxy line within setup_config() in apt-cross so that
emsetup uses the proxy even when updating.

Neil,

I've done some testing and here are the results. I hacked up the 0.0.5 version of apt-cross. The #include does work, but does complain if the file is not there, resulting in an error. So the .local file will need to be touched if referenced in the apt.conf-<suite> file. Also, I did have to quote the name of the .local file, and a full path was needed. Without the full path, invoking apt-get from within the .dpkg-cross directory worked, but the file was not found if invoked from another directory (e.g. ~), so the tool must be using the current directory from which the apt-get is invoked if a relative path is used. So here are the lines I added (note I did not try to parameterize the touch filename).

$ diff -u 0.0.5/apt-cross 0.0.5-patched/apt-cross
--- 0.0.5/apt-cross     2007-01-26 11:57:58.000000000 -0500
+++ 0.0.5-patched/apt-cross     2007-02-04 01:42:13.000000000 -0500
@@ -276,7 +276,7 @@
sub setup_config()
{
       @dirs = qw/ alternatives info parts updates/;
-       @touch = qw/ diversion statoverride status lock/;
+ @touch = qw/ apt.conf-unstable.local diversion statoverride status lock/;
       #set up necessary dirs for cross-dpkg database
       if (not -e "$dpkg_cross_dir/$suite") {
               mkdir "$dpkg_cross_dir/$suite";
@@ -316,6 +316,7 @@
  State "$suite/";
  Cache "$suite/";
};
+#include "$dpkg_cross_dir/apt.conf-$suite.local";
END
               close CONF;
       }
androcross: /usr/src/emdebian/apt-cross


Now with these changes, I still ran into some issues, as things were still not working. I found that my ./dpkg-cross/sources.unstable file was created with only the lines for www.emdebian.org, and did not have any lines for the Debian repository that I have in my /etc/apt/sources.list file (a previous posting has the contents of my sources.list file). The 0.0.5 apt-cross tool doesn't seem to pickup any lines from the system sources.list file even though there is an unstable source in the file. I fixed this by manually editing the sources.unstable file.

Next, I had the problem that running apt-get as user jh150702 could not get the lock file for /var/lib/dpkg/lock (the error message asked if I was root). If I tried to run the command using sudo, then it couldn't open the /home/jh150702/.dpkg-cross/unstable/lists/lock file due to a permission problem. I finally got it to run by changing the permissions on the file /var/lib/dpkg/lock file to allow r/w by everyone. Once I did this, I ran the apt-get as user jh150702 and finally succeeded and filled my cache.

Now I tried this both with and without the proxy line in the .local file. It worked both ways. I think the proxy line was not the true problem, but rather one/both of the above problems instead. My read of the apt.conf man page leads me to believe that the settings for apt.conf are built up using a combination of the conf files, including the main system file that is matched by the Dir::Etc::main filename (see below), as well as the one specified on the command line with -c

------- first paragraph of apt-conf man page
apt.conf is the main configuration file for the APT suite of tools, all
      tools make use of the configuration file and a common command line
parser to provide a uniform environment. When an APT tool starts up it
      will read the configuration specified by the APT_CONFIG environment
variable (if any) and then read the files in Dir::Etc::Parts then read
      the main configuration file specified by Dir::Etc::main then finally
      apply the command line options to override the configuration
      directives, possibly loading even more config files.
-------

The result of this is that I think we don't specifically need the proxy line in the .local file. That file still could be useful for people to override settings that shouldn't be set in the system apt.conf file, but as for the proxy line, it would already be set.

Below find some listings with the errors I encoutered. Let me know if you need further testing tomorrow.

-Jim

---------------------------- Permission problems with /var/lib/dpkg/lock
androcross: /home/jh150702
$ apt-get -V -o Apt::Architecture=powerpc -c ~/.dpkg-cross/apt.conf-unstable update
Ign http://www.emdebian.org unstable Release.gpg
Get:1 http://mirrors.ircam.fr unstable Release.gpg [378B]
Hit http://www.emdebian.org unstable Release
Get:2 http://mirrors.ircam.fr unstable Release [79.6kB]
Ign http://www.emdebian.org unstable/main Packages/DiffIndex
Ign http://www.emdebian.org unstable/main Sources/DiffIndex
Ign http://www.emdebian.org unstable/main Packages
Ign http://www.emdebian.org unstable/main Sources
Hit http://www.emdebian.org unstable/main Packages
Hit http://www.emdebian.org unstable/main Sources
Get:3 http://mirrors.ircam.fr unstable/main Packages/DiffIndex [2038B]
Get:4 http://mirrors.ircam.fr unstable/main Sources/DiffIndex [2023B]
Fetched 83.6kB in 3s (23.5kB/s)
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
androcross: /home/jh150702

---------------------------- Permission problems with sudo and ~/.dpkg-cross/unstable/lists/lock $ sudo apt-get -V -o Apt::Architecture=powerpc -c ~/.dpkg-cross/apt.conf-unstable update
Password:
E: Could not open lock file /home/jh150702/.dpkg-cross/unstable/lists/lock - open (13 Permission denied)
E: Unable to lock the list directory

---------------------------- Change system file permissions and it finally works
androcross: /home/jh150702
$ su
Password:
androcross:/home/jh150702# chmod 666 /var/lib/dpkg/lock
androcross:/home/jh150702# exit
exit
androcross: /home/jh150702
$ apt-get -V -o Apt::Architecture=powerpc -c ~/.dpkg-cross/apt.conf-unstable update
Ign http://www.emdebian.org unstable Release.gpg
Get:1 http://mirrors.ircam.fr unstable Release.gpg [378B]
Hit http://www.emdebian.org unstable Release
Get:2 http://mirrors.ircam.fr unstable Release [79.6kB]
Ign http://www.emdebian.org unstable/main Packages/DiffIndex
Ign http://www.emdebian.org unstable/main Sources/DiffIndex
Ign http://www.emdebian.org unstable/main Packages
Ign http://www.emdebian.org unstable/main Sources
Hit http://www.emdebian.org unstable/main Packages
Hit http://www.emdebian.org unstable/main Sources
Get:3 http://mirrors.ircam.fr unstable/main Packages/DiffIndex [2038B]
Get:4 http://mirrors.ircam.fr unstable/main Sources/DiffIndex [2023B]
Fetched 83.6kB in 3s (24.5kB/s)
Reading package lists... Done
androcross: /home/jh150702


----------------------------- A fully working run from scratch with some files cat'd
androcross: /home/jh150702
$ rm -rf .dpkg-cross/
androcross: /home/jh150702
$ apt-cross -v -a powerpc -S unstable -u
Updating unstable on powerpc using /etc/apt/sources.list
recreating /home/jh150702/.dpkg-cross/apt.conf-unstable
recreating /home/jh150702/.dpkg-cross/sources.unstable
androcross: /home/jh150702
$ cat .dpkg-cross/
alternatives/                      parts/
apt.conf-unstable                  sources.unstable
apt.conf-unstable.local            statoverride
.aptupdate-stamp-unstable-powerpc  status
diversion                          unstable/
info/                              updates/
lock
androcross: /home/jh150702
$ cat .dpkg-cross/apt.conf-unstable
Dir "/home/jh150702/.dpkg-cross/"
{
 Etc "/home/jh150702/.dpkg-cross/"
 {
   SourceList "sources.unstable";
 };
 State "unstable/";
 Cache "unstable/";
};
#include "/home/jh150702/.dpkg-cross/apt.conf-unstable.local";
androcross: /home/jh150702
$ cat .dpkg-cross/apt.conf-unstable.local
androcross: /home/jh150702
$ cat .dpkg-cross/sources.unstable
deb http://www.emdebian.org/debian unstable main
deb-src http://www.emdebian.org/debian unstable main
androcross: /home/jh150702
$ cp /etc/apt/sources.list .dpkg-cross/sources.unstable
androcross: /home/jh150702
$ cat .dpkg-cross/sources.unstable
deb http://www.emdebian.org/debian unstable main
deb-src http://www.emdebian.org/debian unstable main

deb http://mirrors.ircam.fr/pub/debian/ unstable main
deb-src http://mirrors.ircam.fr/pub/debian/ unstable main
androcross: /home/jh150702
$ apt-get -V -o Apt::Architecture=powerpc -c ~/.dpkg-cross/apt.conf-unstable update
Ign http://www.emdebian.org unstable Release.gpg
Get:1 http://mirrors.ircam.fr unstable Release.gpg [378B]
Get:2 http://www.emdebian.org unstable Release [1027B]
Get:3 http://mirrors.ircam.fr unstable Release [79.6kB]
Ign http://www.emdebian.org unstable/main Packages
Ign http://www.emdebian.org unstable/main Sources
Get:4 http://www.emdebian.org unstable/main Packages [1745B]
Get:5 http://www.emdebian.org unstable/main Sources [20B]
Get:6 http://mirrors.ircam.fr unstable/main Packages [4494kB]
Get:7 http://mirrors.ircam.fr unstable/main Sources [1294kB]
Fetched 5871kB in 27s (214kB/s)
Reading package lists... Done
androcross: /home/jh150702
$ ./jim.pl
gcc-4.1-doc
gcc-4.1-powerpc-linux-gnu
gcc-avr
gcc-3.3-doc
gcc-snapshot
gcc-doc
gcc-4.1-base
gcc-m68hc1x
gcc-4.0-locales
gcc-3.2
1 = 3.2
gcc-3.3
1 = 3.3
gcc-3.4
1 = 3.4
gcc-3.4-base
gcc-4.0
1 = 4.0
gcc-4.1
1 = 4.1
gcc-3.4-doc
gcc
gcc-4.1-arm-linux-gnu
gcc-4.1-arm-linux-gnu-base
gcc-4.0-base
gcc-4.1-locales
gcc-4.1-powerpc-linux-gnu-base
gccxml
gcc-docs
gcc-2.95-powerpc-cross
gcc-h8300-hms
gcc-2.95-doc
gcc-4.1-source
gcc-3.5-base
gcc-2.95
1 = 2.95
gcc-3.3-base
gcc272-docs
final choice = 4.1
androcross: /home/jh150702








Reply to: