LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   nslackpkg : dialogs for slackpkg (http://www.linuxquestions.org/questions/slackware-14/nslackpkg-dialogs-for-slackpkg-4175445155/)

linuxxer 01-11-2013 11:43 AM

nslackpkg : dialogs for slackpkg
 
1 Attachment(s)
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

phenixia2003 01-13-2013 06:10 AM

Hello,

Good work !

Cheers.

--
SeB

Lufbery 01-14-2013 12:10 AM

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,

linuxxer 01-14-2013 02:25 AM

@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 (Post 4869420)
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 (Post 4869420)
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.

Lufbery 01-14-2013 08:58 AM

Quote:

Originally Posted by linuxxer (Post 4869471)
@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,

BroX 01-14-2013 10:45 AM

typo
 
Nice script!

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

'Remove absolute packages' should read 'Remove obsolete packages'

linuxxer 01-14-2013 10:45 PM

Quote:

Originally Posted by BroX (Post 4869706)
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.

kooru 01-15-2013 02:52 AM

Nice script :)

linuxxer 01-15-2013 09:20 AM

Quote:

Originally Posted by kooru (Post 4870315)
Nice script :)

Thank you.

Lufbery 01-15-2013 10:07 PM

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,

linuxxer 01-15-2013 11:25 PM

Quote:

Originally Posted by Lufbery (Post 4871017)
Code:

read -n1 -r -p "Press any key to continue..."

Thanks for your suggestion.

linuxxer 01-25-2013 02:36 AM

1 Attachment(s)
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.

linuxxer 02-06-2013 01:10 AM

nslackpkg -- update
 
1 Attachment(s)
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.

linuxxer 02-15-2013 03:07 AM

nslackpkg-2.0.0 -- update -- for slackware-current
 
1 Attachment(s)
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.


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