Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 141097 Details for
Bug 206285
media-libs/jpeg (exifautotran) preserve timestamp feature and others
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add feature to preserve file timestamps, various fixes
exifautotran-ilugo.patch (text/plain), 1.87 KB, created by
Israel G. Lugo
on 2008-01-17 05:04:45 UTC
(
hide
)
Description:
add feature to preserve file timestamps, various fixes
Filename:
MIME Type:
Creator:
Israel G. Lugo
Created:
2008-01-17 05:04:45 UTC
Size:
1.87 KB
patch
obsolete
>--- exifautotran/exifautotran 2008-01-17 02:43:06.000000000 +0000 >+++ exifautotran-ilugo/exifautotran 2008-01-17 04:28:49.000000000 +0000 >@@ -3,15 +3,23 @@ > # > # Transforms Exif files so that Orientation becomes 1 > # >+ >+trap "if test -n \"\$tempfile\"; then rm -f \"\$tempfile\"; fi" INT QUIT TERM >+ >+preserve_timestamps="" >+ > for i > do >- case $i in >+ case "$i" in >+ -p|--pretend) preserve_timestamps="yes"; continue;; > -v|--version) echo "exifautotran"; exit 0;; > -h|--help) > cat <<EOF >-exifautotran [list of files] >+exifautotran [-p] [list of files] > > Transforms Exif files so that Orientation becomes 1 >+ >+ -p, --preserve Preserve modification time of each file. > EOF > exit 0;; > esac >@@ -28,14 +36,31 @@ > *) transform="";; > esac > if test -n "$transform"; then >- echo Executing: jpegtran -copy all $transform $i >&2 >- jpegtran -copy all $transform "$i" > tempfile >+ tempfile=`mktemp` || { >+ echo "Failed to create temporary file" >&2 >+ exit 1; >+ } >+ echo "Executing: jpegtran -copy all $transform $i" >&2 >+ jpegtran -copy all $transform "$i" > "$tempfile" > if test $? -ne 0; then >- echo Error while transforming $i - skipped. >&2 >+ echo "Error while transforming $i - skipped." >&2 >+ rm "$tempfile" > else >- rm "$i" >- mv tempfile "$i" >- jpegexiforient -1 "$i" > /dev/null >+ jpegexiforient -1 "$tempfile" > /dev/null >+ if test -n "$preserve_timestamps"; then >+ touch -r "$i" "$tempfile" >+ fi >+ # read original permissions for setting later >+ original_mode=`stat -c %a "$i"` >+ mv "$tempfile" "$i" || { >+ echo "Failed to update $i - skipped." >&2 >+ rm "$tempfile" >+ continue >+ } >+ # set original permissions only after moving the file back, >+ # to avoid setting potentially unsafe permissions on the file >+ # while it's in /tmp, where it could be accessed by anyone >+ chmod "$original_mode" "$i" > fi > fi > done
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 206285
:
141097
|
141144