LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackpkg vs. third-party package repository (https://www.linuxquestions.org/questions/slackware-14/slackpkg-vs-third-party-package-repository-4175427364/)

phenixia2003 09-24-2016 04:55 AM

Hello,

Quote:

Originally Posted by zerouno (Post 5609295)
may be an idea, but 'include' instead of 'incl'

yes, include is good.

Quote:

Originally Posted by zerouno (Post 5609295)
I think that we should to start the develop in devel branch, starting from slackpkg+-1.7.0d0-noarch-4mt.txz, unless it is a bug fix.

Ok.

Quote:

Originally Posted by gegechris99 (Post 5609297)
Code:

PKGS_PRIORITY=( patches:.* slackpkgplus:.* restricted:.* mled:.* )

Note that to give priority to an entire repository, you can use repository instead of repository:.*. So, your PKGS_PRIORITY could be :
Code:

PKGS_PRIORITY=( patches slackpkgplus restricted mled )
--
SeB

gegechris99 09-24-2016 09:52 AM

Quote:

Originally Posted by phenixia2003 (Post 5609452)
Note that to give priority to an entire repository, you can use repository instead of repository:.*. So, your PKGS_PRIORITY could be :
Code:

PKGS_PRIORITY=( patches slackpkgplus restricted mled )

Done. Thanks.

zerouno 10-02-2016 08:58 AM

I've just released a development release, with only SBo search and minor things.
ASAP I will check and apply the proposed patches.

zerouno 10-02-2016 12:15 PM

I'm trying the patches.

I never used templates, so I know it just now.

I see that we never managed slackpkg remove <repository>:<package>
Code:

  if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] || [ "$CMD" == "remove" ] ; then
...
...

      # You can specify 'slackpkg install reponame:packagename'
      elif echo "$pref" | grep -q "^[-_[:alnum:]]\+[:][a-zA-Z0-9]\+" ; then

        if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] ; then
...
        fi

without an 'else' statement.

If you run slackpkg remove <repository>:<package> slackpkg tells
Code:

Looking for . .. in package list. Please wait...
and remove ALL packages :)

It's simple to solve, but what do you think:
1) slackpkg return an error since removing a package from a given repository may have no sense
2) slackpkg uninstall the package only if the package exists in pkglist and is present in the specified repository (if you specify a repository it should match and if the package is not present in specified repository it should not remove it)
3) slackpkg ignore the repository and remove the package

I tell that becouse I saw that using remove-template seems that if a package is not in pkglist it will be not removed, but if it is present in a different repository it will be removed.

What do you think?

In effect I don't know why remove-template (in core-functions) calls givepriority.


I do not finished to analyze all.

phenixia2003 10-02-2016 12:57 PM

Hello,

Quote:

Originally Posted by zerouno (Post 5612790)
I'm trying the patches.

I never used templates, so I know it just now.

I see that we never managed slackpkg remove <repository>:<package>
Code:

  if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] || [ "$CMD" == "remove" ] ; then
...
...

      # You can specify 'slackpkg install reponame:packagename'
      elif echo "$pref" | grep -q "^[-_[:alnum:]]\+[:][a-zA-Z0-9]\+" ; then

        if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] ; then
...
        fi

without an 'else' statement.

If you run slackpkg remove <repository>:<package> slackpkg tells
Code:

Looking for . .. in package list. Please wait...
and remove ALL packages :)

It's simple to solve, but what do you think:
1) slackpkg return an error since removing a package from a given repository may have no sense
2) slackpkg uninstall the package only if the package exists in pkglist and is present in the specified repository (if you specify a repository it should match and if the package is not present in specified repository it should not remove it)
3) slackpkg ignore the repository and remove the package

With remove-template supporting syntax R:P, I would say (2) for consistency purpose.


Quote:

Originally Posted by zerouno (Post 5612790)
I tell that becouse I saw that using remove-template seems that if a package is not in pkglist it will be not removed, but if it is present in a different repository it will be removed.

This might be a bug in remove-template with enhanced syntax. Could you give an example ?.

Quote:

Originally Posted by zerouno (Post 5612790)
In effect I don't know why remove-template (in core-functions) calls givepriority.

I was also surprised of that when I wrote that patch, but, I think this is for factorization purpose. When givepriority() != "", that means there's a package in the repositoriy (ie. pkglist) that matches the pattern, and the returned value is the fullname of that package.


--
SeB

phenixia2003 10-03-2016 02:47 AM

Hello,

Quote:

Originally Posted by zerouno (Post 5612790)
I tell that becouse I saw that using remove-template seems that if a package is not in pkglist it will be not removed, but if it is present in a different repository it will be removed.

Indeed. I looked at the patch I sent and didn't find anything wrong. However, I checked remove-template case in makelist() and, now I understand the issue you encounter.

In fact, when I wrote the patch, I've read too fast the remove-template case in makelist (in core-functions.sh). As opposed to what I assumed, this part of code does not search the fullname returned by givepriority() in tmplist, but only the basename :

Code:

remove-template)
  for i in $INPUTLIST ; do
    givepriority $i
    [ ! "$FULLNAME" ] && continue
    grep -q " ${NAME} " ${TMPDIR}/tmplist && \
        LIST="$LIST ${FULLNAME}"
  done
;;

I don't see a way to circumvent that without an entire rewrite of remove-template case...

--
SeB

zerouno 10-03-2016 03:11 AM

mmm
if I understood the code, should be sufficient to modify, in givepriority,
Code:

+      if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+              WORKING_PRIORITY=( "${ARGUMENT}" ${PRIORITY[@]} )
+      else
+              WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" ${PRIORITY[@]} )
+      fi

with
Code:

+      if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+              WORKING_PRIORITY=( "${ARGUMENT}" )
+      else
+              WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" )
+      fi

or similar, so to force givepriority to search in specified repository only.
If it is not found the statement
Code:

    [ ! "$FULLNAME" ] && continue
provide force skip the package.

But I've not tested it.

phenixia2003 10-03-2016 03:30 AM

Hello,

Quote:

Originally Posted by zerouno (Post 5613042)
mmm
if I understood the code, should be sufficient to modify, in givepriority,
Code:

+      if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+              WORKING_PRIORITY=( "${ARGUMENT}" ${PRIORITY[@]} )
+      else
+              WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" ${PRIORITY[@]} )
+      fi

with
Code:

+      if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+              WORKING_PRIORITY=( "${ARGUMENT}" )
+      else
+              WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" )
+      fi

or similar, so to force givepriority to search in specified repository only.
If it is not found the statement
Code:

    [ ! "$FULLNAME" ] && continue
provide force skip the package.

But I've not tested it.

Well done. I did some tests, and all is ok so far with this (simple) change.

--
SeB

zerouno 10-03-2016 04:02 AM

Just a thing about slackware stable.
If the template contains slackware:mozilla-thunderbird at creation time, when I run install-template or remove-template I can found it in patches repository. So I think that slackware{,64} and patches should be considered as the same thing.

zerouno 10-03-2016 12:57 PM

this should solve (for template)

Code:

    if [[ "$CMD" == "install-template" || "$CMD" == "remove-template" ]] && [[ "$ARGUMENT" =~ .*:.* ]] ; then
      if echo "$ARGUMENT" | grep -qE "^(slackware|slackware64|patches):" ; then
        WORKING_PRIORITY=( $(echo ${PRIORITY[*]}|grep -ow -e slackware -e slackware64 -e patches) )
      elif echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
        WORKING_PRIORITY=( "${ARGUMENT}" )
      else
        WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" )
      fi
      ARGUMENT=$(echo $ARGUMENT | cut -f2 -d":")
    fi

it's the only 'elegant' :) and little solution I found.
If the template contains 'slackware64:libidn', slackpkg remove-template does show libidn-1.33-x86_64-1_slack14.2 on my system

a similar thing for slackpkg remove

I think that
Code:

      elif echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
should be
Code:

      elif echo "$ARGUMENT" | grep -qE "(^$SLACKDIR_REGEXP):|(^SLACKPKGPLUS_)" ; then
otherwise it does match if ARGUMENT="slackware-repo:mypackage" (since we accept the minus symbol in repository name), and does not match if ARGUMENT="SLACKPKGPLUS_repository:mypackage"


Also we can think that a template generated in slackware64 may work for slackware32 and viceversa, so the template should not contain 'slackware64:libidn' but 'slackware:libidn' and slackpkg+ should convert it to slackware64 when needed.
What do you think?

phenixia2003 10-03-2016 01:16 PM

Hello,

Quote:

Originally Posted by zerouno (Post 5613042)
Code:

+      if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+              WORKING_PRIORITY=( "${ARGUMENT}" )
+      else
+              WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" )
+      fi


This code does not work as well as I thought. In case you have a template with slackware64:mozilla-firefox and firefox from patches installed, then, slackpkg remove-template selects firefox from slackware64 instead of ignoring it :
Code:

$cat /etc/slackpkg/templates/test.template
slackware64:mozilla-firefox

$ ls /var/log/packages/*firefox*
/var/log/packages/mozilla-firefox-45.4.0esr-x86_64-1_slack14.2

$ slackpkg -dialog=off -batch=on -default_answer=no remove-template test
Looking for packages in "test" template to remove. Please wait...DONE

mozilla-firefox-45.2.0esr-x86_64-1.txz

Total package(s): 1

Do you wish to remove-template selected packages (Y/n)? y

Package: mozilla-firefox-45.2.0esr-x86_64-1.txz
        Removing...

No such package: /var/log/packages/mozilla-firefox-45.2.0esr-x86_64-1. Can't remove.

For consistency purpose, remove-template must strictly follow the rules defined in the template:
  • For each rule R:P in a template T, if package P from R is not installed, slackpkg must ignore the rule.
  • For each rule P in a template T, if there's a repository R which includes P, and there's an installed package that matches, it must be removed, otherwise, slackpkg must ignore the rule.

To achieve this, I don't think it's a good idea to modify givepriority() again. The best would be to export in slackpkg+ the code from makelist() which handles "remove-template" as I suggested previously, and more precisely as below :

Code:

remove-template)
  for i in $INPUTLIST ; do
    givepriority $i
    [ ! "$FULLNAME" ] && continue
    grep -q " ${FULLNAME} " ${TMPDIR}/tmplist && \
        LIST="$LIST ${FULLNAME}"
  done
;;

Quote:

Originally Posted by zerouno (Post 5613051)
Just a thing about slackware stable.
If the template contains slackware:mozilla-thunderbird at creation time, when I run install-template or remove-template I can found it in patches repository. So I think that slackware{,64} and patches should be considered as the same thing.

This will introduce inconsistencies. If I generate or wrote a template which includes "slackware64:some_package", that means I want some_package from slackware64, not from patches (even if, mostly, it is better to install patches), which, anyway, can be installed later.

The same way as for remove-template, install-template must strictly follow the rules defined in the template:
  • For each rule R:P in a template T, slackpkg must install the package P from repository R, regardless the version of P found in any other repositories.
  • For each rule P in a template T, slackpkg must install the version of P found in supported repositories according to priorities defined in slackpkgplus.conf


--
SeB

zerouno 10-03-2016 03:20 PM

I think that there is no reason, when I install a package, to explicitly choose 'patches' or 'slackware' repository.

In effect in a template the 'patches' repository should not be mentioned since
1) in the template is not specified the package version
2) patches is a subset of official slackware repository

Also, when I generate a template, slackpkg does not know if an installed package is a patch or a main repository, but only in which repository the package is present according with the PRIORITY configuration.

I think that we can't consider the 'patches' repository as another repository.


Consider this steps running in a pure 14.2 installation:
# slackpkg generate-template mytemplate
# slackpkg upgrade-all
# slackpkg remove-template mytemplate

all patched packages will not be removed.

# slackpkg upgrade-all
# slackpkg generate-template mytemplate
after some month run this on a new system
# slackpkg install-template

It will install some unpatched packages so next I have to run slackpkg upgrade-all

Instead, the repository 'slackware' should be considered as the sum of slackware+patches.

Without slackpkg+, slackpkg generate-template do not consider if you have installed or will install/remove a patch or an original packages, and I think that this is the correct behavior. Also without slackpkg+ a template working with slackware 64bit does work on a 32bit installation and viceversa.

Another idea is that generate-template could add R:P only for non official packages, but I'm not sure.

For the makelist() question, it is a large function and the core of slackpkg.
Override this function change a lot of things.
I don't know if it is a good idea. Also it does not solve the problem of remove-template since the problem is a conceptual problem.

phenixia2003 10-04-2016 03:56 AM

Hello,


Quote:

Originally Posted by zerouno (Post 5613354)
Another idea is that generate-template could add R:P only for non official packages, but I'm not sure.

Might be the solution. All other packages will be selected according to the defined priorities.

However, since users could want to write templates by hand, install-template must support syntax R:P for all packages.

Quote:

Originally Posted by zerouno (Post 5613354)
For the makelist() question, it is a large function and the core of slackpkg.
Override this function change a lot of things.
I don't know if it is a good idea.

I was talking about to extract the code related to remove-template in makelist(), not to override this function. I extracted some code from this function to add support of syntax "R:P" in "slackpkg blacklist <pattern>"

Quote:

Originally Posted by zerouno (Post 5613354)
Also it does not solve the problem of remove-template since the problem is a conceptual problem.

This is not a conceptual issue. Currently, remove-template check the basename in tmplist instead of fullname, which leads to suggest the wrong package. If you have a template with "alienbob:ffmpeg" while you have ffmpeg from mleddesktop installed, remove-template selects ffmpeg from alienbob :

Code:

$ slackpkg -dialog=off -default_answer=yes -batch=on remove-template test
Looking for packages in "test" template to remove. Please wait...DONE

ffmpeg-3.1.1-x86_64-1alien.txz

Total package(s): 1

Do you wish to remove-template selected packages (Y/n)? y

Package: ffmpeg-3.1.1-x86_64-1alien.txz
        Removing...

No such package: /var/log/packages/ffmpeg-3.1.1-x86_64-1alien. Can't remove.

--
Seb

zerouno 10-04-2016 10:48 AM

Ah, ok.

Well, I think that we can proceed with the specifications that install-template and remove-template support both R:P and P, and generate-template does generate a template with slackware/slackware64/patches stripped by default.
If the user need it, he can edit the template.

nk_ 10-08-2016 01:23 PM

Hi, zerouno and phenixia2003
can you help me, I don't know why packages not found with this actions:

slackpkgplus.conf
Code:

SLACKPKGPLUS=on
VERBOSE=1
ALLOW32BIT=off
USEBL=1
WGETOPTS="--timeout=20 --tries=2"
SEARCH_CLOG_INPARENT=on
CACHEUPDATE=off
GREYLIST=on
SENSITIVE_SEARCH=on
WW_FILE_SEARCH=on
SHOWORDER=package
DETAILED_INFO=none
STRICTGPG=on

TAG_PRIORITY=off

REPOPLUS=( slackpkgplus alien alien_restricted )

MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

Code:

# slackpkg update
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

The list below shows all packages with name matching "vlc".

[ Status          ] [ Repository              ] [ Package                                  ]
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien         
  uninstalled              alien                        vlc-2.2.4-x86_64-1alien                 
  uninstalled(masked)      alien_restricted            npapi-vlc-20160706-x86_64-1alien         
  uninstalled(masked)      alien_restricted            vlc-2.2.4-x86_64-1alien                 

You can search specific files using "slackpkg file-search file".

Code:

# slackpkg install vlc-2.2.4
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

The list below shows all packages with name matching "vlc".

[ Status          ] [ Repository              ] [ Package                                  ]
  installed              alien                        vlc-2.2.4-x86_64-1alien                 
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien         
  uninstalled(masked)      alien_restricted            npapi-vlc-20160706-x86_64-1alien         

You can search specific files using "slackpkg file-search file".

# ls /var/log/packages/ | grep vlc
vlc-2.2.4-x86_64-1alien

Where are in search vlc package from alien repository (vlc-2.2.4-x86_64-1alien)?

Code:

# removepkg vlc
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

The list below shows all packages with name matching "vlc".

[ Status          ] [ Repository              ] [ Package                                  ]
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien         
  uninstalled              alien                        vlc-2.2.4-x86_64-1alien                 
  uninstalled(masked)      alien_restricted            npapi-vlc-20160706-x86_64-1alien         
  uninstalled(masked)      alien_restricted            vlc-2.2.4-x86_64-1alien                 

You can search specific files using "slackpkg file-search file".

Try with
slackpkg+-1.7.0-noarch-4mt
slackpkg+-1.7.0-noarch-3mt


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