Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5de5a443
Commit
5de5a443
authored
May 08, 2002
by
Raul Dias
Committed by
Alexandre Julliard
May 08, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Make possible to diff registry information that contains
timestamps. - Create safe temp files in /tmp.
parent
466ae143
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
regFixer.pl
programs/regapi/regFixer.pl
+5
-3
regRestorer.pl
programs/regapi/regRestorer.pl
+5
-1
regSet.sh
programs/regapi/regSet.sh
+23
-10
No files found.
programs/regapi/regFixer.pl
View file @
5de5a443
...
...
@@ -25,12 +25,14 @@ ${prefix} = "";
LINE:
while
(
<>
)
{
chomp
;
s/\r$//
;
# Get rid of 0x0a
s/\r$//
;
# Get rid of 0x0a
next
LINE
if
(
/^$/
);
# This is an empty line
next
LINE
if
(
/^\s*$/
);
# This is an empty line
next
LINE
if
(
/^\s*;/
);
# This is a comment (no way to diff it)
if
(
/^\[/
)
{
$
{
prefix
}
=
$
{
_
};
# assign the prefix for the forthcomming section
$
{
prefix
}
=
$
{
_
};
# assign the prefix for the forthcoming section
$
{
prefix
}
=~
s/\s+\d+$//
;
# get rid of timestamp
print
"${prefix}\n"
;
next
LINE
;
}
...
...
programs/regapi/regRestorer.pl
View file @
5de5a443
...
...
@@ -58,10 +58,14 @@ LINE: while($s = <>) {
else
{
(
$key
,
$value
)
=
(
$s
=~
/^\[(.*?)\](.+)$/
);
if
(
!
defined
(
$key
)
||
(
$key
ne
$curr_key
)
)
if
(
!
defined
(
$key
))
{
die
"Unrecognized string $s"
;
}
if
(
$key
ne
$curr_key
)
#curr_key might got chopped from regSet.sh
{
print
"\n[$key]\n"
;
}
print
"$value\n"
}
}
programs/regapi/regSet.sh
View file @
5de5a443
...
...
@@ -38,39 +38,52 @@ echo "Assuming that $2 is the \"after\" file..."
# do not attempt to regFix.pl /dev/null ...
#
echo
"Fixing exported registry files..."
FIX1_FILE
=
`
mktemp
-q
/tmp/file1_fix.XXXXXXXXX
`
FIX2_FILE
=
`
mktemp
-q
/tmp/file2_fix.XXXXXXXXX
`
DIFF_FILE
=
`
mktemp
-q
/tmp/file2_diff.XXXXXXXXX
`
FILE_TOADD_CLEAN
=
`
mktemp
-q
/tmp/file_toAdd_clean.XXXXXXXXX
`
FILE_TOADD
=
`
mktemp
-q
/tmp/file_toAdd.XXXXXXXXX
`
if
[
$1
!=
"/dev/null"
]
;
then
cat
$1
| ./regFixer.pl
>
$
1
.fix
cat
$1
| ./regFixer.pl
>
$
FIX1_FILE
fi
cat
$2
| ./regFixer.pl
>
$2
.fix
cat
$2
| ./regFixer.pl
>
$FIX2_FILE
#
# diff accordingly depending on /dev/null
#
echo
"Diffing..."
if
[
$1
!=
"/dev/null"
]
;
then
diff
$
1
.fix
$2
.fix
>
$2
.diff
diff
$
FIX1_FILE
$FIX2_FILE
>
$DIFF_FILE
else
diff /dev/null
$2
.fix
>
$2
.diff
diff /dev/null
$FIX2_FILE
>
$DIFF_FILE
fi
#
# Keep only added lines
#
echo
"Grepping keys to add and generating cleaned fixed registry file."
cat
$
2
.diff |
grep
'^> '
|
sed
-e
's/^> //'
>
$2
.toAdd.clean
cat
$
DIFF_FILE
|
grep
'^> '
|
sed
-e
's/^> //'
>
$FILE_TOADD_CLEAN
#
# Restore the file format to the regedit export 'like' format
#
echo
"Restoring key's in the regedit export format..."
cat
$
2
.toAdd.clean | ./regRestorer.pl
>
$2
.toAdd
cat
$
FILE_TOADD_CLEAN
| ./regRestorer.pl
>
$FILE_TOADD
echo
"Cleaning..."
rm
$1
.fix
$2
.fix
>
/dev/null 2>&1
rm
$2
.diff
>
/dev/null 2>&1
rm
$2
.toAdd.clean
>
/dev/null 2>&1
rm
$FIX1_FILE
$FIX2_FILE
>
/dev/null 2>&1
rm
$DIFF_FILE
>
/dev/null 2>&1
rm
$FILE_TOADD_CLEAN
>
/dev/null 2>&1
if
mv
$FILE_TOADD
$2
.toAdd
then
FILE_TOADD
=
$2
.toAdd
fi
echo
"Operation completed, result file is
$2
.toAdd
"
echo
"Operation completed, result file is
'
$FILE_TOADD
'
"
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment