@brokenman
i dont really get the idea of "folder structure"....
let's say that user downloaded all modules to the local repo and now he would like to move pidgin + deps to /porteus/modules to get it activated during boot automatically. does he need to keep the same folder structure as in local repo?
more:
in case of removing pidgin from /porteus/modules: does he need to read .req file and track deps (in this case: enchant-2.2-i486-1.xzm and libpidgin-poo-i486-1.xzm) manually?
what if a dep is required by a second module?
how he will know to which folder (internet, libs, multimedia) put certain module back?
my proposition:
i think porteusmodman could be integrated with PPM with menu called "Remove module". user should get a list of modules which currently resides in /porteus/modules and after making a choice PPM should check if selected xzm is not required by other modules, then deactivate it (if activated) and move to /porteus/optional (or local repo).
i see it like that:
1) all modules resides in one folder (local repo or /porteus/optional, user can decide)
2) every module has /var/porteus/*info* file inside (external .req could be placed on the server only to simplify the process) with two categories:
a) provides: (list of libs which are included in the xzm)
b) requires: (list of reqired deps)
SAMPLE of pidgin-xyz.info:
Code: Select all
PACKAGE NAME: pidgin-xyz
PROVIDES: lib-A lib-B lib-C
REQUIRES: lib-D lib-Y lib-Z
3) during removal of for example "pidgin-xyz.xzm" PPM checks if libs included in "provides" category for pidgin-xyz.info are not listed in "requires" of every other module. all /var/porteus/*info* files from every module (other than pidgin) must be extracted to temporary folder (/tmp/porteus?). not sure if unsquashfs supports extracting of certain files only so it would have to be "mloopped" first. and then simple function should do the job:
Code: Select all
cd /tmp/porteus
for x in `grep PROVIDES pidgin-xyz.info | cut -d: -f2-`; do
modules=`ls *.info"
for y in $modules; do
required=`grep $x $y | egrep -v 'PACKAGE NAME:|PROVIDES:'
if [ "required" ]; then
echo "Pidgin-xyz cant be deactivated/removed from /porteus/modules as it's required by $y. do you want to remove y$ as well?"
bla bla bla...
fi
done
done
4) if libs provided with pidgin-xyz module are not required by any other app in /porteus/modules then it gets moved to /porteus/optional (or local repo)
5)
same story with activation:
PPM checks pidgin-xyz.info for REQUIRED and all other modules for PROVIDES. once requirements are met all xzm's are moved from /porteus/optional to /porteus/modules and activated.
One downside mentioned in my previous post:
- all activations/removals must be done through PPM
if my proposition gets accepted then we would have adding/removing sorted out. only upgrading left
Cheers
Please add [Solved] to your thread title if the solution was found.