LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 08-11-2017, 05:16 AM   #1
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Rep: Reputation: Disabled
Why slack-desc has such a complex structure?


Hi,

Pun intended ;-)

Question: why slack-desc isn't simply text file that could be cat, but actually has to be grepped?

--
Best regards,
Andrzej Telszewski
 
Old 08-11-2017, 07:03 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Unauthorized answer: this makes easier to check:
  • The lines' count
  • The lines' length
  • That the lines begin with a <space> or are empty
  • The package's name
However, it is of course possible to use an other format and convert the text to meet the specs, and even to include the slack-desc in a SLKBUILD, as expected by slkbuild:
Code:
#Maintainer: George Vlahavas (email hidden by Didier)

pkgname=slkbuild
pkgver=1.2
pkgrel=1slint
arch=noarch
source=(slkbuild-$pkgver.tar.xz)
options=('nosrcpack')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"slkbuild (arch-like wrapper script for easy packaging)"
"slkbuild is a script inspired by makepkg from Arch which greatly"
"simplifies the package building process in Slackware and derivatives."
"It parses an easy to create SLKBUILD meta-file and from that creates"
"slackware packages."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	make
	make install DESTDIR=$startdir/pkg PREFIX=/usr
}
TIP: to avoid an UUOC, instead of
Code:
cat myfile|program
use
Code:
$(<myfile) program

Last edited by Didier Spaier; 08-11-2017 at 07:05 AM.
 
Old 08-11-2017, 07:41 AM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Didier Spaier View Post
TIP: to avoid an UUOC, instead of
Code:
cat myfile|program
use
Code:
$(<myfile) program
To those who were curious what UUOC is like I was, it stands for "Useless Use Of Cat". Basically stating that there are simpler methods for displaying the contents of a file (cat is designed to concatenate two or more files together... it just displays a single file as a byproduct).

However, Didier's command, $(<myfile) program, takes much more effort to type, so I'll probably continue using cat "uselessly"
 
Old 08-11-2017, 08:27 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by bassmadrigal View Post
To those who were curious what UUOC is like I was, it stands for "Useless Use Of Cat". Basically stating that there are simpler methods for displaying the contents of a file (cat is designed to concatenate two or more files together... it just displays a single file as a byproduct).

However, Didier's command, $(<myfile) program, takes much more effort to type, so I'll probably continue using cat "uselessly"
Furthermore, it is a butt-ugly command. I prefer the useless use of cat anytime in the name of readability.
 
3 members found this post helpful.
Old 08-11-2017, 10:08 AM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
There is also the consideration that its not portable for every shell. For example it does not seem to work in the ash shell provided with Slackware.
 
Old 08-11-2017, 11:12 AM   #6
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

You guys are driving MY OWN PERSONAL thread away from its original topic :-(

--
Best regards,
Andrzej Telszewski
 
1 members found this post helpful.
Old 08-11-2017, 11:53 AM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I think it should be XML with a full XSD.


Runs for his very life....
 
Old 08-11-2017, 12:41 PM   #8
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Richard, even better: make them binary and use a slack-descctl program to edit/view them. :-o

To answer the question, I always figured it was just to make it easier to format correctly when typing it.
 
Old 08-11-2017, 02:40 PM   #9
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by atelszewski View Post
Hi,

You guys are driving MY OWN PERSONAL thread away from its original topic :-(

--
Best regards,
Andrzej Telszewski
Well your original question made less sense than most of the replies.
 
3 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
slack-desc: not working? Transhour Slackware 7 02-05-2011 02:51 AM
Slackpkg and slack-desc Panci Slackware 9 04-05-2009 06:15 AM
slack-desc requirements/expectations Woodsman Slackware 4 10-18-2008 10:26 AM
Makepkg and slack-desc mirto Slackware 7 10-15-2005 03:17 PM
Format of slack-desc file Azmeen Slackware 6 07-11-2003 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration