converting .txz files into .xzm for a whole folder

For discussions about programming and projects not necessarily associated with Porteus.

converting .txz files into .xzm for a whole folder

Postby francois » 28 Feb 2015, 03:07

I am trying to convert .txz files into .xzm for a whole folder. Here is my bash file (please do not laugh or if you do read out loud) :wink: :

Code: Select all
#!/bin/bash

for i in *.txz
do
   if [ "${i}" == "*.txz" ]
   then
        /opt/porteus-scripts/txz2xzm ${i} ${i}.xzm
   fi
done
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby francois » 28 Feb 2015, 04:20

OK! Got it. I will name it dir-txz2xzm

Code: Select all
#!/bin/bash
#just cd /directory-with-txz
#then type dir-txz2xzm

for i in *.txz
do
/opt/porteus-scripts/txz2xzm $i $i.xzm
done
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby francois » 28 Feb 2015, 04:36

Exciting lets do the dir-activate:
Code: Select all
#!/bin/bash
#will activate porteus modules of a whole directory

for i in *.xzm
do
/opt/porteus-scripts/activate $i.xzm
done
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby fanthom » 28 Feb 2015, 21:30

isnt it easier to run:
Code: Select all
activate /path/*

should also work for txz2xzm.
Please add [Solved] to your thread title if the solution was found.
User avatar
fanthom
Site Admin
Site Admin
 
Posts: 4478
Joined: 28 Dec 2010, 03:42
Location: Poland, currently - Cork, IE
Distribution: Porteus Kiosk

Re: converting .txz files into .xzm for a whole folder

Postby francois » 01 Mar 2015, 00:57

As you say: a lot more easy. Glad to know it now.

Thanks.
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby francois » 17 Apr 2015, 19:01

@fanthom:
Would there be some command for merging modules from a directory into a bundle?
Thanks.
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby ncmprhnsbl » 17 Apr 2015, 23:35

Two commands basicly, 1.extract all xzm to a directory, 2. build a module from that directory
Code: Select all

   xzm2dir <list xzms> <directoryname>

       dir2xzm <directoryname>  <name>.xzm


which you probly already know ;)
have a look here: https://github.com/ncmprhnsbl/openbox/b ... x-build.sh
this is just an adaption from the xfce desktop module
this script basicly
1. installs txzs to directory,
2. extract xzms to same
3. copy configuration directories to that
4. runs some scripts on it(removing stuff,applying patches)
5.builds a module
with some extra stuff to automate the listing of xzms etc..
also freestyler made a gui for merging mergexzm - merge folder of modules and slack packages
not sure if his link working...
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
 
Posts: 641
Joined: 20 Mar 2012, 04:42
Location: australia
Distribution: 3.2.2-64bit xfce/openbox

Re: converting .txz files into .xzm for a whole folder

Postby francois » 18 Apr 2015, 00:25

@ncmprhnsbl :
which you probly already know

I had the impression that it could be done this way or something like it. Its nice to have someone provide the solution for your eyes to the tip of your fingers once and a while.

Thanks so much. :)
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby ncmprhnsbl » 18 Apr 2015, 02:56

here is another way for step 1. that finds and adds xzms to the command

Code: Select all
for a in `ls|grep xzm`; do xzm2dir $a /to/your/modulename; done
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
 
Posts: 641
Joined: 20 Mar 2012, 04:42
Location: australia
Distribution: 3.2.2-64bit xfce/openbox

Re: converting .txz files into .xzm for a whole folder

Postby francois » 21 Jul 2015, 18:40

@ncmprhnsbl:

This is not what I intended in the first post but this would please me now if it worked, but I would like to get a final single module for all of the modules at the end. I will have to try it: converting xzm into txz needs these batch steps:
1.0 create dir for each xzm
2.0 xzm2dir
3.0 dir2txz
4.0 pack into single module all the txz which could be provided by porteus package tools.

Is there a simple way to have that done?
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby sunnysideofthesun » 21 Jul 2015, 20:34

As for a topic title: script from this thread didn't work for your task [SCRIPT] stxz2zxm (smart? txz converter) ?
As for last post, I'm afraid I don't really understand what do you want to convert and into what. Seems like directions have changed.
User avatar
sunnysideofthesun
Black ninja
Black ninja
 
Posts: 62
Joined: 24 Apr 2015, 23:16
Location: check the logs
Distribution: other

Re: converting .txz files into .xzm for a whole folder

Postby ncmprhnsbl » 22 Jul 2015, 00:31

@sunny beware old threads ;-)

@francois "theres more than one way to grep a cat" (some are v messy) i can't see any value in converting modules to .txz
"Is there a simple way to have that done?"
open a terminal in the directory where your modules are(or cd), and do (as root):
Code: Select all
for a in `ls|grep xzm`; do xzm2dir $a /to/your/modulename; done

then
Code: Select all
dir2xzm  /to/your/modulename  <mergedmodule>.xzm
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
 
Posts: 641
Joined: 20 Mar 2012, 04:42
Location: australia
Distribution: 3.2.2-64bit xfce/openbox

Re: converting .txz files into .xzm for a whole folder

Postby francois » 22 Jul 2015, 01:10

@ncmprhnsbl
I can't see any value in converting modules to .txz

What I want to do is to convert a folder in which there is gparted and its many dependencies separately in the module form. I realize that it would have been better to have them merged together. Maybe you have an even simpler solution to achieve this goal. Do you?

So some kind of function to merge xzms.
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4585
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: converting .txz files into .xzm for a whole folder

Postby Bogomips » 22 Jul 2015, 23:13

ncmprhnsbl wrote:open a terminal in the directory where your modules are(or cd), and do (as root):
Code: Select all
for a in `ls|grep xzm`; do xzm2dir $a /to/your/modulename; done

Why grep?
Code: Select all
for a in *.xzm; do xzm2dir $a /to/your/modulename; done

ncmprhnsbl wrote:then
Code: Select all
dir2xzm  /to/your/modulename  <mergedmodule>.xzm
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
Bogomips
Full of knowledge
Full of knowledge
 
Posts: 2171
Joined: 25 Jun 2014, 16:21
Location: London
Distribution: 3.2.2 Cinnamon & KDE5

Re: converting .txz files into .xzm for a whole folder

Postby donald » 23 Jul 2015, 09:53

@ francois
Hi
how about this?
https://www.porteus-apps.org/?q=xzm/mergexzm-11
(the link works at Time of posting)
donald
Full of knowledge
Full of knowledge
 
Posts: 996
Joined: 17 Jun 2013, 14:17
Location: Germany
Distribution: Porteus 3.2.2 XFCE 32bit

Next

Return to Programming



Who is online

Users browsing this forum: No registered users and 1 guest