IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24374


Ignore:
Timestamp:
Jun 10, 2009, 4:17:26 PM (17 years ago)
Author:
jhoblitt
Message:

add --xattr flag to dsget

Location:
trunk/DataStore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/Changes

    r19602 r24374  
    77    - change ds*ls utilties to always return the HTTP status code - 300 as the
    88      exit status
     9    - add --xattr flag to dsget
    910
    10110.07 Mon May 12 12:04:24 HST 2008
  • trunk/DataStore/scripts/dsget

    r19742 r24374  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2006-2008  Joshua Hoblitt
    4 #
    5 # $Id: dsget,v 1.35 2008-09-24 21:58:03 jhoblitt Exp $
     3# Copyright (C) 2006-2009  Joshua Hoblitt
    64
    75use strict;
     
    97
    108use vars qw( $VERSION );
    11 $VERSION = '0.02';
     9$VERSION = '0.03';
    1210
    1311use DataStore;
     
    2826    $server,
    2927    $compress,
    30     $timeout
     28    $timeout,
     29    @xattrs,
    3130);
    3231
     
    4342    'filename|f=s'  => \$filename,
    4443    'compress|c'    => \$compress,
    45     'timeout|t=s'     => \$timeout,
     44    'timeout|t=s'   => \$timeout,
     45    'xattr|x=s'     => \@xattrs,
    4646) or pod2usage( 2 );
    4747
     
    159159    require Nebulous::Client;
    160160    import Nebulous::Client;
     161    require Nebulous::Util;
     162    import Nebulous::Util qw( :standard );
    161163    require File::Copy;
    162164    import File::Copy;
     
    188190        or die "Nebulous can't set xattr on key $filename";
    189191
     192    if (scalar @xattrs) {
     193        write_xattrs($neb, $filename, @xattrs)
     194            or die "Nebulous set xattrs on key $filename";
     195    }
     196
    190197    open(my $src_fh, $tmpfilename) or die "can't open file $tmpfilename: $!";
    191198
     
    230237
    231238    dsget --uri <uri> --filename <filename> [--bytes <nbytes>] [--md5 <hex>]
    232         [--compress] [--nebulous] [--volume <volume name>] [--copies <n>]
     239        [--compress] [--nebulous] [--xattr user.<name>:<value>]
     240        [--volume <volume name>] [--copies <n>]
    233241
    234242=head1 DESCRIPTION
     
    265273Optional.
    266274
     275=item * --xattr|-x
     276
     277Flag to set a Nebulous xattr on C<--filename>.  Can be specified more than
     278once.
     279
     280Optional.
     281
    267282=item * --compress|-c
    268283
     
    306321=head1 COPYRIGHT
    307322
    308 Copyright (C) 2006-2008  Joshua Hoblitt.  All rights reserved.
     323Copyright (C) 2006-2009  Joshua Hoblitt.  All rights reserved.
    309324
    310325This program is free software; you can redistribute it and/or modify it under
  • trunk/DataStore/t/07_file.t

    r6633 r24374  
    115115        uri         => "http://localhost:$port/somefile",
    116116        fileid      => '12buckelyourshoe',
    117         bytes       => 9,
     117        bytes       => 10,
    118118        md5sum      => 'a0a6e1a375117c58d77221f10c5ce12e',
    119119        type        => 'chip',
     
    129129        uri         => "http://localhost:$port/somefile",
    130130        fileid      => '12buckelyourshoe',
    131         bytes       => 9,
     131        bytes       => 10,
    132132        md5sum      => 'a0a6e1a375117c58d77221f10c5ce12e',
    133133        type        => 'chip',
Note: See TracChangeset for help on using the changeset viewer.