Re: [fossil-users] Export artifact to archive?

2014-01-03 Thread Lluís Batlle i Rossell
On Fri, Jan 03, 2014 at 04:36:26PM +, Roy Marples wrote:
 Hi List
 
 Can fossil create an archive (tarball, zip file, etc) from a given
 artifact id WITHOUT using the web interface?
 Something like this is what I need:
 $ fossil archive ?ID | bzip2  distribution-version.tar.bz2

Hi,

fossil tarball.

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Export artifact to archive?

2014-01-03 Thread Ben Collver
On Fri, Jan 03, 2014 at 04:36:26PM +, Roy Marples wrote:
 Hi List
 
 Can fossil create an archive (tarball, zip file, etc) from a given
 artifact id WITHOUT using the web interface?
 Something like this is what I need:
 $ fossil archive ?ID | bzip2  distribution-version.tar.bz2
 
 Thanks
 
 Roy

Good morning,

You could kludge it together using other features.  Here is an untested
script to give a rough idea.

Cheers,

-Ben


$ cat fossil-archive.sh __EOF__
#!/bin/sh
url=$1
id=${2:-trunk}
if [ -z $url ]
then
echo Usage: fossil-archive.sh URL ?ID
exit 0
fi

dir=$(mktemp -d)
subdir=dist-$id

cd $dir
fossil clone $url dist.fossil
mkdir $subdir
cd -

cd $dir/$subdir
fossil open $dir/dist.fossil $id
cd -

cd $dir
tar jc $subdir
cd -

rm -fr $dir 
__EOF__

$ chmod a+rx fossil-archive.sh
$ ./fossil-archive.sh http://foo/bar dist-trunk.tar.bz2
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Export artifact to archive?

2014-01-03 Thread Roy Marples

On 03/01/2014 16:41, Lluís Batlle i Rossell wrote:

On Fri, Jan 03, 2014 at 04:36:26PM +, Roy Marples wrote:

Hi List

Can fossil create an archive (tarball, zip file, etc) from a given
artifact id WITHOUT using the web interface?
Something like this is what I need:
$ fossil archive ?ID | bzip2  distribution-version.tar.bz2


Hi,

fossil tarball.


This works well, thanks.
To use an alternate compression I can simply gunzip | bzip2 as this 
Makefile snippet shows


FOSSILID?= current

dist:
fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
gunzip -c ${DISTFILEGZ} | bzip2 ${DISTFILE}
rm ${DISTFILEGZ}

Thanks

Roy
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Export artifact to archive?

2014-01-03 Thread Roy Marples

On 03/01/2014 16:42, Richard Hipp wrote:

On Fri, Jan 3, 2014 at 11:36 AM, Roy Marples r...@marples.name wrote:


Hi List

Can fossil create an archive (tarball, zip file, etc) from a given
artifact id WITHOUT using the web interface?
Something like this is what I need:
$ fossil archive ?ID | bzip2  distribution-version.tar.bz2


http://www.fossil-scm.org/fossil/help?cmd=tarball [2]
http://www.fossil-scm.org/fossil/help?cmd=zip [3]


My thanks.
I obviously did not read the command line output regarding the -a option 
to help.
I don't know how that could be improved either, other than removing the 
-a option and just showing all the commands :)


Thanks

Roy
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Export artifact to archive?

2014-01-03 Thread Joseph R. Justice
On Fri, Jan 3, 2014 at 12:26 PM, Roy Marples r...@marples.name wrote:

 On 03/01/2014 16:41, Lluís Batlle i Rossell wrote:

 On Fri, Jan 03, 2014 at 04:36:26PM +, Roy Marples wrote:



  Can fossil create an archive (tarball, zip file, etc) from a given
 artifact id WITHOUT using the web interface?
 Something like this is what I need:
 $ fossil archive ?ID | bzip2  distribution-version.tar.bz2


 Hi,

 fossil tarball.


 This works well, thanks.
 To use an alternate compression I can simply gunzip | bzip2 as this
 Makefile snippet shows

 FOSSILID?= current

 dist:
 fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
 gunzip -c ${DISTFILEGZ} | bzip2 ${DISTFILE}
 rm ${DISTFILEGZ}


Two comments, reading the documentation from
http://fossil-scm.org/index.html/help?cmd=tarball :



(1) It would be nice if fossil tarball could write to stdout as well as to
a specified output file; this way, the creation of $(DISTFILEGZ) as an
explicit temporary file could be avoided.  (I'm pretty sure gunzip provides
for accepting input from stdin as well as from an explicit file.)

Not having looked at the code or used fossil, I'm not sure if it would be
safe to gave fossil tarball behave this way if the value for OUTPUTFILE was
simply ommitted, or if you would have to specify that a flag (say
--to-stdout perhaps) must be specified if OUTPUTFILE was missing (this, to
avoid breaking existing scripts).



(2) It would be nice if fossil tarball could either (a) output a file only
in .tar format, either in addition to or instead of (tho this latter change
would be backwards incompatible) the existing specified *presumably*
.tar.gz format behavior, and/or (b) if you could specify a compression file
format to be used (for instance, .gz, .bzip2, .7z, etc) and perhaps in some
cases a compression level (some file formats offer multiple compression
levels along a range of fastest and least compressive to slowest and
most compressive).

If you could output in only .tar format, then the use of gunzip could be
avoided.  (And if you could output in only .tar format *and* output to
stdout, then you could pipe fossil tarball to bzip2 and avoid the creation
of an explicit temporary file.)

If you could output directly to a specified compression file format, then
the use of bzip2 could be avoided as well; fossil tarball could do it all
itself.



I note that some of these suggestions (2b at a minimum) are obviously
less-traditionally-Unix-natured.  However, they'd probably be seen as
desirable by users (or at least less programmer-type users) of other
platforms (e.g. MS Windows, Mac OS/X) where I believe the use of a command
line, etc is far less ingrained.



Thanks for your time.  Hope this is of some use, interest.



Joseph
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users