Jump to content


non-interactive update of typemap

typemap

  • Please log in to reply
5 replies to this topic

#1 ian.morris@trad.fi

ian.morris@trad.fi

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 23 January 2019 - 12:40 PM

Hi.

I'm putting together a script to build a Perforce server as we deploy our servers using code whenever possible. I've got stuck on updating the typemap table and we need to add several entries for working with Unreal Editor. Is there a way to add entries to the typemap table non interactively?

Thanks

#2 Domenic

Domenic

    Advanced Member

  • Members
  • PipPipPip
  • 94 posts

Posted 24 January 2019 - 01:00 AM

You could try 'p4 typemap -o > some_file', manipulate some_file to have the typemap settings you want, then run 'p4 typemap -i < some_file'.

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 784 posts

Posted 24 January 2019 - 01:23 AM

The --field global opt is your friend here (and everywhere, really).  You should be able to add a line by doing:

p4 --field Typemap+="binary //....pdf" typemap -o | p4 typemap -i

which is the equivalent of writing a bunch of perl (or whatever) to munge the form, minus the part where you have to write a bunch of perl.  :)

You can pass multiple instances of "--field Typemap+=whatever" on a single command line, or you can do it iteratively and the += operator will just append whatever you supply to the existing table.

#4 ian.morris@trad.fi

ian.morris@trad.fi

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 24 January 2019 - 09:07 AM

View PostDomenic, on 24 January 2019 - 01:00 AM, said:

You could try 'p4 typemap -o > some_file', manipulate some_file to have the typemap settings you want, then run 'p4 typemap -i < some_file'.

I tried this method first but it responded with "Typemap not changed." Not sure why. I tried a few different typemaps but none saved. Thanks for the suggestion though

#5 ian.morris@trad.fi

ian.morris@trad.fi

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 24 January 2019 - 09:08 AM

View PostDomenic, on 24 January 2019 - 01:00 AM, said:

You could try 'p4 typemap -o > some_file', manipulate some_file to have the typemap settings you want, then run 'p4 typemap -i < some_file'.

This option worked for me so I will go with this.I appreciate the help.

#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 784 posts

Posted 24 January 2019 - 03:18 PM

View PostSambwise, on 24 January 2019 - 01:23 AM, said:

p4 --field Typemap+="binary //....pdf" typemap -o | p4 typemap -i


Whoops, name of the field is "TypeMap" and it's case-sensitive.  :D

Feels like a bug in the spec parsing logic that it doesn't accept the input AND doesn't give an error...





Also tagged with one or more of these keywords: typemap

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users