Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 855810 Details for
Bug 1058076
[PATCH WIP] spec: implement macros with inline shell command
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH v2] spec: implement macros with inline shell command
implement_macros_with_inline_shell_command.patch (text/plain), 1.75 KB, created by
Igor Gnatenko
on 2014-01-26 21:57:43 UTC
(
hide
)
Description:
[PATCH v2] spec: implement macros with inline shell command
Filename:
MIME Type:
Creator:
Igor Gnatenko
Created:
2014-01-26 21:57:43 UTC
Size:
1.75 KB
patch
obsolete
># HG changeset patch ># User Igor Gnatenko <i.gnatenko.brain@gmail.com> ># Date 1390772482 -14400 ># Mon Jan 27 01:41:22 2014 +0400 ># Node ID 1caee82d412cced0f4493d9f7a0b11afe639821d ># Parent c9cad40b418113f62ce3481f66351137b90910ef >spec: implement macros with inline shell command > >test spec: >%define shortcommit %(c=0bff2a6fb8f9c879aa72e3b11e48e022b5bac790; echo ${c:0:7}) >Name: cmd >Version: 0.1 >Release: 1.git%{shortcommit}%{?dist} >%changelog > >Command inside %() is shell command, which we should execute > >diff -r c9cad40b4181 -r 1caee82d412c runtime/ftplugin/spec.vim >--- a/runtime/ftplugin/spec.vim Fri Jan 24 19:55:37 2014 +0100 >+++ b/runtime/ftplugin/spec.vim Mon Jan 27 01:41:22 2014 +0400 >@@ -151,7 +151,27 @@ > let definestr = "^[ \t]*%define[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$" > let linenum = search(definestr, "bW") > if (linenum != -1) >- let ret = ret . substitute(getline(linenum), definestr, "\\1", "") >+ let macro = substitute(getline(linenum), definestr, "\\1", "") >+ let start = match(macro, "^%(") >+ let append = macro >+ if (start != -1) >+ let end = match(macro, ")$") >+ let cmd = strpart(macro, start+2, end-(start+2)) >+ let ans = "" >+ while (ans !~? '^[yn]$') >+ let msg = "cmd: Execute " . cmd . "? ([y]es/[n]o) " >+ let ans = input(msg) >+ endwhile >+ if (ans =~? "^y$") >+ " TODO: Implement using with inside variables like this: >+ " %define commit 0bff2a6fb8f9c879aa72e3b11e48e022b5bac790 >+ " %define shortcommit %(c=%{commit}; echo ${c:0:7}) >+ let cmd_output = join(split(system(cmd), "\n")) >+ let ret = ret . cmd_output >+ let append = cmd_output >+ endif >+ endif >+ let ret = ret . append > else > let ret = ret . strpart(str, start, end+1-start) > endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1058076
:
855786
|
855797
|
855798
| 855810