Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

imgadm-repair destroys the imgadm database #130

Open
wants to merge 2 commits into from

2 participants

@MerlinDMC

the variables in single-quotes don't get replaced so imgadm-repair writes ${manifest} into all json files which breaks everything else that should work with the file.

imgadm-repair tried to update locally imported manifest which are not found in the cache file - that would save an empty manifest file.

this pull request fixes #129

MerlinDMC added some commits
@MerlinDMC MerlinDMC imgadm-repair corrupts imgadm db
replacement of variables does not work in single-quotes and "imgadm get" should be "imgadm show"
eef756c
@MerlinDMC MerlinDMC do not update the json if the manifest was not found in the cache
this is true for all locally imported datasets
450df91
@trentm trentm was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @MerlinDMC

    imgadm-repair corrupts imgadm db

    MerlinDMC authored
    replacement of variables does not work in single-quotes and "imgadm get" should be "imgadm show"
  2. @MerlinDMC

    do not update the json if the manifest was not found in the cache

    MerlinDMC authored
    this is true for all locally imported datasets
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/img/sbin/imgadm-repair
View
12 src/img/sbin/imgadm-repair
@@ -48,13 +48,13 @@ zvols=$(zfs list -pH -o name -t snapshot \
for i in ${zvols[@]} ; do
unset manifest
unset urn
- echo 'Checking for manifest with UUID: $i'
- manifest=$(imgadm get $i)
+ echo "Checking for manifest with UUID: $i"
+ manifest=$(imgadm show $i)
- if [[ -n $manifest ]] ; then
- echo '$i - manifest was found. Copying to $DBDIR'
- echo '${manifest}' > $DBDIR/$i.json
+ if [[ "$?" == "0" && -n $manifest ]] ; then
+ echo "$i - manifest was found. Copying to $DBDIR"
+ echo "${manifest}" > $DBDIR/$i.json
urn=$(cat $DBDIR/$i.json | json urn)
- echo '$i - urn: $urn'
+ echo "$i - urn: $urn"
fi
done
Something went wrong with that request. Please try again.