Bug 61830 - kdebase package does not compile with recent "head" tool
Summary: kdebase package does not compile with recent "head" tool
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-30 02:58 UTC by andres.meyer
Modified: 2003-11-02 05:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
change head -1 and head -2 to head -n 1 head -n 2 (6.88 KB, patch)
2003-07-30 03:00 UTC, andres.meyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andres.meyer 2003-07-30 02:58:28 UTC
Version:            (using KDE KDE 3.1.2)
Installed from:    Gentoo Packages
OS:          Linux

when trying to compile kdebase-3.1.2 on gentoo with coreutils-5.0 installed, the make scripts do not execute because of differences in the "head" tool.

old:
"head -1"
new:
"head -n 1"

patch which makes it compile on gentoo:

diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/acinclude.m4 ./acinclude.m4
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/acinclude.m4       2003-05-13 13:05:39.000000000 +0200
+++ ./acinclude.m4      2003-07-29 16:24:19.512572776 +0200
@@ -9895,7 +9895,7 @@
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is.
       # If DATA tags from a recent dlltool are present, honour them!
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
          cp $export_symbols $output_objdir/$soname-def;
        else
          echo EXPORTS > $output_objdir/$soname-def;
diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/aclocal.m4 ./aclocal.m4
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/aclocal.m4 2003-05-13 13:05:45.000000000 +0200
+++ ./aclocal.m4        2003-07-29 16:24:19.572563656 +0200
@@ -9873,7 +9873,7 @@
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is.
       # If DATA tags from a recent dlltool are present, honour them!
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
          cp $export_symbols $output_objdir/$soname-def;
        else
          echo EXPORTS > $output_objdir/$soname-def;
diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/admin/cvs.sh ./admin/cvs.sh
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/admin/cvs.sh       2003-05-07 13:43:53.000000000 +0200
+++ ./admin/cvs.sh      2003-07-29 16:24:19.578562744 +0200
@@ -27,7 +27,7 @@

 check_autotool_versions()
 {
-AUTOCONF_VERSION=`$AUTOCONF --version | head -1`
+AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1`
 case $AUTOCONF_VERSION in
   Autoconf*2.5* | autoconf*2.5* ) : ;;
   "" )
@@ -42,7 +42,7 @@
     ;;
 esac

-AUTOHEADER_VERSION=`$AUTOHEADER --version | head -1`
+AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1`
 case $AUTOHEADER_VERSION in
   Autoconf*2.5* | autoheader*2.5* ) : ;;
   "" )
@@ -57,7 +57,7 @@
     ;;
 esac

-AUTOMAKE_STRING=`$AUTOMAKE --version | head -1`
+AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
 case $AUTOMAKE_STRING in
   automake*1.5d* )
     echo "*** YOU'RE USING $AUTOMAKE_STRING."
@@ -247,10 +247,10 @@
 echo "AC_OUTPUT" >> configure.in.new
 modulename=
 if test -f configure.in.in; then
-   if head -2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$" > /dev/null; then
+   if head -n 2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$" > /dev/null; then
       kde_use_qt_param=`cat configure.in.in | sed -n -e "s/#MIN_CONFIG(\(.*\))/\1/p"`
    fi
-   if head -2 configure.in.in | egrep "^#MIN_CONFIG" > /dev/null; then
+   if head -n 2 configure.in.in | egrep "^#MIN_CONFIG" > /dev/null; then
       line=`grep "^AM_INIT_AUTOMAKE(" configure.in.in`
       if test -n "$line"; then
          modulename=`echo $line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"`
@@ -290,7 +290,7 @@
 done
 rm -f configure.files
 touch configure.files
-if test -f configure.in.in && head -2 configure.in.in | grep "^#MIN_CONFIG" > /dev/null; then
+if test -f configure.in.in && head -n 2 configure.in.in | grep "^#MIN_CONFIG" > /dev/null; then
        echo $admindir/configure.in.min >> configure.files
 fi
 test -f configure.in.in && echo configure.in.in >> configure.files
@@ -305,8 +305,8 @@
 subdirs()
 {
 dirs=
-compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -1`
-compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -1`
+compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1`
+compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1`
 for i in `ls -1`; do
     if test -f $i/Makefile.am; then
        case " $compilefirst $compilelast " in
@@ -323,11 +323,11 @@
 done

 (for d in $dirs; do
-   list=`sed -ne "s#^COMPILE_BEFORE_$d""[ ]*=[ ]*##p" $makefile_am | head -1`
+   list=`sed -ne "s#^COMPILE_BEFORE_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
    for s in $list; do
       echo $s $d
    done
-   list=`sed -ne "s#^COMPILE_AFTER_$d""[ ]*=[ ]*##p" $makefile_am | head -1`
+   list=`sed -ne "s#^COMPILE_AFTER_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
    for s in $list; do
       echo $d $s
    done
diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/admin/libtool.m4.in ./admin/libtool.m4.in
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/admin/libtool.m4.in       2003-05-07 13:43:53.000000000 +0200
+++ ./admin/libtool.m4.in    2003-07-29 16:24:19.610557880 +0200
@@ -4503,7 +4503,7 @@
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is.
       # If DATA tags from a recent dlltool are present, honour them!
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
          cp $export_symbols $output_objdir/$soname-def;
        else
          echo EXPORTS > $output_objdir/$soname-def;
diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/configure ./configure
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/configure  2003-05-13 13:08:06.000000000 +0200
+++ ./configure 2003-07-29 16:24:19.823525504 +0200
@@ -8030,7 +8030,7 @@
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is.
       # If DATA tags from a recent dlltool are present, honour them!
-      archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+      archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
          cp $export_symbols $output_objdir/$soname-def;
        else
          echo EXPORTS > $output_objdir/$soname-def;
@@ -13973,7 +13973,7 @@
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is.
       # If DATA tags from a recent dlltool are present, honour them!
-      archive_expsym_cmds_GCJ='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+      archive_expsym_cmds_GCJ='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
          cp $export_symbols $output_objdir/$soname-def;
        else
          echo EXPORTS > $output_objdir/$soname-def;
diff -rNu ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/klipper/klipperrc.desktop ./klipper/klipperrc.desktop
--- ../../../../foo/kdebase-3.1.2/work/kdebase-3.1.2/klipper/klipperrc.desktop 2003-05-07 13:44:15.000000000 +0200
+++ ./klipper/klipperrc.desktop 2003-07-29 16:24:19.834523832 +0200
@@ -144,7 +144,7 @@
 Regexp=^https?://.

 [Action_1/Command_0]
-Commandline=dcop `dcop|grep konqueror|head -1` default 'createNewWindow(QString)' %s || kfmclient exec %s
+Commandline=dcop `dcop|grep konqueror|head -n 1` default 'createNewWindow(QString)' %s || kfmclient exec %s
 Description=Open with &Konqueror
 Description[af]=Open met Konqueror
Comment 1 andres.meyer 2003-07-30 03:00:12 UTC
Created attachment 2103 [details]
change head -1 and head -2 to head -n 1 head -n 2
Comment 2 Thiago Macieira 2003-07-30 13:08:21 UTC
I have coreutils 5.0 and head -NN works fine. Checking the texinfo page... 
 
Yea, here it is: 
   On older systems, `head' supports an obsolete option 
`-COUNTOPTIONS', which is recognized only if it is specified first. 
COUNT is a decimal number optionally followed by a size letter (`b', 
`k', `m') as in `-c', or `l' to mean count by lines, or other option 
letters (`cqv').  POSIX 1003.1-2001 (*note Standards conformance::) 
does not allow this; use `-c COUNT' or `-n COUNT' instead. 
 
Your system must have the POSIXLY_CORRECT option set. The POSIX operation mode 
should be preferrable. Does anyone know if there are systems out there that break with 
the -n option to head(1)? 
Comment 3 Caleb Tennis 2003-07-31 05:26:25 UTC
It also looks like all occurrences of this have been fixed in kde 3.1.3 (at least in kde-
common).  There may be other spots where this is still a problem, though. 
Comment 4 Dirk Mueller 2003-11-02 05:08:06 UTC
all places in 3_1_branch and head have been fixed. 
Comment 5 Dirk Mueller 2003-11-02 05:08:34 UTC
*** Bug has been marked as fixed ***.