two patches together: anti-stale install_packages and spec version

Yaroslav Halchenko debian at onerussian.com
Thu Oct 23 23:59:36 CEST 2003


I've decided to solve another problem I've got through direct patching
FAI: what if I want to install some downgraded versions of packages? I
need sip 3.5, not recent 3.8... So I put sip=3.5-3 in my
packages/DEFAULT cause apt-get understands this notation. The only thing
you need is to patch FAI so it doesn't get rid of such packages when it
checks their validity.
Also I think it wouldn't be bad to join behaviour of debug and verbose
in install_packages cause it is not straighforward why do you need
'debug' specific behaviour... verbose is producing much more info


So I've created tiny patch (I'm not that great in Perl programming so
there might be better solution to the problem)

I hope you find it usefull


diff -aur fai-2.5.1/debian/changelog fai-2.5.1.y1/debian/changelog
--- fai-2.5.1/debian/changelog  2003-10-10 08:58:17.000000000 -0400
+++ fai-2.5.1.y1/debian/changelog       2003-10-23 10:52:04.000000000 -0400
@@ -1,3 +1,10 @@
+fai (2.5.1.y1) unstable; urgency=low
+
+  * Patched for avoiding stale pipe in verbose in some cases
+  * Made it possible to specify versions of the packages to install
+
+ -- Yaroslav Halchenko <yoh at psychology.rutgers.edu>  Thu, 23 Oct 2003
10:51:06 -0400
+
 fai (2.5.1) unstable; urgency=low

   * share/subroutines: use $SECONDS instead of date +%s
diff -aur fai-2.5.1/scripts/install_packages fai-2.5.1.y1/scripts/install_packages
--- fai-2.5.1/scripts/install_packages  2003-08-04 08:07:42.000000000 -0400
+++ fai-2.5.1.y1/scripts/install_packages       2003-10-23
11:05:29.000000000 -0400
@@ -123,7 +123,9 @@
     # it's not easy to determine the real package name
     # example: g++; is the package called g+ and should be installed, or just g++?
     $packlist = join(' ',grep {! /[+-]$/} @{$list{$type}});
-    my $misspelt = qx{$rootcmd apt-cache show $packlist 2>&1 1>/dev/null};
+    $packlistnover=$packlist;
+    $packlistnover =~ s/=\w+//g;
+    my $misspelt = qx{$rootcmd apt-cache show $packlistnover 2>&1 1>/dev/null};
     $misspelt =~ s/W: Couldn't stat source .+?\n//g;
     $misspelt =~ s/W: Unable to locate package //g;
     $misspelt =~ s/\n/ /g;
diff -aur fai-2.5.1/share/subroutines-linux fai-2.5.1.y1/share/subroutines-linux
--- fai-2.5.1/share/subroutines-linux   2003-10-10 05:43:10.000000000 -0400
+++ fai-2.5.1.y1/share/subroutines-linux        2003-10-23
11:00:25.000000000 -0400
@@ -110,10 +110,8 @@
 task_instsoft() {

     echo "Installing software may take a while"
-    if [ "$debug" ]; then
-       install_packages | tee -a $LOGDIR/software.log
-    elif [ "$verbose" ]; then
-       yes '' | install_packages 2>&1 | tee -a $LOGDIR/software.log
+    if [ "$debug" ] || [ "$verbose" ]; then
+        bash -c "(yes '' | install_packages) > >( tee -a $LOGDIR/software.log ) 2>&1"
     else
        yes '' | install_packages >> $LOGDIR/software.log 2>&1
     fi


                                  .-.
=------------------------------   /v\  ----------------------------=
Keep in touch                    // \\     (yoh@|www.)onerussian.com
Yaroslav Halchenko              /(   )\               ICQ#: 60653192
                   Linux User    ^^-^^    [175555]
             Key  http://www.onerussian.com/gpg-yoh.asc
GPG fingerprint   3BB6 E124 0643 A615 6F00  6854 8D11 4563 75C0 24C8




More information about the linux-fai mailing list