LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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: 792

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-14.2 on Lenovo Thinkpad W520
Posts: 7,703

Rep: Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620Reputation: 2620
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
Senior Member
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 4,302

Rep: Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278Reputation: 2278
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: 6,661

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
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
Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 728

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: 792

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: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 2,700

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


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

Rep: Reputation: 488Reputation: 488Reputation: 488Reputation: 488Reputation: 488
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: 6,661

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
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


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



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 07:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration