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 01-11-2013, 10:43 AM   #1
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Rep: Reputation: Disabled
nslackpkg : dialogs for slackpkg


Slackers,

I created one script which add dialogs for slackpkg.
Just a wrapper for slackpkg tool.

Aim is to make simple task easy.

To practice shell scripting, I created this script.
Just for fun, nothing serious.

Suggestions are expected to improve my script.

Thanks
Attached Files
File Type: txt nslackpkg.txt (13.4 KB, 94 views)
 
Old 01-13-2013, 05:10 AM   #2
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 293

Rep: Reputation: 166Reputation: 166
Hello,

Good work !

Cheers.

--
SeB
 
Old 01-13-2013, 11:10 PM   #3
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Rep: Reputation: 119Reputation: 119
I like it.

On my first, quick test, it seemed to run well, but I've found two issues and I have one feature request.

I offer this feedback in the spirit you requested it. I went through a similar exercise a couple of years ago where I posted a script for updating Slackware on this forum and got very helpful suggestions from many people here. I was also working on my scripting.

The 1st issue: I decided to update the package list. The first time I tried it, I got this message and made the following response:

Code:
Running : slackpkg update
Continue [Y/N]? y
Note the lower case y. Nothing happened except that the script returned me to the main menu.

The second time I tried it, I used a capital Y and got the correct result:

Code:
Running : slackpkg update
Continue [Y/N]? Y


Updating the package lists...
        Downloading...
Slackpkg itself seems to accept y or n regardless of whether or not they're capitalized.

The 2nd issue is that after updating the package list, nslackpkg didn't go back to the main menu.

Finally, the feature request. It would be neat to have a check-updates menu item.

Warm regards,
 
Old 01-14-2013, 01:25 AM   #4
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
@phenixia2003
Thanks for your reply.

@Lufbery
Positive feedback gives encouragement.
Negative response for script helps to improve my script.
Both kind of response is expected.
That is the reason, I posted the script on this forum.


Code:
Continue [Y/N]? Y
I purposely did this.
When my script tries to run slackpkg tool.
Then user must agree with slackpkg tool command and argument list.
If user is pressing Y, means user is absolutely sure.
No chance of human mistake.

slackpkg works on command line arguments.

Quote:
Originally Posted by Lufbery View Post
the feature request. It would be neat to have a check-updates menu item.
My script not providing all functionality given by slackpkg tool. Such as
Code:
slackpkg new-config
slackpkg install slackware
slackpkg install kde
My script not providing option to blacklist official slackware packages like kernel-generic-smp.
It is difficult to blacklist complete package group, for example all [0-9]+_SBo
For this purpose editing blacklist file is very simple way.

My script helps to select package one by one and perform task.

While creating script, I consider all slackpkg command options.

If you choose Update menu item,
then slackpkg update will download Changelog file,
If update is not available it will ask question.
It is similar to check-updates functionality.
Considering this, I have not implemented check-updates option.


Quote:
Originally Posted by Lufbery View Post
after updating the package list, nslackpkg didn't go back to the main menu
Before posting script on forum. I did all possible testing.

It is very less information.
Can you provide more details.
It will be helpful for me.

Thanks for your reply.
 
Old 01-14-2013, 07:58 AM   #5
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by linuxxer View Post
@phenixia2003
Thanks for your reply.

@Lufbery
Positive feedback gives encouragement.
Negative response for script helps to improve my script.
Both kind of response is expected.
That is the reason, I posted the script on this forum.
I'm glad to help.

I really think that nslackpkg is a neat script.

Quote:
Before posting script on forum. I did all possible testing.

It is very less information.
Can you provide more details.
It will be helpful for me.

Thanks for your reply.

I'm at work now, but I'll be happy to test more thoroughly and post more detailed information over the next few days.

Warm regards,
 
Old 01-14-2013, 09:45 AM   #6
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current
Posts: 746

Rep: Reputation: 64
Thumbs up typo

Nice script!

A minor remark of a typo in the main menu, at 'Clean System':

'Remove absolute packages' should read 'Remove obsolete packages'
 
1 members found this post helpful.
Old 01-14-2013, 09:45 PM   #7
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BroX View Post
Nice script!

A minor remark of a typo in the main menu, at 'Clean System':

'Remove absolute packages' should read 'Remove obsolete packages'
Thanks for your reply.

That's my mistake.
 
Old 01-15-2013, 01:52 AM   #8
kooru
Senior Member
 
Registered: Sep 2012
Location: Italy
Distribution: Slackware, NetBSD
Posts: 1,332
Blog Entries: 5

Rep: Reputation: 262Reputation: 262Reputation: 262
Nice script
 
1 members found this post helpful.
Old 01-15-2013, 08:20 AM   #9
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kooru View Post
Nice script
Thank you.
 
Old 01-15-2013, 09:07 PM   #10
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Rep: Reputation: 119Reputation: 119
Okay, here was my test:

I ran nslackpkg and chose to "Update package list":

Code:
Updating the package lists...
        Downloading...
                        Downloading ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-13.37/ChangeLog.txt...
--2013-01-15 21:59:22--  ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-13.37/ChangeLog.txt
           => `/tmp/slackpkg.upE5b1/ChangeLog.txt'
Resolving slackware.mirrors.tds.net (slackware.mirrors.tds.net)... 204.246.0.134
Connecting to slackware.mirrors.tds.net (slackware.mirrors.tds.net)|204.246.0.134|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/slackware/slackware64-13.37 ... done.
==> SIZE ChangeLog.txt ... 178139
==> PASV ... done.    ==> RETR ChangeLog.txt ... done.
Length: 178139 (174K) (unauthoritative)

100%[======================================================================================>] 178,139      108K/s   in 1.6s    

2013-01-15 21:59:25 (108 KB/s) - `/tmp/slackpkg.upE5b1/ChangeLog.txt' saved [178139]


                No changes in ChangeLog.txt between your last update and now.
                Do you really want to download all other files (y/N)? n


Press any key to continue ....
 j
Updating package information
Working Directory : /tmp/nslackpkg.sh.7509.s9bqGU
I pressed the space bar, and then the j key and nothing happened. You will see a space on the last line.

However, when I hit the Enter key, nslackpkg's main menu appeared again.

So, while the text says press any key, only the Enter key works.

If you really want any key to work, you should add switches to the read command:

Code:
read -n1 -r -p "Press any key to continue..."
There's some good information here.

Regards,
 
Old 01-15-2013, 10:25 PM   #11
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Lufbery View Post
Code:
read -n1 -r -p "Press any key to continue..."
Thanks for your suggestion.
 
Old 01-25-2013, 01:36 AM   #12
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
nslackpkg -- update, with slackpkg new-config similar functionality.

Little difference between. slackpkg and myscript.

slackpkg uses:
Code:
if [ "$ONLY_NEW_DOTNEW" = "on" ]; then
	ONLY_NEW_DOTNEW="-cnewer $TMPDIR/timestamp"
else
	ONLY_NEW_DOTNEW=""
fi

find /etc -name "*.new" ${ONLY_NEW_DOTNEW} \
		-not -name "rc.inet1.conf.new" \
		-not -name "group.new" \
		-not -name "passwd.new" \
		-not -name "shadow.new" \
		-not -name "gshadow.new" 2>/dev/null
nslackpkg uses:
Code:
find /etc -type f -name '*.new' -print 2>/dev/null
Suggestions are expected.
Attached Files
File Type: txt nslackpkg.txt (16.0 KB, 7 views)

Last edited by linuxxer; 01-25-2013 at 01:42 AM.
 
Old 02-06-2013, 12:10 AM   #13
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
nslackpkg -- update

Slackers,

Few improvement in new-config functionality.

Code:
Options: 
--newconf-editor=command
	Specify "command" to edit selected NEWCONF_FILE.
	Selected NEWCONF_FILE name is pass as argument to "command".

	command's responsibility,
	    take backup, edit, verify new changes, and apply new changes.

	NOTE: "command" is COMPLETELY responsible for CONF_FILE and NEWCONF_FILE.

--help
	Print this message and exit.
Code:
$ nslackpkg --help
While writting the script, I was thinking about Slackware-stable version.
Somebody tell me, whether script is useful on Slackware-current version or not.
I used only Slackware-stable version.

I thinking about Slackware version upgrade functionality.

Suggestions are expected.

Thanks.
Attached Files
File Type: txt nslackpkg.txt (17.7 KB, 6 views)

Last edited by linuxxer; 02-06-2013 at 12:11 AM.
 
Old 02-15-2013, 02:07 AM   #14
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
nslackpkg-2.0.0 -- update -- for slackware-current

Slackers,

1. Modified slackpkg PRIORITY configuration handling than previous release.

2. NEW, UPDATE, OBSOLETE package tagging.

3. Added "Update and View Changes" functionality.

4. Few improvements.

Now /var/lib/nslackpkg directory is required to store old slackpkg's pkglist.


I just finished the implementation.
I did two update of Slackware-14.0 with the help of the script.
I changed the mirror to slackware-current to test the script.
I got expected result. Only this much testing I did.
Proper testing is required.

I am not using slackware-current, so to test the script some help is expected from slackware-current users.

If this script able to handle changes of slackware-current,
then slackware-version upgrade is possible with the help of this script.
Except blacklisted packages.

I am comparatively new to the Slackware.
First time writing script for Slackware.

As per slackpkg.conf(5)
Code:
PRIORITY
            This array selects the priority at which directories on the mirror will have when slackpkg looks for
packages.  If a package is found  in more  than one place, the package in first directory gets priority, 
then second, then third, then fourth and finally, the package found in last listed directory.
I implemented "PRIORITY" as per manual, but I am little-bit confuse about my implementation.
Some help is expected to test my script.

Suggestions are expected.

Thanks.
Attached Files
File Type: txt nslackpkg-2.0.0.txt (22.1 KB, 10 views)

Last edited by linuxxer; 02-16-2013 at 08:52 PM. Reason: Typing mistake
 
  


Reply

Tags
dialog, slackpkg, slackware


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
[SOLVED] typos in latest /etc/slackpkg/mirrors(.new) [slackpkg-2.82.0-noarch-8.tgz] wailingwailer Slackware 4 09-22-2012 04:04 AM
kde/qt instalation has no icons to dialogs rudsonalves Slackware 4 07-17-2009 12:37 PM
Slackpkg: missing something in /usr/libexec/slackpkg/functions.d/dialog-functions.sh michelino Slackware 4 03-20-2007 12:22 PM
Qt dialogs return data Ephracis Programming 7 02-21-2007 11:49 AM
Signal 11 error dialogs linus321 Linux - Software 5 05-28-2005 07:24 AM


All times are GMT -5. The time now is 02:07 AM.

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