Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
53e6507e
Commit
53e6507e
authored
Jan 14, 2011
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in the trailing-slash handling.
parent
3feece59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mnt-excl
support/mnt-excl
+6
-4
No files found.
support/mnt-excl
View file @
53e6507e
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
# can exclude some absolute paths from the transfer based on the mount
# can exclude some absolute paths from the transfer based on the mount
# dirs. For instance:
# dirs. For instance:
#
#
# awk '{print $2}' /proc/mounts | rsync -avf 'merge,/- -' /dir host:/dest/
# awk '{print $2}' /proc/mounts | grep -v '^/$' | \
# rsync -avf 'merge,/- -' /dir host:/dest/
use
strict
;
use
strict
;
use
warnings
;
use
warnings
;
...
@@ -32,8 +33,9 @@ use Cwd 'abs_path';
...
@@ -32,8 +33,9 @@ use Cwd 'abs_path';
my
$file
=
'/proc/mounts'
;
my
$file
=
'/proc/mounts'
;
my
$dir
=
shift
||
'/'
;
my
$dir
=
shift
||
'/'
;
$dir
=
abs_path
(
$dir
);
my
$trailing_slash
=
$dir
=~
m{./$}
?
'/'
:
''
;
$dir
=~
s
#([^/]*)$##;
$dir
=
abs_path
(
$dir
)
.
$trailing_slash
;
$dir
=~
s{([^/]*)$}{}
;
my
$trailing
=
$1
;
my
$trailing
=
$1
;
$trailing
=
''
if
$trailing
eq
'.'
||
!-
d
"$dir$trailing"
;
$trailing
=
''
if
$trailing
eq
'.'
||
!-
d
"$dir$trailing"
;
$trailing
.=
'/'
if
$trailing
ne
''
;
$trailing
.=
'/'
if
$trailing
ne
''
;
...
@@ -41,7 +43,7 @@ $trailing .= '/' if $trailing ne '';
...
@@ -41,7 +43,7 @@ $trailing .= '/' if $trailing ne '';
open
(
IN
,
$file
)
or
die
"Unable to open $file: $!\n"
;
open
(
IN
,
$file
)
or
die
"Unable to open $file: $!\n"
;
while
(
<
IN
>
)
{
while
(
<
IN
>
)
{
$_
=
(
split
)[
1
];
$_
=
(
split
)[
1
];
next
unless
s
#^\Q$dir$trailing\E##
o && $_ ne '';
next
unless
s
{^\Q$dir$trailing\E}{}
o
&&
$_
ne
''
;
print
"- /$trailing$_\n"
;
print
"- /$trailing$_\n"
;
}
}
close
IN
;
close
IN
;
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