converting .txz files into .xzm for a whole folder

For discussions about programming and projects not necessarily associated with Porteus.
User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

converting .txz files into .xzm for a whole folder

Post#1 by francois » 28 Feb 2015, 02: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
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#2 by francois » 28 Feb 2015, 03: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
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#3 by francois » 28 Feb 2015, 03: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
Prendre son temps, profiter de celui qui passe.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

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

Post#4 by fanthom » 28 Feb 2015, 20: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
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#5 by francois » 28 Feb 2015, 23:57

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

Thanks.
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#6 by francois » 17 Apr 2015, 18:01

@fanthom:
Would there be some command for merging modules from a directory into a bundle?
Thanks.
Prendre son temps, profiter de celui qui passe.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

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

Post#7 by ncmprhnsbl » 17 Apr 2015, 22: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 http://forum.porteus.org/viewtopic.php?f=75&t=3532
not sure if his link working...
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#8 by francois » 17 Apr 2015, 23: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. :)
Prendre son temps, profiter de celui qui passe.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

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

Post#9 by ncmprhnsbl » 18 Apr 2015, 01: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 : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#10 by francois » 21 Jul 2015, 17: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?
Prendre son temps, profiter de celui qui passe.

User avatar
sunnysideofthesun
Black ninja
Black ninja
Posts: 62
Joined: 24 Apr 2015, 22:16
Distribution: other
Location: check the logs

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

Post#11 by sunnysideofthesun » 21 Jul 2015, 19:34

As for a topic title: script from this thread didn't work for your task http://forum.porteus.org/viewtopic.php?f=53&t=957 ?
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
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

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

Post#12 by ncmprhnsbl » 21 Jul 2015, 23: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 : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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

Post#13 by francois » 22 Jul 2015, 00: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.
Prendre son temps, profiter de celui qui passe.

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

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

Post#14 by Bogomips » 22 Jul 2015, 22: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

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

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

Post#15 by donald » 23 Jul 2015, 08:53

@ francois
Hi
how about this?
https://www.porteus-apps.org/?q=xzm/mergexzm-11
(the link works at Time of posting)

Post Reply