Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augtool almost works in Windows Server 2012 R2 #476

Open
isosadam opened this issue Jun 26, 2017 · 2 comments
Open

Augtool almost works in Windows Server 2012 R2 #476

isosadam opened this issue Jun 26, 2017 · 2 comments
Labels

Comments

@isosadam
Copy link

isosadam commented Jun 26, 2017

Hoping you can help, because I REALLY want to be able to use augtool in Windows (cygwin) like I can in Linux. The tool I'm building needs to be able to edit files (.xml, .sh, .properties) in Linux and on Windows, and I'd like to be able to use 1 tool for both platforms.

I've tried installing the 1.8 latest tar.gz straight up and also using the cygport method. Both have the same results. I'm using augtool from a bash script like so....

#!/bin/bash

cat <<EOF | augtool -At "Xml.lns incl ${TEMP_FILE}"
set /files/${TEMP_FILE}/Server/Service/Connector/#attribute/port "${APP_PORT}"
set /files/${TEMP_FILE}/Server/Service/Connector/#attribute/proxyName "${PROXY_NAME}"
set /files/${TEMP_FILE}/Server/Service/Connector/#attribute/proxyPort "${PROXY_PORT}"
set /files/${TEMP_FILE}/Server/Service/Connector/#attribute/scheme "${PROXY_SCHEME}"
set /files/${TEMP_FILE}/Server/Service/Connector/#attribute/secure "true"
save
EOF

$TEMP_FILE ends up with the whole file being truncated except for the "Service" and "Connector" tags.

<Server><Service><Connector port="8080"
                 proxyName="jira-stage.example.com"
                 proxyPort="443"
                 scheme="https" secure="true"></Connector>
</Service>
</Server>

This works GREAT in Linux, but I can't figure out why it is behaving differently in Cygwin.
Thanks - Adam

@lutter
Copy link
Member

lutter commented Jun 27, 2017

Hi Adam,

first off, this is fantastic - getting Augeas to work on Windows has been a longstanding thorny issue, and I didn't know about the cygport effort (see for example issue #395)

One thing you can try is put print /augeas//errors into your commands after save to see if anything gets reported, though it might well be that something during save fails silently; in that case, I fear you'd have to pull out a debugger and see if you can spot anything.

Unfortunately, I am about to go on vacation till mid-July and won't have time to look into this myself until after I get back. But it might be worth posting about your issue to the mailing list and see if anybody there is some insight into this issue.

@isosadam
Copy link
Author

Thanks for the reply! I'm hoping there is just some cygwin package I'm missing that is an undocumented dependancy. I sent an email to the list, maybe someone will know.

Is there an implementation of memstream that I'm missing? Sorry, I don't know much about how Augeas is built.

A quick find on the filesystem turns up this..../usr/src/debug/cygwin-2.8.0-1/newlib/libc/stdio/open_memstream.c. Not sure if that helps in anyway....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants