Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a69a6090
Commit
a69a6090
authored
Mar 18, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #512466: Script to move faqwiz entries.
parent
a974888d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
Tools/faqwiz/README
Tools/faqwiz/README
+1
-0
Tools/faqwiz/move-faqwiz.sh
Tools/faqwiz/move-faqwiz.sh
+49
-0
No files found.
Tools/faqwiz/README
View file @
a69a6090
...
...
@@ -21,6 +21,7 @@ faqw.py executable script to be edited and installed in cgi-bin
faqwiz.py main module, lives in same directory as FAQ entry files
faqconf.py main configuration module
faqcust.py additional local customization module (optional)
move-faqwiz.sh Script to move faqwiz entries.
What's New?
...
...
Tools/faqwiz/move-faqwiz.sh
0 → 100755
View file @
a69a6090
#!/bin/sh
#
# Christian Reis <kiko@async.com.br>
#
# Moves
#
# Example:
#
# blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2
# Moving FAQ question 02.001 to 03.002
if
[
x
$2
==
x
]
;
then
echo
"Need 2 args: original_version final_version."
exit
2
fi
if
[
!
-d
data
-o
!
-d
data/RCS
]
;
then
echo
"Run this inside the faqwiz data/ directory's parent dir."
exit
2
fi
function
cut_n_pad
()
{
t
=
`
echo
$1
|
cut
-d
.
-f
$2
`
export
$3
=
`
echo
$t
|
awk
"{ tmp =
\\
$0
; l = length(tmp); for (i = 0; i <
$2
-l+1; i++) { tmp = "
0
".tmp } print tmp }"
`
}
cut_n_pad
$1
1 prefix1
cut_n_pad
$1
2 suffix1
cut_n_pad
$2
1 prefix2
cut_n_pad
$2
2 suffix2
tmpfile
=
tmp
$RANDOM
.tmp
file1
=
faq
$prefix1
.
$suffix1
.htp
file2
=
faq
$prefix2
.
$suffix2
.htp
echo
"Moving FAQ question
$prefix1
.
$suffix1
to
$prefix2
.
$suffix2
"
sed
-e
"s/
$1
\.
/
$2
\.
/g"
data/
$file1
>
${
tmpfile
}
1
sed
-e
"s/
$1
\.
/
$2
\.
/g"
data/RCS/
$file1
,v
>
${
tmpfile
}
2
if
[
-f
data/
$file2
]
;
then
echo
"Target FAQ exists. Won't clobber."
exit
2
fi
mv
${
tmpfile
}
1 data/
$file2
mv
${
tmpfile
}
2 data/RCS/
$file2
,v
mv
data/
$file1
data/
$file1
.orig
mv
data/RCS/
$file1
,v data/RCS/
$file1
,v.orig
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