USM Unified Slackware Package Manager

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
User avatar
Ed_P
Contributor
Contributor
Posts: 8087
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: USM Unified Slackware Package Manager

Post#271 by Ed_P » 22 Aug 2014, 18:39

Have you looked at this script?

Code: Select all

Downloading: vercheck.txt  DONE

/usr/share/usm/funcupdateDatabase: line 338: [: 140816: unary operator expected
No database updates were found.

/usr/share/usm/funcupdateDatabase: line 351: [: 140821: unary operator expected
You have the current USM version.

root@porteus:/home/guest# 
=EDIT=

Code: Select all

root@porteus:/home/guest# ls /tmp/usm/vercheck.txt
/bin/ls: cannot access /tmp/usm/vercheck.txt: No such file or directory
root@porteus:/home/guest# find vercheck.txt
find: `vercheck.txt': No such file or directory
root@porteus:/home/guest# 
=EDIT=
FWIW

Code: Select all

root@porteus:/home/guest# md5sum /etc/usm/usm.conf p10/Por/usm.conf
9a9ccd2cdefb649e6c4801814c981bd8  /etc/usm/usm.conf
md5sum: p10/Por/usm.conf: No such file or directory
root@porteus:/home/guest# 
=EDIT=
FWIW

Code: Select all

download $UPDLINK/configs/vercheck.txt $TMPDIR

echo
[ ! -e $TMPDIR/vercheck.txt ] && fatality "$SCRIPT $FUNCNAME $LINENO" "`gettext "Could not download file:"`" "vercheck.txt"
RDBVER=`awk -F"=" /DBVER/'{print$NF}' $TMPDIR/vercheck.txt`
RUSMVER=`awk -F"=" /USMVER/'{print$NF}' $TMPDIR/vercheck.txt`

echo RDBVER=$RDBVER
echo DBVER=$DBVER
echo ls $TMPDIR
ls $TMPDIR
echo

if [ $RDBVER -gt $DBVER ]; then

Code: Select all

root@porteus:/home/guest# cp -u -v funcupdateDatabase /usr/share/usm
‘funcupdateDatabase’ -> ‘/usr/share/usm/funcupdateDatabase’
root@porteus:/home/guest# usm -u usm
Downloading: vercheck.txt  DONE

RDBVER=140816
DBVER=
ls /tmp/usm.P6vL9R
filelist	   sbo-categories.tmp  searchType  vercheck.txt  welcome.bak
help-pkgtools.tmp  sbocategs	       term1.tmp   welcome

/usr/share/usm/funcupdateDatabase: line 344: [: 140816: unary operator expected
No database updates were found.

/usr/share/usm/funcupdateDatabase: line 357: [: 140821: unary operator expected
You have the current USM version.

root@porteus:/home/guest# 
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: USM Unified Slackware Package Manager

Post#272 by Bogomips » 22 Aug 2014, 19:57

brokenman wrote:In your nonstandard setup please give output of: md5sum /etc/usm/usm.conf p10/Por/usm.conf
Have standard setup, except for bind on /var/usm and /tmp/usm.

Code: Select all

guest@porteus:~$ md5sum p10/Por/usm.conf
9700327a8b316ad2897b941d9367856b  p10/Por/usm.conf
is irrrelevant because

Code: Select all

guest@porteus:~$     awk -F= '/DBDIR/{print$NF}' p10/Por/usm.conf
/home/guest/p10/Por/var/usm
# The mirror files are stored in ${DBDIR}/mirrors-distro.txt
guest@porteus:~$     awk -F= '/STORAGE/{print$NF}' p10/Por/usm.conf
/home/guest/p10/Por/tmp/usm
brokenman wrote:please give output of: md5sum /etc/usm/usm.conf

Code: Select all

guest@porteus:~$ md5sum /etc/usm/usm.conf
829c2664e6e5de136f03e70cd7c18b6c  /etc/usm/usm.conf
However what is of interest, is it seems the config file version number has remained unchanged, bearing in mind the dates of the files:

Code: Select all

guest@porteus:~$     awk -F= '/USMVER/{print$NF}' /etc/usm/usm.conf
3.1.4
140816
guest@porteus:~$ ls -l p10/Por/usm.conf
-rw-r--r-- 1 root root 3187 Aug 11 15:17 p10/Por/usm.conf
guest@porteus:~$     awk -F= '/USMVER/{print$NF}' p10/Por/usm.conf
3.1.4
140804
Don't see why version has to be in config file, and why an include file to hold the version number isn't used.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#273 by brokenman » 22 Aug 2014, 20:57

@Bogomips
In an earlier post you gave the output:

Code: Select all

root@porteus:/home/guest# diff p10/Por/usm.conf /etc/usm
15c15
< DBDIR=/home/guest/p10/Por/var/usm
---
> DBDIR=/var/usm
23c23
< STORAGE=/home/guest/p10/Por/tmp/usm
---
> STORAGE=/tmp/usm
This is odd. Two config files. This is where I am confused.

When I bind mount the config directory somewhere and diff the usm.conf file there is no difference (expected behaviour) since the paths are bound.
root@porteus:/# mount --bind /etc/usm/ /mnt/bound/
root@porteus:/# diff /mnt/bound/usm.conf /etc/usm/usm.conf

If I ask for the output of a file in a certain path, please follow the instructions to the letter. Once again /etc/usm/usm.conf is a hard coded value so USM is not even going to look at your p10/Por directory. You can bind it for whatever purpose you like but USM won't care about your bind.

Here is the md5sum of the unchanged v3.1.5 usm.conf: 642fd67595b728e2a7f2e96ab09e989d

@Ed_P
Have you looked at this script?
Yes. funcupdateDatabase is looking for a file that isn't there for whatever reason. It is expecting a number (the database version) which is not returning a value, hence the error.
root@porteus:/home/guest# ls /tmp/usm/vercheck.txt
/bin/ls: cannot access /tmp/usm/vercheck.txt: No such file or directory
Expected output.
root@porteus:/home/guest# md5sum /etc/usm/usm.conf p10/Por/usm.conf
9a9ccd2cdefb649e6c4801814c981bd8 /etc/usm/usm.conf
Apart from including p10/Por/usm.conf (which is a path only on Bogomips computer) the md5sum shown is not that of the untouched v3.1.5 usm.conf file.

I am not sure what you mean by your next code tag. It shows code from USM. Looks fine.
root@porteus:/home/guest# cp -u -v funcupdateDatabase /usr/share/usm
‘funcupdateDatabase’ -> ‘/usr/share/usm/funcupdateDatabase’
root@porteus:/home/guest# usm -u usm
Downloading: vercheck.txt DONE

RDBVER=140816
DBVER=
Again I don't know why you have copied a file from /home/guest into /usr/share/usm. Means nothing to me. Also the next output of RDBVER=140816 and DBVER= ... where is this from? It is certainly incorrect. Did you even try my suggestion to fix your problem? Until you start a new clean savefile (without running any of your custom cleanup scripts on it) and test USM again I am not really interested in any of your output. I simply can not troubleshoot a problem that I (nor anyone else) can not reproduce. It is just noise in this thread. I understand you want to troubleshoot this, but you are not showing any sign of following suggestions and I can not reproduce this problem which may be because of your current changes file.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8087
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: USM Unified Slackware Package Manager

Post#274 by Ed_P » 22 Aug 2014, 21:17

brokenman wrote:I am not sure what you mean by your next code tag. It shows code from USM. Looks fine.
It shows the additional code I added to the script to help debug the problem.
root@porteus:/home/guest# cp -u -v funcupdateDatabase /usr/share/usm
‘funcupdateDatabase’ -> ‘/usr/share/usm/funcupdateDatabase’
root@porteus:/home/guest# usm -u usm
Downloading: vercheck.txt DONE

RDBVER=140816
DBVER=
Again I don't know why you have copied a file from /home/guest into /usr/share/usm. Means nothing to me. Also the next output of RDBVER=140816 and DBVER= ... where is this from?
When I find the file in guest mode with spaceFM and edit it with LeafPad I can not save it in /usr/share/usm/ directory, so I save it in /home/guest/ then using root mode in LXTerminal I copy it to where it belongs. The displays from the code I added show why the lines in error in your script are failing.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#275 by brokenman » 22 Aug 2014, 21:34

Ok. Try not to add anything uncommented to a code output. It looks like output from a console otherwise. Also it would help if you actually explain what you are doing to get the output instead of just putting 'FWIW'. Now that you have said what's going on I can see the progression and as I stated, the script is choking because it is expecting to get a DBVER= variable and it is not getting one. This leads us back to step one and my previous post.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8087
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: USM Unified Slackware Package Manager

Post#276 by Ed_P » 23 Aug 2014, 03:22

brokenman wrote:the script is choking because it is expecting to get a DBVER= variable and it is not getting one. This leads us back to step one and my previous post.
I see no code in funcupdateDatabase that sets the DBVER variable. The vercheck.txt file that gets downloaded contains a value for it.

Code: Select all

cat /tmp/usm.pvL4eW/vercheck.txt
USMVER=140821
DBVER=140816
And the script sets the RDBVER and RUSMVER variables from them but I don't see the DBVER variable being set.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#277 by brokenman » 23 Aug 2014, 04:20

I see no code in funcupdateDatabase that sets the DBVER variable.
I'm not at all surprised.

Look. You haven't followed any of my instructions. You refuse to take any advice to resolve your problem. If the problem was related to the code not setting these variables then NOBODY would be able to update. Simple as that. I will repeat what I said in my above post, and until this is done will ignore your posts.

Until you start a new clean savefile (without running any of your custom cleanup scripts on it) and test USM again I am not really interested in any of your output.

Tonight I have wasted a lot of valuable time testing with the changes=EXIT cheatcode and simply can NOT reproduce your problem. C'mon .... Really .... you struggled to find the help dialog for the 'ls' command and now you are pulling apart the USM code and showing me what is wrong? :wall: I am a patient man, but you have pushed me to the limit.

The DBVER variable is clearly set in the usm.conf file that you have shown here numerous times. It is the the part that says DBVER=XXXX and it is sourced in the /usr/bin/usm file.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8087
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: USM Unified Slackware Package Manager

Post#278 by Ed_P » 23 Aug 2014, 06:08

brokenman wrote:Until you start a new clean savefile (without running any of your custom cleanup scripts on it) and test USM again I am not really interested in any of your output.
I am not going to delete everything and start fresh everytime you create a new USM or a minor Porteus version. I shouldn't have to nor should anyone else. This isn't Windows, I shouldn't have to always reboot or reinstall the OS to fix problems.
you struggled to find the help dialog for the 'ls' command
I did not. I pointed out an error in your perfect code, '-help' is not an invalid 'e' or whatever the error msg said. It's an invalid 'option'.

BTW I'll let you find the error in this /usr/share/usm/<README> file's line #2

Code: Select all

# Copyright (C) 20013-2020 Jay Flood
The DBVER variable is clearly set in the usm.conf file that you have shown here numerous times. It is the the part that says DBVER=XXXX and it is sourced in the /usr/bin/usm file.
Yup, and I have a usm.conf file in my /etc/usm/ directory, so why isn't it being read and an error msg indicating why it isn't?

Code: Select all

guest@porteus:~$ ls -l /etc/usm/*.conf
-rw-r--r-- 1 root root  947 Aug  4 19:11 /etc/usm/files.conf
-rw-r--r-- 1 root root 3137 Aug 17 23:02 /etc/usm/usm.conf

Code: Select all

# usm.conf - Configuration for Unified Slackware Manager (usm)
#

# Resolve dependencies for all packages
# Set this to true or false (never uncomment this)
RESOLVE=true

# The automatice update check that is made when internet
# is accessed. This update check doubles as a check that
# you have internet access before downloading packages.
# Set to false to disable update check.
AUTOCHECK=true

# Storage of database files (e.g PACKAGES.TXT)
DBDIR=/var/usm
:
etc.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#279 by brokenman » 23 Aug 2014, 10:15

I am not going to delete everything and start fresh everytime you create a new USM or a minor Porteus version
No they shouldn't, and nobody asked you to. I simply asked you to start with a fresh one so we can begin trouble shooting. But is seems you have no interest in finding your problem. Rather pointing the finger. I'm done. You refuse to help yourself.

EDIT: I could fix your savefile in about 2 minutes, but unfortunately you choose to argue and therein to suffer. If you don't follow my instruction (but of course you know better don't you) then stop posting useless crap in this thread. BTW, when you finally get ls --help working then read it. Then you will see why it gives that error. Or complain that the error is in the code, your choice.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: USM Unified Slackware Package Manager

Post#280 by Bogomips » 23 Aug 2014, 14:53

Running always fresh with cpy2ram => Starting each session with unsullied v3.0.1 and pristine /etc/usm/usm.conf, confirmed by:

Code: Select all

root@porteus:/home/guest# md5sum /etc/usm/usm.conf
e5e1c41e8864e0aa7549dcfc71404fba  /etc/usm/usm.conf

guest@porteus:~$ ls -l /tmp/usm/usm*.txz
-rw-r--r-- 1 root root 61576 Aug  5 04:43 /tmp/usm/usm-latest-0.0-noarch-1.txz
guest@porteus:~$ tar xJf /tmp/usm/usm-latest-0.0-noarch-1.txz -C /mnt/sda1/Por/usm
guest@porteus:~$ md5sum /mnt/sda1/Por/usm/etc/usm/usm.conf
e5e1c41e8864e0aa7549dcfc71404fba  /mnt/sda1/Por/usm/etc/usm/usm.conf
root@porteus:/home/guest# usm -v
 You are using USM version:  3.1.4
Then removing old package, followed by updating:

Code: Select all

guest@porteus:~$ mv /tmp/usm/usm-latest-0.0-noarch-1.txz p10/Por
guest@porteus:~$ ls /tmp/usm/usm*.txz
/bin/ls: cannot access /tmp/usm/usm*.txz: No such file or directory
root@porteus:/home/guest# usm -u usm
Downloading: vercheck.txt  DONE

 An update is available for the usm database files.
 Please run:  usm -u all 

 A new version of USM is available.
 Would you like to download it now? [y/n]
Downloading: usm-latest-0.0-noarch-1.txz  DONE
...
  Installing new version now 
usm-latest-0.0-noarch-1:                                                 [320K]

 USM was updated successfully
 You are currently using:
 USM-v3.1.5 

root@porteus:/home/guest# md5sum /etc/usm/usm.conf
642fd67595b728e2a7f2e96ab09e989d  /etc/usm/usm.conf

guest@porteus:~$ ls -l /tmp/usm/usm*.txz
-rw-r--r-- 1 root root 62280 Aug 22 04:14 /tmp/usm/usm-latest-0.0-noarch-1.txz
might be relevant if nothing has changed in the meantime.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

tome
Contributor
Contributor
Posts: 670
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: against russian attacks
Contact:

Re: USM Unified Slackware Package Manager

Post#281 by tome » 24 Aug 2014, 17:53

Some possibilities for usm:

1. Add "Would you like to install downloaded packages to user defined place (y) (installpkg --root $instpath), to another place (a) or skip (n)? [y/a/n]" question.
--> add $instpath variable to usm.conf.
(easier to build customized modules)
2. Do any trick to keep settings between updates (usm.conf)
3. Add/change "Would you like to create subfolder for the files (y), subfolder with links to the files (a) or skip (n)? [y/a/n]"
(no large duplicates, but easier way to install all dependencies))
4. Add update local/libs.txt (maybe not usefull)
5. Add light database mode (Maybe I'm wrong but I think the largest MANIFEST files are not necessary to download).
6. If usm -s and usm -g are not the same brokenman must update database often, but probably it could be option, tip (open ... and edit wrong line: 0.0.9 to 0.0.10 to solve version problem) or question: Serched package is newer than in your database (v. 0.0.9 vs 0.0.10) "Would you like to treat these update as insignificant/minor_update (the same dependecies) and proceed?" or another trick to solve this issue.
You have mind and feelings. Be wise and clever.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#282 by brokenman » 24 Aug 2014, 21:33

Thanks for your input tome. Some excellent points that I had been planning on addressing in future versions.
1. Add "Would you like to install downloaded packages to user defined place (y) (installpkg --root $instpath), to another place (a) or skip (n)? [y/a/n]" question.
--> add $instpath variable to usm.conf.
Can add this.
2. Do any trick to keep settings between updates (usm.conf)
Perhaps allow a custom path for usm.conf (it is hard coded at the moment) so it isn't clobbered by updates. This would mean moving version control out of this file (Bogomips touched on this earlier)
3. Add/change "Would you like to create subfolder for the files (y), subfolder with links to the files (a) or skip (n)? [y/a/n]"
(no large duplicates, but easier way to install all dependencies))
A little tricky but a possibility
4. Add update local/libs.txt (maybe not usefull)
It is run every time USM is run. In the CLI this is often but in GUI it is whenever GUI is started. Potential for improvement there.
5. Add light database mode (Maybe I'm wrong but I think the largest MANIFEST files are not necessary to download).
The MANIFEST file can be deleted after download. The file OPTIFEST is created from the MANIFEST file. I created OPTIFEST (optimized manifest) because MANIFEST is so large. I left MANIFEST in place for now because I wasn't sure if future features would require this file and didn't want to reintroduce a huge file.
6. If usm -s and usm -g are not the same brokenman must update database often, but probably it could be option, tip (open ... and edit wrong line: 0.0.9 to 0.0.10 to solve version problem) or question: Serched package is newer than in your database (v. 0.0.9 vs 0.0.10) "Would you like to treat these update as insignificant/minor_update (the same dependecies) and proceed?" or another trick to solve this issue.
I think you are referring to the ambiguous message "FATAL error LIBS.TXT not found" when the slackware database is newer than the local database. I am addressing this problem with a nicer message. This is proving to be more difficult than I had anticipated.
Last edited by brokenman on 24 Aug 2014, 21:36, edited 1 time in total.
Reason: Typo
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#283 by brokenman » 27 Aug 2014, 13:52

The following options have been added and pushed to github for inclusion in next release. Still working on the others.

1) Added option to install package/s after download for CLI only. Custom paths are supported.
2) Moved version check out of usm.conf and allowed custom config file so it doesn't get clobbered during updates. You can use /etc/usm/usm-custom.conf for custom config files.
- Still need to update the GUI editor for this so it copies edited config to usm-custom.conf
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: USM Unified Slackware Package Manager

Post#284 by brokenman » 28 Aug 2014, 02:28

3) Symlinks are now added by default (instead of downloading duplicate package) if a package is found anywhere in $STORAGE. This behaviour can be turned off in usm.conf
5) update of database now removes the large MANIFEST file. It saves 100Mb but means limited scope for additional features.
6) Added more verbose error message when local and remote databases do not match (when I need to update USM database).

Updates were pushed to github and will be available in the next release. (probably this weekend)
How do i become super user?
Wear your underpants on the outside and put on a cape.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: USM Unified Slackware Package Manager

Post#285 by Bogomips » 28 Aug 2014, 18:34

brokenman wrote:3) Symlinks are now added by default (instead of downloading duplicate package) if a package is found anywhere in $STORAGE. This behaviour can be turned off in usm.conf
This is not clear.
  1. Does this mean a package cannot be moved from $STORAGE?
  2. This behaviour can be turned off in custom usm.conf file presumably?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply