projects
/
grml-hwinfo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
866e945
)
Do not overwrite existing info.tar.bz2 files but use timestamp in filename instead
author
Michael Prokop
<mika@grml.org>
Mon, 11 Jun 2007 10:17:58 +0000
(12:17 +0200)
committer
Michael Prokop
<mika@grml.org>
Mon, 11 Jun 2007 10:17:58 +0000
(12:17 +0200)
debian/changelog
patch
|
blob
|
history
grml-hwinfo
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index
655ea0a
..
b99c347
100644
(file)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-3,6
+3,8
@@
grml-hwinfo (0.3-3) unstable; urgency=low
[Michael Prokop]
* Improve code layout (like checks for binaries, portability for
non-grml system).
[Michael Prokop]
* Improve code layout (like checks for binaries, portability for
non-grml system).
+ * Do not overwrite existing info.tar.bz2 files but use timestamp
+ in filename instead.
[Alexander Wirt]
* Add procinfo to suggests.
[Alexander Wirt]
* Add procinfo to suggests.
diff --git
a/grml-hwinfo
b/grml-hwinfo
index
29c898e
..
b96d2e8
100755
(executable)
--- a/
grml-hwinfo
+++ b/
grml-hwinfo
@@
-4,7
+4,7
@@
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Jun 11 12:
05:32
CEST 2007 [mika]
+# Latest change: Mon Jun 11 12:
15:04
CEST 2007 [mika]
################################################################################
# Notice: Some ideas have been taken from
# http://club.black.co.at/david/hwdb/infodump
################################################################################
# Notice: Some ideas have been taken from
# http://club.black.co.at/david/hwdb/infodump
@@
-12,12
+12,12
@@
################################################################################
# variables
################################################################################
# variables
-UNAME=
$(uname -r)
-PN=
$(basename $0)
+UNAME=
"$(uname -r)"
+PN=
"$(basename $0)"
VERSION='0.3'
VERSION='0.3'
-if [ -z "$INFOFILE" ]; then
-
INFOFILE='info.tar.bz2'
-fi
+
+
[ -n "$INFOFILE" ] ||
INFOFILE='info.tar.bz2'
+
if [ "$(id -u)" != 0 ] ; then
NOTROOT=1
if [ "$(id -u)" != 0 ] ; then
NOTROOT=1
@@
-181,7
+181,14
@@
fi
)
# finally create the tarball
)
# finally create the tarball
-tar jcf $INFOFILE info/ && rm -Rf info/
+if [ -f "$INFOFILE" ] ; then
+ DATE="$(date +%Y%m%d_%H:%M:%S)"
+ INFOFILE="info_$DATE.tar.bz2"
+ echo "Warning: $INFOFILE exists already, using $INFOFILE instead.">&1
+ tar jcf $INFOFILE info/ && rm -Rf info/
+else
+ tar jcf $INFOFILE info/ && rm -Rf info/
+fi
echo
[ -r "$INFOFILE" ] && echo "$INFOFILE ($(ls -ahl $INFOFILE | awk '{print $5}')) has been generated."
echo
[ -r "$INFOFILE" ] && echo "$INFOFILE ($(ls -ahl $INFOFILE | awk '{print $5}')) has been generated."