LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 04-14-2009, 10:07 PM   #1
jazzor
Member
 
Registered: Apr 2007
Posts: 39

Rep: Reputation: 16
[BUG] Current pkgtools installpkg bug


The latest current update of pkgtools introduces a bug in installpkg script:

The installer will "hang" on packages that do not contain slack-desc.

This is very unfortunate for people who want to just make a quick self made package and use it.

The solution:

Lines 388 to about 400 in the script contains:

Code:
  if [ "$DESCRIPTION" = "" ]; then
    mkdir -p $TMP/scan$$
    ( cd $TMP/scan$$ ; $packagecompression -dc | $TAR xf - install ) < $package 2> /dev/null
    if grep "^$packagebase:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
      DESCRIPTION="$TMP/scan$$/install/slack-desc"
    elif grep "^$shortname:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
      DESCRIPTION="$TMP/scan$$/install/slack-desc"
    fi
  fi
but it should have a fallback to a blank description file so the script can continue, this is just an example:

Code:
  # If we still don't have a package description, look inside the package.
  # This requires a costly untar.
  if [ "$DESCRIPTION" = "" ]; then
    mkdir -p $TMP/scan$$
    ( cd $TMP/scan$$ ; $packagecompression -dc | $TAR xf - install ) < $package 2> /dev/null
    if grep "^$packagebase:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
      DESCRIPTION="$TMP/scan$$/install/slack-desc"
    elif grep "^$shortname:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
      DESCRIPTION="$TMP/scan$$/install/slack-desc"
    else
      DESCRIPTION=/etc/slackware-version
    fi
  fi
 
Old 04-14-2009, 10:14 PM   #2
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 800

Rep: Reputation: 99
Or you could just touch slack-desc and create a 0 byte file to fulfill the requirement.
 
Old 04-14-2009, 10:51 PM   #3
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,904

Rep: Reputation: Disabled
We've run across this one and a few others internally; new packages will arrive sooner or later. Thanks for testing - this is how we (hopefully) make sure that all these nits are gone before a release.

Last edited by rworkman; 04-14-2009 at 10:52 PM.
 
Old 04-14-2009, 10:56 PM   #4
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,008

Rep: Reputation: 110Reputation: 110
If the package doesn't contain a slack-desc or the slack-desc isn't formatted properly, it's not a valid package. Don't expect installpkg to not glitch up. An improperly formatted slack-desc may cause removepkg to not properly remove the package and leave files who-knows-where.
 
Old 04-15-2009, 02:13 AM   #5
jazzor
Member
 
Registered: Apr 2007
Posts: 39

Original Poster
Rep: Reputation: 16
Since when did you need to have a slack-desc to make a package? I understand that its useful if you are distributing to others, but for personal use, pkgtools has always worked regardless of whether a slack-desc is there or not, and there is nothing invalid about it.
 
Old 04-15-2009, 03:26 AM   #6
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Quote:
Originally Posted by tuxdev View Post
If the package doesn't contain a slack-desc or the slack-desc isn't formatted properly, it's not a valid package. Don't expect installpkg to not glitch up.
Whether 'slack-desc' is required or not, allowing the program to hang demonstrates a lack of input validation. It's a bug whichever way you look at it. Programs shouldn't 'glitch up'. They should be coded to fail gracefully.
 
Old 04-15-2009, 11:12 PM   #7
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,904

Rep: Reputation: Disabled
Wed Apr 15 22:17:31 CDT 2009
a/pkgtools-12.34567890-noarch-2.tgz: Fixed bugs with package extension
stripping and package description handling that could cause error messages
or hangs during package installs or upgrades. Thanks to Piter Punk,
Alan Hicks, Eric Hameleers, and Robby Workman.
Handle "package not found" with upgradepkg gracefully. Thanks to Shark.
 
Old 04-16-2009, 05:30 AM   #8
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,281

Rep: Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802
My thanks and congratulations to Pat Volkerding and the Slackware crew!

/me pats self on back once again for choosing a distro where a minor bug reported in a key tool has a patch distributed in 24 hours.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A bug about QT in current zhoun Slackware 5 03-15-2009 09:14 PM
Python bug in -current? Rupa Slackware 2 04-06-2008 05:46 PM
LXer: 2008 CES: Bug Labs Introduces BUG, BUGbase. So Cool! LXer Syndicated Linux News 0 01-09-2008 01:21 AM
Is this a bug in current? slackware_newbie Slackware 3 09-19-2006 01:46 PM
bug in KDE 3.5.2 (slackware current) perfect_circle Slackware 3 04-19-2006 04:22 PM


All times are GMT -5. The time now is 09:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration